[yt-users] Gadget: Isolated galaxy visualization

Keita Todoroki keitee at physics.unlv.edu
Fri Nov 15 18:15:22 PST 2013


Hi all,

Thank you for your helpful suggestions, Ji-hoon!

I was able to have all the images to be centered by the center-of-mass
trick. (For Gadget, it seems we need to specify the field name, which is
["deposit","Gas_density"]. Otherwise, the code assumes ["gas","Density"]
to be read, which doesn't exist for our case. Also, we need to set
use_cells=False in order for it to work.

I am now trying to change the background color by set_under(), but it
turned out that PlotCollection in yt doesn't have it - which means
p.set_under() obviously doesn't do the job. What would be the best way to
integrate that function into this script?
http://www.physics.unlv.edu/~keitee/gadget_agora.py

Also, is this coloring the background automatically done for AMR codes?


-Keita




> Hi Keita,
>
> Thank you so much for sharing the figure.
>
> (1) As for shifting field of views as the disk moves, one could re-center
> the image at centers-of-mass of the inner 20 kpc-radius sphere.  You may
> try something like this:
>
> - my_sphere = pf.h.sphere([0.5, 0.5, 0.5], 20.0/pf["kpc"])
> - center = my_sphere.quantities["CenterOfMass"](use_cells=True,
> use_particles=True)
> - p=pc.add_projection("Sigma", ax, center=center, figure=fig,
> axes=axes[ax][0], use_colorbar=False)
>
> (2) As for the white background (I guess this is what you meant?), you may
> try to employ set_under() to replace white pixels with the color at the
> colorbar's lower limit.
> http://matplotlib.org/examples/pylab_examples/contourf_demo.html
>
> (3) I understand that:  the ways to improve the smoothing in Gadget images
> is being actively investigated now (for example, see below).  It would be
> great if Matt or anybody could say what Keita could do to test the new
> features with Gadget datasets.
> https://bitbucket.org/yt_analysis/yt-3.0/pull-request/122/fixing-smoothing-to-rather-than-normalize/diff
>
> Best regards,
> Ji-hoon
>
>
>
>
> On Nov 15, 2013, at 12:48 PM, Keita Todoroki wrote:
>
>> Hi,
>>
>> I managed to visualize gadget's isolated galaxy sims, and I'm wondering
>> if
>> I can improve the resolution of the image, especially the background,
>> somehow.
>> The image and the script can be found below:
>>
>> http://www.physics.unlv.edu/~keitee/isolated_low-res.png
>> http://www.physics.unlv.edu/~keitee/gadget_agora.py
>>
>>
>> Also, the disk moves a bit as time progresses (as you can see on the
>> right-most column), and I'm wondering if yt can adjust that shift as
>> well.
>>
>>
>> -Keita
>>
>
> ---------------------------------------------------------------
> Ji-hoon Kim
> Postdoctoral Scholar in Astrophysics
> www.jihoonkim.org
> me at jihoonkim.org / 1(650)714-2879
> ---------------------------------------------------------------
>
>
>




More information about the yt-users mailing list