[yt-users] Density/Column density along a ray

Matthew Turk matthewturk at gmail.com
Wed Aug 8 09:14:45 PDT 2012


Hi Britton,

I think the easiest way to get out physical distance would be to do:

distance = ((end_point - start_point)**2.0).sum()**0.5
distance *= pf['cm']  # or whatever unit you want
ray['dts'] * distance

should give the distance traveled inside each cell.

On Wed, Aug 8, 2012 at 12:09 PM, Britton Smith <brittonsmith at gmail.com> wrote:
> Hi Thomas,
>
> In addition to ray['t'], which will give you the cumulative distance
> traveled at that point in the ray, you can use ray['dts'] to get the just
> the distance through each individual cell.  Both of these will be normalized
> to the total distance of the ray, but you can use ray['dx'] to get you the
> cell size for each cell intersected by the ray, which you can then use along
> with 'dts' to calculate the physical distance the ray travels through each
> cell.
>
> Britton
>
>
> On Wed, Aug 8, 2012 at 12:03 PM, j s oishi <jsoishi at gmail.com> wrote:
>>
>> Hi Thomas,
>>
>> Try doing something like
>>
>> ray = pf.h.ray(start_point,end_point)
>>
>> density = ray['Density']
>> t = ray['t']
>>
>> where t is the distance along the ray of each sample. It will, by
>> default, sample at the highest available resolution. If you need
>> subsampling/interpolation, you'll have to wait for someone more
>> knowledgeable that I am to jump in.
>>
>> j
>> On Wed, Aug 8, 2012 at 8:56 AM, Thomas Robitaille
>> <thomas.robitaille at gmail.com> wrote:
>> > Hi
>> >
>> > I'm still relatively new to yt, and I'm trying to figure out a way to
>> > extract the density along a ray joining two points. I've managed to
>> > make a plot using PlotCollection.add_ray, but I can't figure out how
>> > to get the actual data as a Numpy array. Also, I'd ultimately like to
>> > compute the cumulative column density along the ray, so I'd like to
>> > ensure that the sampling of distances along the ray is very fine to
>> > get an accurate column density. Is there a way to do this?
>> >
>> > Thanks for any help!
>> >
>> > Cheers,
>> > Tom
>> > _______________________________________________
>> > 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
>
>
>
> _______________________________________________
> yt-users mailing list
> yt-users at lists.spacepope.org
> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>



More information about the yt-users mailing list