<div dir="ltr">Hi Stefano,<div><br></div><div style>I think I can help explain why that line you last emailed is the correct one.</div><div style><br></div><div style>The c[1] and center='max' do two different things.  The c[1] tells it to slice the y dimension at y=c[1]. The center='max' tells it where to center the image in the x-z plane.  If you don't have the center='max', then you'll end up at the center of the domain I think, where you might have poor resolution.  </div>

<div style><br></div><div style>Since the projection doesn't need a specified c[1] like value, it correctly centers simply using the center='max' or center=c command.</div><div style><br></div><div style>Hopefully that clears it up a bit.  </div>

<div style><br></div><div style>Best,</div><div style>Sam</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Apr 29, 2013 at 8:17 AM, stefano bovino <span dir="ltr"><<a href="mailto:poetaste@gmail.com" target="_blank">poetaste@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div>Hi Matt,<br></div>I tried to make some changes following one of your previous suggestions (mixing):<div class="im">

<br><br>v, c = pf.h.find_max("Density")<br></div>slc = pf.h.slice(1, c[1], fields=["Density","Temperature","VelocityMagnitude"],center="max")<br>
<br></div>this is the way how it works... do you have any explanation?<br><br></div>Thanks<span class="HOEnZb"><font color="#888888"><br>Stefano<br></font></span></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra">

<br><br><div class="gmail_quote">On Mon, Apr 29, 2013 at 3:33 PM, stefano bovino <span dir="ltr"><<a href="mailto:poetaste@gmail.com" target="_blank">poetaste@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Hi Matt,<br>thanks for the suggestion... the projection works well only if I use c instead of max but the slice still not working, here following the code:<div>


<br><br>v, c = pf.h.find_max("Density")<br></div>
slc = pf.h.slice(2, c[2], fields=["Density","Temperature","VelocityMagnitude"])<br>proj = pf.h.proj(2, "Density", weight_field="Density", center=c)<span><font color="#888888"><br>


<br></font></span></div><span><font color="#888888">Stefano<br>
</font></span></div><div><div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Apr 29, 2013 at 3:10 PM, Matthew Turk <span dir="ltr"><<a href="mailto:matthewturk@gmail.com" target="_blank">matthewturk@gmail.com</a>></span> wrote:<br>



<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Stefano,<br>
<br>
Changing the argument to ' center = "max" ' for proj should fix the<br>
projection, but for slice you will need to change:<br>
<br>
v, c = pf.h.find_max("Density")<br>
<br>
slc = pf.h.slice(2, c[2], ...<br>
<br>
So that it also slices at the point of maximum density.  Note also<br>
that if you want to slice along x, you would change the 2's to 0's,<br>
for y you would change to 1.<br>
<br>
-Matt<br>
<div><div><br>
On Mon, Apr 29, 2013 at 8:59 AM, stefano bovino <<a href="mailto:poetaste@gmail.com" target="_blank">poetaste@gmail.com</a>> wrote:<br>
> Hi Kacper,<br>
> my minimal resolution is less than 1 AU, the problem seems more related to<br>
> the Matt's issue.<br>
><br>
> The script is the same as in the yt website, here the link:<br>
><br>
> <a href="http://yt-project.org/doc/cookbook/multi_plot_slice_and_proj.py" target="_blank">http://yt-project.org/doc/cookbook/multi_plot_slice_and_proj.py</a><br>
><br>
> the output of pf.h.find_max("Density") :<br>
><br>
> (1.139355201341093e-11, array([ 0.49722083,  0.50645245,  0.49492896]))<br>
><br>
> Thanks<br>
> Stefano<br>
><br>
> ---------- Forwarded message ----------<br>
> From: Kacper Kowalik <<a href="mailto:xarthisius.kk@gmail.com" target="_blank">xarthisius.kk@gmail.com</a>><br>
> Date: Mon, Apr 29, 2013 at 1:35 PM<br>
> Subject: Re: [yt-users] slice plot<br>
> To: <a href="mailto:yt-users@lists.spacepope.org" target="_blank">yt-users@lists.spacepope.org</a><br>
><br>
><br>
><br>
> On 04/29/2013 01:22 PM, stefano bovino wrote:<br>
>> Hi all,<br>
>> when using the following script fromt the yt.project website<br>
>><br>
>> multi_plot_slice_and_proj.py<<a href="http://yt-project.org/doc/cookbook/multi_plot_slice_and_proj.py" target="_blank">http://yt-project.org/doc/cookbook/multi_plot_slice_and_proj.py</a>>I<br>
><br>
>> have problems if I change the resolution from mpc to pc.<br>
>><br>
>> slc_frb = slc.to_frb((1.0, "mpc"), 512) --> slc_frb = slc.to_frb((1.0,<br>
>> "pc"), 512)<br>
>><br>
>> I even tried other ways (or scripts) to plot a slice of the density<br>
>> changing the resolution, but the problem is still there. Do you have any<br>
>> solution?<br>
>><br>
>> I just would like to create a 9 panels plot with slice of density, H2, and<br>
>> Temperature with three different width (on the pc scale).<br>
><br>
> Hi Stefano,<br>
> what is the size of your computational domain or size of the smallest<br>
> cell you have? You can obtain that information using:<br>
>  yt stats output_filename<br>
><br>
> Cheers,<br>
> Kacper<br>
><br>
</div></div><div><div>> _______________________________________________<br>
> yt-users mailing list<br>
> <a href="mailto:yt-users@lists.spacepope.org" target="_blank">yt-users@lists.spacepope.org</a><br>
> <a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br>
><br>
_______________________________________________<br>
yt-users mailing list<br>
<a href="mailto:yt-users@lists.spacepope.org" target="_blank">yt-users@lists.spacepope.org</a><br>
<a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>
</div></div><br>_______________________________________________<br>
yt-users mailing list<br>
<a href="mailto:yt-users@lists.spacepope.org">yt-users@lists.spacepope.org</a><br>
<a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br>
<br></blockquote></div><br></div>