[yt-users] Column density plot

Nathan Goldbaum nathan12343 at gmail.com
Mon Nov 3 20:40:10 PST 2014


On Mon, Nov 3, 2014 at 5:29 PM, Suoqing JI <suoqing at physics.ucsb.edu> wrote:

> Hi Stephanie,
>
> Maybe you could specify a disk, use BinnedProfile1D to create bins along
> cylindrical radial ('cylindrical_r'), and do
>
> profile.add_fields(‘cell_mass’, weight=None)
>
> then you could plot profile[‘cell_mass’] vs. profile['cylindrical_r’] and
> get the 1-D plot the surface density.
>

This will be a profile of the gas mass as a function of radius, but it's
not quite a surface density profile.  That said, for an unweighted
projection, I think it's the same up to a constant scaling factor.


>
> Best wishes,
> --
> Suoqing JI
> Ph.D Student
> Department of Physics
> University of California, Santa Barbara
> CA 93106, USA
>
> On Nov 3, 2014, at 5:17 PM, Stephanie Tonnesen <stonnes at gmail.com> wrote:
>
> Hi yt-users,
>
> I would like to make a 1D plot of column density vs radius for a disk (to
> compare with observations).  I can make a projectionplot, but want
> something a bit more simple to look at.  I am using yt3.0.1--is there a
> nice way to to this?
>
>
The key is to use the numpy.digitize and numpy.bincount functions to find
the histogram of the surface density as a function of radius.  Here's an
example:

http://nbviewer.ipython.org/gist/ngoldbaum/af8e7f317efe8f115e8b

This is a simplified version of what I've done for a project I'm working on
right now, which involves making a ton of radial plots of projected
quantities:

https://bitbucket.org/ngoldbaum/galaxy_analysis/src/910f5a7e278247a36f25d62bdc478a7b5a7fe8ce/galanyl/galaxy_analyzer.py?at=default#cl-338

>
> Thanks!
>
> Stephanie
>
> --
> Dr. Stephanie Tonnesen
> Alvin E. Nashman Postdoctoral Fellow
> Carnegie Observatories, Pasadena, CA
> stonnes at gmail.com
>  _______________________________________________
> yt-users mailing list
> yt-users at lists.spacepope.org
> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>
>
>
> _______________________________________________
> 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/20141103/3e8c4b06/attachment.html>


More information about the yt-users mailing list