<div dir="ltr"><div><div>Thank you for the help! I seem to be getting the information I was wanting out of my simulations now.<br><br></div>Best regards,<br></div>Carla Bernhardt<br></div><div class="gmail_extra"><br><div class="gmail_quote">2017-03-14 18:20 GMT+01:00 Ari Maller <span dir="ltr"><<a href="mailto:AMaller@citytech.cuny.edu" target="_blank">AMaller@citytech.cuny.edu</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Carla,<br>
<br>
You want to do something like the following<br>
<br>
import yt.mods as ytm<br>
from yt.data_objects.particle_<wbr>filters import add_particle_filter<br>
<br>
def enzo_stars(pfilter,data):<br>
    filter = data[('io', 'particle_type')] == 2 # DM = 1, Stars = 2<br>
    return filter<br>
<br>
ds=ytm.load(my_snapshot_name))<br>
add_particle_filter("stars",<wbr>function=enzo_stars,filtered_<wbr>type='io',requires=["particle_<wbr>type"])<br>
ds.add_particle_filter("stars”<wbr>)<br>
ad = ds.all_data()<br>
x=ad[(‘stars’,’particle_<wbr>position_x’)]<br>
etc…<br>
<br>
using stars will now just return star particles. The fields will have to be fields in your file which you can check with ds.field_list.<br>
<br>
Ari<br>
<br>
<br>
<br>
> On Mar 14, 2017, at 11:32 AM, <a href="mailto:yt-users-request@lists.spacepope.org">yt-users-request@lists.<wbr>spacepope.org</a> wrote:<br>
><br>
> Send yt-users mailing list submissions to<br>
>       <a href="mailto:yt-users@lists.spacepope.org">yt-users@lists.spacepope.org</a><br>
><br>
> To subscribe or unsubscribe via the World Wide Web, visit<br>
>       <a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" rel="noreferrer" target="_blank">http://lists.spacepope.org/<wbr>listinfo.cgi/yt-users-<wbr>spacepope.org</a><br>
> or, via email, send a message with subject or body 'help' to<br>
>       <a href="mailto:yt-users-request@lists.spacepope.org">yt-users-request@lists.<wbr>spacepope.org</a><br>
><br>
> You can reach the person managing the list at<br>
>       <a href="mailto:yt-users-owner@lists.spacepope.org">yt-users-owner@lists.<wbr>spacepope.org</a><br>
><br>
> When replying, please edit your Subject line so it is more specific<br>
> than "Re: Contents of yt-users digest..."<br>
><br>
><br>
> Today's Topics:<br>
><br>
>   1. Re: yt-users Digest, Vol 109, Issue 27 (Slavin, Jonathan)<br>
>   2. Re: Extracting a list of star particles, their positions and<br>
>      masses from enzo (Carla Bernhardt)<br>
>   3. Re: Extracting a list of star particles, their positions and<br>
>      masses from enzo (Nathan Goldbaum)<br>
><br>
><br>
> ------------------------------<wbr>------------------------------<wbr>----------<br>
><br>
> Message: 1<br>
> Date: Tue, 14 Mar 2017 11:27:18 -0400<br>
> From: "Slavin, Jonathan" <<a href="mailto:jslavin@cfa.harvard.edu">jslavin@cfa.harvard.edu</a>><br>
> To: <a href="mailto:yt-users@lists.spacepope.org">yt-users@lists.spacepope.org</a><br>
> Subject: Re: [yt-users] yt-users Digest, Vol 109, Issue 27<br>
> Message-ID:<br>
>       <CACcRS=fSRQ=<wbr>4THnqMR3jCDiup1rRcvfAEFPYaATup<wbr>_92Df=<a href="mailto:DCQ@mail.gmail.com">DCQ@mail.gmail.com</a>><br>
> Content-Type: text/plain; charset="utf-8"<br>
><br>
> ?Hi Nathan,<br>
><br>
> I finally uploaded the data file to the curldrop site:<br>
> ?> curl -T<br>
> /data/plato/mmsnr/flash_data/<wbr>run-3f818dc2/sedov_hdf5_plt_<wbr>cnt_0200<br>
> <a href="http://use.yt/upload/" rel="noreferrer" target="_blank">http://use.yt/upload/</a><br>
> Stream body handler: received 467741048 bytes<br>
> <a href="http://use.yt/upload/147aa558" rel="noreferrer" target="_blank">http://use.yt/upload/147aa558</a><br>
><br>
> Tell me if you need more information about reproducing my issue.<br>
><br>
> Thanks a lot,<br>
> Jon<br>
><br>
> On Fri, Mar 10, 2017 at 4:05 PM, <<a href="mailto:yt-users-request@lists.spacepope.org">yt-users-request@lists.<wbr>spacepope.org</a>><br>
> wrote:<br>
><br>
>> Date: Fri, 10 Mar 2017 12:14:55 -0800<br>
>> From: Nathan Goldbaum <<a href="mailto:nathan12343@gmail.com">nathan12343@gmail.com</a>><br>
>> To: Discussion of the yt analysis package<br>
>>        <<a href="mailto:yt-users@lists.spacepope.org">yt-users@lists.spacepope.org</a>><br>
>> Subject: Re: [yt-users] cutting plane not working or changed behavior<br>
>> Message-ID:<br>
>>        <CAJXewOmWwY1CU4nrafG5_=<wbr>GrAScGBnq=VMNxxh3s0OUzDzaGVw@<br>
>> <a href="http://mail.gmail.com" rel="noreferrer" target="_blank">mail.gmail.com</a>><br>
>> Content-Type: text/plain; charset="utf-8"<br>
>><br>
>> Hi Jonathan,<br>
>><br>
>> I'm not able to reproduce the behavior you're seeing with a test dataset<br>
>> (e.g. see <a href="http://paste.yt-project.org/show/7080/" rel="noreferrer" target="_blank">http://paste.yt-project.org/<wbr>show/7080/</a>, this uses a dataset from<br>
>> <a href="http://yt-project.org/data" rel="noreferrer" target="_blank">yt-project.org/data</a>).<br>
>><br>
>> Is there any chance you can share a dataset that triggers this?<br>
>> Alternatively, can you reproduce this using one of the test datasets on<br>
>> <a href="http://yt-project.org/data" rel="noreferrer" target="_blank">yt-project.org/data</a>?<br>
>><br>
>> The yt curldrop might be useful to share a dataset that triggers the issue<br>
>> you're seeing, see <a href="http://docs.hub.yt" rel="noreferrer" target="_blank">docs.hub.yt</a>. If you're not comfortable sharing the<br>
>> dataset publicly, feel free to share it with me off-list.<br>
>><br>
>> -Nathan<br>
>><br>
><br>
><br>
><br>
><br>
> --<br>
> ______________________________<wbr>__________________________<br>
> Jonathan D. Slavin                 Harvard-Smithsonian CfA<br>
> <a href="mailto:jslavin@cfa.harvard.edu">jslavin@cfa.harvard.edu</a>       60 Garden Street, MS 83<br>
> phone: <a href="tel:%28617%29%20496-7981" value="+16174967981">(617) 496-7981</a>       Cambridge, MA 02138-1516<br>
> cell: <a href="tel:%28781%29%20363-0035" value="+17813630035">(781) 363-0035</a>             USA<br>
> ______________________________<wbr>__________________________<br>
> -------------- next part --------------<br>
> An HTML attachment was scrubbed...<br>
> URL: <<a href="http://lists.spacepope.org/pipermail/yt-users-spacepope.org/attachments/20170314/8866e7a4/attachment-0001.htm" rel="noreferrer" target="_blank">http://lists.spacepope.org/<wbr>pipermail/yt-users-spacepope.<wbr>org/attachments/20170314/<wbr>8866e7a4/attachment-0001.htm</a>><br>
><br>
> ------------------------------<br>
><br>
> Message: 2<br>
> Date: Tue, 14 Mar 2017 16:28:17 +0100<br>
> From: Carla Bernhardt <<a href="mailto:carla.j.bernhardt@gmail.com">carla.j.bernhardt@gmail.com</a>><br>
> To: Discussion of the yt analysis package<br>
>       <<a href="mailto:yt-users@lists.spacepope.org">yt-users@lists.spacepope.org</a>><br>
> Subject: Re: [yt-users] Extracting a list of star particles, their<br>
<span class="">>       positions and masses from enzo<br>
</span>> Message-ID:<br>
>       <CAKQMXAVTzJ9Y2D7xXWHHg+<wbr>2HXpWY4=<a href="mailto:7RzSfHoJPwosYGSMsx-g@mail.gmail.com">7RzSfHoJPwosYGSMsx-g@<wbr>mail.gmail.com</a>><br>
> Content-Type: text/plain; charset="utf-8"<br>
<span class="">><br>
> Nathan,<br>
><br>
> Yes, of course. Here is what I tried<br>
</span>> <<a href="http://paste.yt-project.org/show/7082/" rel="noreferrer" target="_blank">http://paste.yt-project.org/<wbr>show/7082/</a>> and here is the error message<br>
> <<a href="http://paste.yt-project.org/show/7084/" rel="noreferrer" target="_blank">http://paste.yt-project.org/<wbr>show/7084/</a>> I get. What I tried might not be<br>
<span class="">> the right way to get this list, but I was hoping someone else has done this<br>
> before and has some insight.<br>
><br>
> Best,<br>
> Carla<br>
><br>
> 2017-03-14 16:00 GMT+01:00 Nathan Goldbaum <<a href="mailto:nathan12343@gmail.com">nathan12343@gmail.com</a>>:<br>
><br>
>> Hi Carla,<br>
>><br>
>> Can you share the script you're running and the full error message and<br>
>> traceback you're seeing? If you can, it helps if you can make your script<br>
>> that triggers your issue as minimal as possible.<br>
>><br>
>> We have the yt pastebin set up for sharing snippets of code and text:<br>
>> <a href="http://paste.yt-project.org" rel="noreferrer" target="_blank">paste.yt-project.org</a>.<br>
>><br>
>> -Nathan<br>
>><br>
>> On Tue, Mar 14, 2017 at 2:30 AM, Carla Bernhardt <<br>
>> <a href="mailto:carla.j.bernhardt@gmail.com">carla.j.bernhardt@gmail.com</a>> wrote:<br>
>><br>
>>> Dear yt users,<br>
>>><br>
>>> I am trying to extract a list of star particles and their positions and<br>
>>> masses from enzo. This seems to be right along the lines of this tutorial<br>
</span>>>> <<a href="http://yt-project.org/doc/analyzing/fields.html" rel="noreferrer" target="_blank">http://yt-project.org/doc/<wbr>analyzing/fields.html</a>>, but I am still stuck.<br>
<span class="">>>> If I try<br>
>>><br>
>>> print(ad["dark_matter", "particle_position"])<br>
>>> print(ad["stars", "particle_position"])<br>
>>> print(ad["black_holes", "particle_position"])<br>
>>><br>
>>> I get that none of these fields are available in my provided data. I am<br>
>>> using Stochastic Star Formation with a MBH inserted  (i.e.<br>
>>> StarParticleCreation=514).<br>
>>><br>
>>> Thanks in advance,<br>
>>> Carla Bernhardt<br>
>>> PhD Student<br>
</span>>>> Universit?t Heidelberg<br>
>>> ZAH Institut f?r Theoretische Astrophysik<br>
<span class="">>>><br>
>>><br>
>>> ______________________________<wbr>_________________<br>
>>> yt-users mailing list<br>
>>> <a href="mailto:yt-users@lists.spacepope.org">yt-users@lists.spacepope.org</a><br>
>>> <a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" rel="noreferrer" target="_blank">http://lists.spacepope.org/<wbr>listinfo.cgi/yt-users-<wbr>spacepope.org</a><br>
>>><br>
>>><br>
>><br>
>> ______________________________<wbr>_________________<br>
>> yt-users mailing list<br>
>> <a href="mailto:yt-users@lists.spacepope.org">yt-users@lists.spacepope.org</a><br>
>> <a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" rel="noreferrer" target="_blank">http://lists.spacepope.org/<wbr>listinfo.cgi/yt-users-<wbr>spacepope.org</a><br>
>><br>
>><br>
</span>> -------------- next part --------------<br>
> An HTML attachment was scrubbed...<br>
> URL: <<a href="http://lists.spacepope.org/pipermail/yt-users-spacepope.org/attachments/20170314/55c36072/attachment-0001.htm" rel="noreferrer" target="_blank">http://lists.spacepope.org/<wbr>pipermail/yt-users-spacepope.<wbr>org/attachments/20170314/<wbr>55c36072/attachment-0001.htm</a>><br>
><br>
> ------------------------------<br>
><br>
> Message: 3<br>
> Date: Tue, 14 Mar 2017 10:32:00 -0500<br>
> From: Nathan Goldbaum <<a href="mailto:nathan12343@gmail.com">nathan12343@gmail.com</a>><br>
> To: Discussion of the yt analysis package<br>
>       <<a href="mailto:yt-users@lists.spacepope.org">yt-users@lists.spacepope.org</a>><br>
> Subject: Re: [yt-users] Extracting a list of star particles, their<br>
<span class="">>       positions and masses from enzo<br>
</span>> Message-ID:<br>
>       <CAJXewO=<a href="mailto:sCXCpFn1bpsSL3vK9AjiA7OMwPy5SRAmb8Lp09XDhzQ@mail.gmail.com">sCXCpFn1bpsSL3vK9AjiA<wbr>7OMwPy5SRAmb8Lp09XDhzQ@mail.<wbr>gmail.com</a>><br>
> Content-Type: text/plain; charset="utf-8"<br>
<span class="">><br>
> You need to define some particle filters. Enzo only has one on-disk<br>
> particle type. Particle filters let you define new particle types based on<br>
> some filtering criterion. For Enzo it's usually sufficient to filter on the<br>
> ('io', 'particle_type') field.<br>
><br>
> There is an example of adding a particle filter with enzo data in the docs<br>
> here:<br>
><br>
> <a href="http://yt-project.org/docs/dev/cookbook/calculating_information.html#using-particle-filters-to-calculate-star-formation-rates" rel="noreferrer" target="_blank">http://yt-project.org/docs/<wbr>dev/cookbook/calculating_<wbr>information.html#using-<wbr>particle-filters-to-calculate-<wbr>star-formation-rates</a><br>
><br>
> And more information on particle filters here:<br>
><br>
> <a href="http://yt-project.org/docs/dev/analyzing/filtering.html?highlight=filter#filtering-particle-fields" rel="noreferrer" target="_blank">http://yt-project.org/docs/<wbr>dev/analyzing/filtering.html?<wbr>highlight=filter#filtering-<wbr>particle-fields</a><br>
><br>
> The Enzo frontend does not predefine any particle fields since we don't<br>
> want to accidentally cause users to generate anaylsis or visualization<br>
> results based on a particle filter definition that does not apply to all<br>
> data types.<br>
><br>
> -Nathan<br>
><br>
> On Tue, Mar 14, 2017 at 10:28 AM, Carla Bernhardt <<br>
> <a href="mailto:carla.j.bernhardt@gmail.com">carla.j.bernhardt@gmail.com</a>> wrote:<br>
><br>
>> Nathan,<br>
>><br>
>> Yes, of course. Here is what I tried<br>
</span>>> <<a href="http://paste.yt-project.org/show/7082/" rel="noreferrer" target="_blank">http://paste.yt-project.org/<wbr>show/7082/</a>> and here is the error message<br>
>> <<a href="http://paste.yt-project.org/show/7084/" rel="noreferrer" target="_blank">http://paste.yt-project.org/<wbr>show/7084/</a>> I get. What I tried might not be<br>
<span class="">>> the right way to get this list, but I was hoping someone else has done this<br>
>> before and has some insight.<br>
>><br>
>> Best,<br>
>> Carla<br>
>><br>
>> 2017-03-14 16:00 GMT+01:00 Nathan Goldbaum <<a href="mailto:nathan12343@gmail.com">nathan12343@gmail.com</a>>:<br>
>><br>
>>> Hi Carla,<br>
>>><br>
>>> Can you share the script you're running and the full error message and<br>
>>> traceback you're seeing? If you can, it helps if you can make your script<br>
>>> that triggers your issue as minimal as possible.<br>
>>><br>
>>> We have the yt pastebin set up for sharing snippets of code and text:<br>
>>> <a href="http://paste.yt-project.org" rel="noreferrer" target="_blank">paste.yt-project.org</a>.<br>
>>><br>
>>> -Nathan<br>
>>><br>
>>> On Tue, Mar 14, 2017 at 2:30 AM, Carla Bernhardt <<br>
>>> <a href="mailto:carla.j.bernhardt@gmail.com">carla.j.bernhardt@gmail.com</a>> wrote:<br>
>>><br>
>>>> Dear yt users,<br>
>>>><br>
>>>> I am trying to extract a list of star particles and their positions and<br>
>>>> masses from enzo. This seems to be right along the lines of this<br>
</span>>>>> tutorial <<a href="http://yt-project.org/doc/analyzing/fields.html" rel="noreferrer" target="_blank">http://yt-project.org/doc/<wbr>analyzing/fields.html</a>>, but I am<br>
<span class="">>>>> still stuck. If I try<br>
>>>><br>
>>>> print(ad["dark_matter", "particle_position"])<br>
>>>> print(ad["stars", "particle_position"])<br>
>>>> print(ad["black_holes", "particle_position"])<br>
>>>><br>
>>>> I get that none of these fields are available in my provided data. I am<br>
>>>> using Stochastic Star Formation with a MBH inserted  (i.e.<br>
>>>> StarParticleCreation=514).<br>
>>>><br>
>>>> Thanks in advance,<br>
>>>> Carla Bernhardt<br>
>>>> PhD Student<br>
</span>>>>> Universit?t Heidelberg<br>
>>>> ZAH Institut f?r Theoretische Astrophysik<br>
<span class="">>>>><br>
>>>><br>
>>>> ______________________________<wbr>_________________<br>
>>>> yt-users mailing list<br>
>>>> <a href="mailto:yt-users@lists.spacepope.org">yt-users@lists.spacepope.org</a><br>
>>>> <a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" rel="noreferrer" target="_blank">http://lists.spacepope.org/<wbr>listinfo.cgi/yt-users-<wbr>spacepope.org</a><br>
>>>><br>
>>>><br>
>>><br>
>>> ______________________________<wbr>_________________<br>
>>> yt-users mailing list<br>
>>> <a href="mailto:yt-users@lists.spacepope.org">yt-users@lists.spacepope.org</a><br>
>>> <a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" rel="noreferrer" target="_blank">http://lists.spacepope.org/<wbr>listinfo.cgi/yt-users-<wbr>spacepope.org</a><br>
>>><br>
>>><br>
>><br>
>> ______________________________<wbr>_________________<br>
>> yt-users mailing list<br>
>> <a href="mailto:yt-users@lists.spacepope.org">yt-users@lists.spacepope.org</a><br>
>> <a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" rel="noreferrer" target="_blank">http://lists.spacepope.org/<wbr>listinfo.cgi/yt-users-<wbr>spacepope.org</a><br>
>><br>
>><br>
</span>> -------------- next part --------------<br>
> An HTML attachment was scrubbed...<br>
> URL: <<a href="http://lists.spacepope.org/pipermail/yt-users-spacepope.org/attachments/20170314/aaf0d92e/attachment.htm" rel="noreferrer" target="_blank">http://lists.spacepope.org/<wbr>pipermail/yt-users-spacepope.<wbr>org/attachments/20170314/<wbr>aaf0d92e/attachment.htm</a>><br>
><br>
> ------------------------------<br>
><br>
> Subject: Digest Footer<br>
<span class="">><br>
> ______________________________<wbr>_________________<br>
> yt-users mailing list<br>
> <a href="mailto:yt-users@lists.spacepope.org">yt-users@lists.spacepope.org</a><br>
> <a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" rel="noreferrer" target="_blank">http://lists.spacepope.org/<wbr>listinfo.cgi/yt-users-<wbr>spacepope.org</a><br>
><br>
><br>
</span>> ------------------------------<br>
><br>
> End of yt-users Digest, Vol 109, Issue 33<br>
> ******************************<wbr>***********<br>
<div class="HOEnZb"><div class="h5"><br>
______________________________<wbr>_________________<br>
yt-users mailing list<br>
<a href="mailto:yt-users@lists.spacepope.org">yt-users@lists.spacepope.org</a><br>
<a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" rel="noreferrer" target="_blank">http://lists.spacepope.org/<wbr>listinfo.cgi/yt-users-<wbr>spacepope.org</a><br>
</div></div></blockquote></div><br></div>