<div dir="ltr">Hi Matt,<div><br></div><div>Thanks, that's very helpful.</div><div><br></div><div>I have an additional question.  When I do:</div><div>ad = pf.h.all_data()</div><div>ad['particle_mass'] or</div><div>
ad['all', 'particle_mass']</div><div><br></div><div>I get numbers that are ~1e44, which sounds about right if it's in grams.</div><div>However, when I do:</div><div>ad['DarkMatter', 'particle_mass']</div>
<div><br></div><div>I get numbers that are ~1e-5, which I am guessing is the unconverted particle_mass straight out of the file.  How can get the filtered particles in proper units as well?</div><div><br></div><div>Thanks again,</div>
<div>Britton</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Dec 2, 2013 at 3:21 PM, Matthew Turk <span dir="ltr"><<a href="mailto:matthewturk@gmail.com" target="_blank">matthewturk@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hey Britton,<br>
<div><div class="h5"><br>
On Mon, Dec 2, 2013 at 10:15 AM, Britton Smith <<a href="mailto:brittonsmith@gmail.com">brittonsmith@gmail.com</a>> wrote:<br>
> Hi all,<br>
><br>
> Can someone point me to an example (docs, notebooks, emails, whatever) of<br>
> defining a custom particle filter for yt-3.0?  I'm trying to do this and I<br>
> know I've seen discussion of this before, but I can't find where.<br>
><br>
<br>
</div></div>Yup.  Here's an example:<br>
<br>
<a href="http://nbviewer.ipython.org/url/hub.yt-project.org/notebooks/534fd19b933e4a3fa002db91f58fb817.ipynb" target="_blank">http://nbviewer.ipython.org/url/hub.yt-project.org/notebooks/534fd19b933e4a3fa002db91f58fb817.ipynb</a><br>

<br>
Looks like the nbviewer is down though.<br>
<br>
Sorry I haven't done much documenting of this.  Particle filters and<br>
particle unions are two really cool things that are currently only in<br>
example form.  Here's another example of how to define one:<br>
<br>
<a href="https://bitbucket.org/mornkr/agora-analysis-script/src/1200830cd1e8d7dc60f66c8f1dc7c09764ca3276/script-Flagship-DM.py?at=default#cl-33" target="_blank">https://bitbucket.org/mornkr/agora-analysis-script/src/1200830cd1e8d7dc60f66c8f1dc7c09764ca3276/script-Flagship-DM.py?at=default#cl-33</a><br>

<br>
and you have to add this by name to each pf you open up:<br>
<br>
<a href="https://bitbucket.org/mornkr/agora-analysis-script/src/1200830cd1e8d7dc60f66c8f1dc7c09764ca3276/script-Flagship-DM.py?at=default#cl-57" target="_blank">https://bitbucket.org/mornkr/agora-analysis-script/src/1200830cd1e8d7dc60f66c8f1dc7c09764ca3276/script-Flagship-DM.py?at=default#cl-57</a><br>

<br>
Note that you have to specify *all* the required filtering fields in<br>
the constructor for the function.<br>
<br>
-Matt<br>
<br>
> Thanks,<br>
> Britton<br>
><br>
> _______________________________________________<br>
> yt-dev mailing list<br>
> <a href="mailto:yt-dev@lists.spacepope.org">yt-dev@lists.spacepope.org</a><br>
> <a href="http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org</a><br>
><br>
_______________________________________________<br>
yt-dev mailing list<br>
<a href="mailto:yt-dev@lists.spacepope.org">yt-dev@lists.spacepope.org</a><br>
<a href="http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org</a><br>
</blockquote></div><br></div>