[yt-users] object.hierarchy.ray( )

Matthew Turk matthewturk at gmail.com
Wed Nov 6 07:38:52 PST 2013


Hi Yong,

So it's not *quite* a bug.  warmhot.hierarchy is the same as pf.h, so
it's not applying the subsets in sequence.  We don't currently have a
method for stacking rays on top of cut regions.  You can report this
as a feature request here:

https://bitbucket.org/yt_analysis/yt/issues/new

To get what you're looking for, you'll have to just do something like this:

ray = pf.h.ray( ... )
ii = (ray["Temperature"] > 1e5) & (ray["Temperature"] < 1e6)

and then you can do things like:

ray["t"][ii]

Note that the sum of the dts won't be 1.0 in this case, since you're
cutting out between them, but you should be able to get the other
quantities you're looking for.

-Matt



On Wed, Nov 6, 2013 at 10:36 AM, Yong Zheng <yz2505 at columbia.edu> wrote:
> Hi,
>
> I am trying to use the .hierarchy.ray( ) to extract data along a particular
> light ray, but when I check the temperature field of that light ray data, I
> find that the data points it extracted were not really what I want, the
> temperature range goes beyond my limit, here is part of my code:
>
>     sp = pf.h.sphere(center, radius)
>     warmhot = sp.cut_region(['grid["Temperature"] >= 1e5',
> 'grid["Temperature"] < 1e6'])
>     p0 = np.array([center[0], center[1]-250./pf['kpc'], center[2]])
>     p1 = np.array([center[0], center[1]+250./pf['kpc'], center[2]])
>     ray = warmhot.hierarchy.ray(p0, p1)
>     tempt = warmhot['Temperature']
>     ray_tempt = ray['Temperature']
>
>  when I examine the temperature range for warmnot, it is
>      (100000.1171875, 999999.5625)
> but for ray_tempt, it is:
>      (6607.2802734375, 86239664.0)
> which is strange since the 'ray' data should be a subset of 'warmhot'... Is
> there any explanation for it?
>
> Thanks!
> - Yong
>
>
> _______________________________________________
> 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