[yt-users] data container selection by field value

Marc Schartmann schartmann at mpe.mpg.de
Wed Apr 2 05:57:48 PDT 2014


Hi Elizabeth,

great, thanks! This saves me a lot of time.

There is a small typo in the code fragment:

new_container = dd.extract_region(ind)

Thanks again and best wishes,

Marc


On Apr 2, 2014, at 2:16 PM, Elizabeth Tasker <tasker at astro1.sci.hokudai.ac.jp> wrote:

> Hi Marc,
> 
> Yes. This can be done with extract_region if you have a list of indices for the cells you require. 
> 
> e.g. 
> 
> # create data container of whole region
> dd = pf.h.all_data()  
> 
> # get the indices that correspond to the cells you want
> ind = dd[“TracerField”] > my_theshhold
> 
> # create new container
> new_container = dd.extract.region(ind)
> 
> 
> Elizabeth
> 
> 
> 
> On Apr 2, 2014, at 9:05 PM, Marc Schartmann <schartmann at mpe.mpg.de> wrote:
> 
>> Dear all,
>> 
>> is it possible to create a data container in which only those cells are included in which one of the fields (e.g. the tracer field) has 
>> a value above a certain threshold?
>> 
>> Thanks a lot in advance.
>> 
>> Best wishes,
>> 
>> Marc
>> 
>> _______________________________________________
>> 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