[yt-users] units in derived field

Nathan Goldbaum nathan12343 at gmail.com
Sun Dec 28 08:26:21 PST 2014


Is this a derived field or a field that lives on disk in your data files?

If it's the former, you can supply units using the "units" keyword argument
of the add_field function.

If it's the latter, I think you will need to make a small modification to
the Gadget frontend to include StarFormationRate in the known_fields list.
See "yt/frontends/gadget/fields.py" in the yt mercurial repository.
On Sun, Dec 28, 2014 at 7:25 AM Desika Narayanan <dnarayan at haverford.edu>
wrote:

> Hi All,
>
> When I access some derived fields (like StarFormationRate) in a galaxy
> simulation, the units are dimensionless:
>
> In [*4*]: ad = ds.all_data()
>
> In [*5*]: ad[("PartType0","StarFormationRate")]
>
> Out[*5*]:
>
> YTArray([  0.00000000e+00,   0.00000000e+00,   8.29740111e-06, ...,
>
>          0.00000000e+00,   0.00000000e+00,   0.00000000e+00])
> (dimensionless)
>
>
> I'd like to assign the units to this field.  I figure I could define a
> field with the right units, but it seems like it might be possible to just
> assign units to the ds StarFormationRate field as is.  Is this possible, or
> should I just define a new field?
>
> thanks,
> desika
> _______________________________________________
> 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/20141228/8997d13a/attachment.html>
-------------- next part --------------
_______________________________________________
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