Re: [yt-users] Column Density 1-D Radial Profile

19 views
Skip to first unread message

Cameron Hummels

unread,
Feb 26, 2021, 7:01:26 PM2/26/21
to Discussion of the yt analysis package, trident-project-users
Hi Hassan (cc'ing trident help list),

A number density (like H I number density) is in units of cm**-3 representing the number of particles per unit volume, whereas a column density (like H I column density) is in units of cm**-2 representing the number of particles per unit area on the sky.  If you take some number density in a given volume and project it along one axis, it compresses the dimensions of that axis (calculating a line integral along that axis) to give you a column density.  That's what is happening in your second example.  You project the H_p0_number_density field along the z axis and it yields a 2D map of H I column densities, where each pixel is a line integral along the z direction.

On the other hand, in your first example, you're generating a ProfilePlot, which isn't doing any projecting at all, so it's just returning the average H I number density value at each galactocentric radius.  

What you're trying to do, to make an HI column density plot as a function of radius, doesn't make sense unless you pick a viewing angle.  One thing you could do is to make the column density plot like you did for the second example, using the ProjectionPlot functionality.  Then each pixel is a separate line integral with a distinct impact parameter (i.e. projected radius from the galactic center).  Then you could identify all the pixels that are in different radial bins and average them.  That would give you a plot showing H I column density vs projected radius from that viewing angle.  This is similar to what I do (from many different viewing angles) in my research analyses of the CGM.

I hope this helps!

Cameron

On Wed, Feb 24, 2021 at 11:26 AM <h.fa...@gmail.com> wrote:
Hello,

I would like to plot the HI column density as a function of the radius. To do this I follow these steps.
But instead of the column density (in cm-2) the y-axis is number density (in cm-3):

fn = '../IsolatedGalaxy/galaxy0030/galaxy0030'
ds = yt.load(fn)

trident.add_ion_fields(ds, ions = ['H I'], ftype = 'gas')
sphere = ds.sphere('c', (100., 'kpc'))
plot = yt.ProfilePlot(sphere, 'radius', 'H_p0_number_density', weight_field = None)
plot.save('my_fig.png')

The field 'H_p0_number_density' should return the column density because it does so
when I use the following line of code:
plot = yt.ProjectionPlot(ds, 'z', 'H_p0_number_density')
plot.save('fig.png')
Here the 'H_p0_number_density' is interpreted as column density but not as number density.

I would be very grateful if some one could help me with this issue.
Many thanks

Best regards,
Hassan
_______________________________________________
yt-users mailing list -- yt-u...@python.org
To unsubscribe send an email to yt-user...@python.org
https://mail.python.org/mailman3/lists/yt-users.python.org/
Member address: chum...@gmail.com


--
Cameron Hummels
Computational Astrophysicist
California Institute of Technology
Reply all
Reply to author
Forward
0 new messages