[yt-users] specify bounds before constructing octree

Matthew Turk matthewturk at gmail.com
Mon May 12 04:36:36 PDT 2014


Hi Desika,

I think you're just looking for the octree itself, right?  To do that,
you can do one of two things.  The first is to generate just the
octree, which you can export; this however is hard to get the actual
values, say, smoothed density or something.  It could be done with
something like this:

from yt.data_objects.octree_subset import YTPositionArray
arr = YTPositionArray(subregion["particle_position"].in_units("code_length").v,
"code_length", registry = ds.unit_registry)
oct_handler = arr.to_octree()

But if you're looking at culling a subset of the data, your best bet
would be to do:

region = ds.region( ...
data = dict((field, region[field].in_cgs()) for field in ds.field_list)
new_ds = yt.load_particle_data(data, ...


And then new_ds will be a subset, with its own octree, etc etc.

On Sun, May 11, 2014 at 8:06 PM, Desika Narayanan
<dnarayan at haverford.edu> wrote:
> Hi Team YT,
>
> I have a gadget snapshot that I'd like to specify a sub-region of before
> constructing an octree, so that the octree built is only over the specified
> [xmin,xmax], [ymin,ymax],[zmin,zmax] subregion of the original sanpshot?
>
> Something just after pf=load(...) presumably is what I want in:
>
> http://paste.yt-project.org/show/4606/
>
> though maybe prior to the loading itself?
>
> thanks,
> desika
>
> _______________________________________________
> 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