Hi Britton,<br><br>FWIW, I've done things like this before with Orion data and it seems to work:<br><br><div style="margin-left:40px">def _IsStar(field, data):<br>    is_star = (data['ParticleMassMsun'] > 0.05).astype('float64')<br>
    return is_star<br>add_field("IsStar", function=_IsStar, take_log=False, particle_type=True)<br><br></div>Then:<br><br><div style="margin-left:40px">all_data = pf.h.all_data()<br>print all_data['IsStar']<br>
yt : [INFO     ] 2013-05-10 14:35:27,252 Getting field ParticleMassMsun from 3611<br>[ 0.  0.  0.  0.  0.  1.  1.  0.  0.  0.  0.  1.  0.  0.  0.  0.  0.]<br><br></div>Maybe this is something specific to the Enzo frontend?<br>
<br>-Andrew<br><br><div class="gmail_quote">On Fri, May 10, 2013 at 1:44 PM, Britton Smith <span dir="ltr"><<a href="mailto:brittonsmith@gmail.com" target="_blank">brittonsmith@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr"><div><div><div><div><div><div><div><div><div><div>Hi all,<br><br></div>I am seeing something odd with a field called "IsStarParticle".  This is an Enzo field defined in the following way:<br><br>def _IsStarParticle(field, data):<br>

    is_star = (data['creation_time'] > 0).astype('float64')<br>    return is_star<br><br></div>When I do the following:<br></div>print pf.h.grids[0]['IsStarParticle']<br><br></div>I get the expected field of 1s and 0s.<br>

<br></div>When I do this:<br></div>all_data = pf.h.all_data()<br></div>print all_data['IsStarParticle']<br><br></div>I get the values that correspond to the creation_time field.  It does not matter in what order I do this.  Whenever I try to access the field from a geometric object, I get the actual creation time and not the field I expect.  Whenever I access it from a grid object, I get the right thing.<br>

<br></div>Does anyone know what's going on here?<span class="HOEnZb"><font color="#888888"><br><br></font></span></div><span class="HOEnZb"><font color="#888888">Britton<br></font></span></div>
<br>_______________________________________________<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" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br>
<br></blockquote></div><br>