<div dir="ltr"><div>Sorry that I can't give more plotting advice - need to run - but I want to clarify what's going on with the background color.<br><br>AMR codes have data everywhere. The entire mesh is filled out with gas density values - there are no 'vacuum' cells.<br>
<br>When you do ('deposit', 'Gas_density), yt will do exactly what the field
says - particles get deposited onto the octree using nearest neighbor
interpolation. For SPH codes, visualized with nearest neighbor interpolation onto an octree, there will be some octree cells that happen to not have any particles. Cells that do not contain particles will have a density of zero, and show up blank on the plots you're making since you are using a log scale.<br>
<br></div>Once SPH smoothing (done properly with adaptive smoothing lengths) is incorporated into yt, you should be back in the AMR regime where all of the octree cells have nonzero values.<br></div><div class="gmail_extra">
<br><br><div class="gmail_quote">On Fri, Nov 15, 2013 at 6:15 PM, Keita Todoroki <span dir="ltr"><<a href="mailto:keitee@physics.unlv.edu" target="_blank">keitee@physics.unlv.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi all,<br>
<br>
Thank you for your helpful suggestions, Ji-hoon!<br>
<br>
I was able to have all the images to be centered by the center-of-mass<br>
trick. (For Gadget, it seems we need to specify the field name, which is<br>
["deposit","Gas_density"]. Otherwise, the code assumes ["gas","Density"]<br>
to be read, which doesn't exist for our case. Also, we need to set<br>
use_cells=False in order for it to work.<br>
<br>
I am now trying to change the background color by set_under(), but it<br>
turned out that PlotCollection in yt doesn't have it - which means<br>
p.set_under() obviously doesn't do the job. What would be the best way to<br>
integrate that function into this script?<br>
<a href="http://www.physics.unlv.edu/~keitee/gadget_agora.py" target="_blank">http://www.physics.unlv.edu/~keitee/gadget_agora.py</a><br>
<br>
Also, is this coloring the background automatically done for AMR codes?<br>
<span class="HOEnZb"><font color="#888888"><br>
<br>
-Keita<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
<br>
<br>
<br>
> Hi Keita,<br>
><br>
> Thank you so much for sharing the figure.<br>
><br>
> (1) As for shifting field of views as the disk moves, one could re-center<br>
> the image at centers-of-mass of the inner 20 kpc-radius sphere. You may<br>
> try something like this:<br>
><br>
> - my_sphere = pf.h.sphere([0.5, 0.5, 0.5], 20.0/pf["kpc"])<br>
> - center = my_sphere.quantities["CenterOfMass"](use_cells=True,<br>
> use_particles=True)<br>
> - p=pc.add_projection("Sigma", ax, center=center, figure=fig,<br>
> axes=axes[ax][0], use_colorbar=False)<br>
><br>
> (2) As for the white background (I guess this is what you meant?), you may<br>
> try to employ set_under() to replace white pixels with the color at the<br>
> colorbar's lower limit.<br>
> <a href="http://matplotlib.org/examples/pylab_examples/contourf_demo.html" target="_blank">http://matplotlib.org/examples/pylab_examples/contourf_demo.html</a><br>
><br>
> (3) I understand that: the ways to improve the smoothing in Gadget images<br>
> is being actively investigated now (for example, see below). It would be<br>
> great if Matt or anybody could say what Keita could do to test the new<br>
> features with Gadget datasets.<br>
> <a href="https://bitbucket.org/yt_analysis/yt-3.0/pull-request/122/fixing-smoothing-to-rather-than-normalize/diff" target="_blank">https://bitbucket.org/yt_analysis/yt-3.0/pull-request/122/fixing-smoothing-to-rather-than-normalize/diff</a><br>
><br>
> Best regards,<br>
> Ji-hoon<br>
><br>
><br>
><br>
><br>
> On Nov 15, 2013, at 12:48 PM, Keita Todoroki wrote:<br>
><br>
>> Hi,<br>
>><br>
>> I managed to visualize gadget's isolated galaxy sims, and I'm wondering<br>
>> if<br>
>> I can improve the resolution of the image, especially the background,<br>
>> somehow.<br>
>> The image and the script can be found below:<br>
>><br>
>> <a href="http://www.physics.unlv.edu/~keitee/isolated_low-res.png" target="_blank">http://www.physics.unlv.edu/~keitee/isolated_low-res.png</a><br>
>> <a href="http://www.physics.unlv.edu/~keitee/gadget_agora.py" target="_blank">http://www.physics.unlv.edu/~keitee/gadget_agora.py</a><br>
>><br>
>><br>
>> Also, the disk moves a bit as time progresses (as you can see on the<br>
>> right-most column), and I'm wondering if yt can adjust that shift as<br>
>> well.<br>
>><br>
>><br>
>> -Keita<br>
>><br>
><br>
> ---------------------------------------------------------------<br>
> Ji-hoon Kim<br>
> Postdoctoral Scholar in Astrophysics<br>
> <a href="http://www.jihoonkim.org" target="_blank">www.jihoonkim.org</a><br>
> <a href="mailto:me@jihoonkim.org">me@jihoonkim.org</a> / <a href="tel:1%28650%29714-2879" value="+16507142879">1(650)714-2879</a><br>
> ---------------------------------------------------------------<br>
><br>
><br>
><br>
<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>
</div></div></blockquote></div><br></div>