[yt-users] Gadget: Isolated galaxy visualization

Nathan Goldbaum nathan12343 at gmail.com
Fri Nov 15 18:37:29 PST 2013


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.

AMR codes have data everywhere.  The entire mesh is filled out with gas
density values - there are no 'vacuum' cells.

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.

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.


On Fri, Nov 15, 2013 at 6:15 PM, Keita Todoroki <keitee at physics.unlv.edu>wrote:

> 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
> > ---------------------------------------------------------------
> >
> >
> >
>
> _______________________________________________
> yt-users mailing list
> yt-users at lists.spacepope.org
> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.spacepope.org/pipermail/yt-users-spacepope.org/attachments/20131115/f09eb642/attachment.html>


More information about the yt-users mailing list