[yt-users] strange particle field behavior

Britton Smith brittonsmith at gmail.com
Fri May 10 14:13:07 PDT 2013


Ok, so we should probably remove that field from the code base since it is
not really doing the right thing.  It doesn't seem to be in use anywhere.
Does anyone have any thoughts on removing this? +-1?


On Fri, May 10, 2013 at 4:49 PM, Matthew Turk <matthewturk at gmail.com> wrote:

> On Fri, May 10, 2013 at 4:44 PM, Britton Smith <brittonsmith at gmail.com>
> wrote:
> > Hi all,
> >
> > I am seeing something odd with a field called "IsStarParticle".  This is
> an
> > Enzo field defined in the following way:
> >
> > def _IsStarParticle(field, data):
> >     is_star = (data['creation_time'] > 0).astype('float64')
> >     return is_star
> >
> > When I do the following:
> > print pf.h.grids[0]['IsStarParticle']
> >
> > I get the expected field of 1s and 0s.
> >
> > When I do this:
> > all_data = pf.h.all_data()
> > print all_data['IsStarParticle']
> >
> > 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.
> >
> > Does anyone know what's going on here?
>
> No, not really.  But there is one thing that I should note, which is
> that it may be getting caused by using "IsStarParticle" as a boolean
> index.  Which would not work correctly, and would just return the 0th
> and 1st values of whatever array it's being used as an index into.  I
> think.
>
> -Matt
>
> >
> > Britton
> >
> > _______________________________________________
> > 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.spacepope.org/pipermail/yt-users-spacepope.org/attachments/20130510/16e2c9b9/attachment.html>


More information about the yt-users mailing list