[yt-users] Line-of-sight density profile

Matthew Turk matthewturk at gmail.com
Thu Jan 10 19:39:46 PST 2013

Hi all,

On Thu, Jan 10, 2013 at 10:15 PM, Stephen Skory <s at skory.us> wrote:
> Hi Junhwan,
>> I would like to estimate the gas density profile between two points in the
>> simulation.
>> Let say the tow points are (x0, y0, z0) and (x1, y1, z1), and make line
>> between them.
>> This line will intersect with the grid cell and I would like to make profile
>> of the density as function of the distance from (x0, y0, z0).
> This discussion thread may help you:
> http://lists.spacepope.org/pipermail/yt-users-spacepope.org/2012-August/002863.html

This thread is pretty perfect -- it shows how to select points,
construct rays, etc.  What you can do after that is feed them to
matplotlib, with something similar to this:

import pylab
pylab.semilogy(ray["t"], ray["Density"], '-k')

You can also style it in different ways, too.  I'll ensure that this
gets added to the documentation for 2.5.

>> I think that I can use the ray object and make profile from this, but there
>> is very limited information how to do so.
> We're sorry! We'll make a note of this, and if you have any
> suggestions on how to improve them, let us know.

This is actually something I would like to briefly address.  The
organization and content of the documentation for yt has undergone
some changes over the last year or so.  We have aggressively tried to:

1) Simplify organization and clarify what each section covers
2) Increase coverage
3) Add substantial cookbook contents, including advanced use cases

The first two are challenging (and things that we've struggled with),
but the third one is something that is very easy to contribute to.  If
you  (anyone :) have a recipe that is easy but not covered elsewhere
or complex and showing something interesting, please *please* feel
free to contribute it to the documentation.  You can do this via the
pull request mechanism on BitBucket (the documentation repository is
at http://bitbucket.org/yt_analysis/yt-doc ) or even just by sending a
copy of your recipe to this mailing list.  I'm personally very eager
-- not just to see the cookbook get fleshed out, but also to see what
cool things people have done with yt!

The mailing list is very nice for communication, but very poor for
reference, and the cookbook is a good place to collect information and
ensure that it doesn't get lost as emails fall into the archive or out
of an inbox.

Good luck with the ray profile -- and let us know if you need more
assistance or if anything is unclear!


More information about the yt-users mailing list