<meta http-equiv="Content-Type" content="text/html; charset=utf-8">Is this a derived field or a field that lives on disk in your data files?<br><br>If it's the former, you can supply units using the "units" keyword argument of the add_field function.<br><br>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.<br><div class="gmail_quote">On Sun, Dec 28, 2014 at 7:25 AM Desika Narayanan <<a href="mailto:dnarayan@haverford.edu" target="_blank">dnarayan@haverford.edu</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi All,<div><br></div><div>When I access some derived fields (like StarFormationRate) in a galaxy simulation, the units are dimensionless:</div><div><br></div><div>







<p><span>In [<b>4</b>]: </span>ad = ds.all_data()</p>
<p><span>In [<b>5</b>]: </span>ad[("PartType0","<u></u>StarFormationRate")]<br></p>
<p>Out[<b>5</b>]: </p>
<p>YTArray([  0.00000000e+00,   0.00000000e+00,   8.29740111e-06, ...,</p>
<p>         0.00000000e+00,   0.00000000e+00,   0.00000000e+00]) (dimensionless)</p><p><br></p><p>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?</p><p>thanks,<br>desika</p></div></div>
______________________________<u></u><u></u>_________________<br>
yt-users mailing list<br>
<a href="mailto:yt-users@lists.spacepope.org" target="_blank">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/<u></u>lis<u></u>tinfo.cgi/yt-users-<u></u>spacepope.<u></u>org</a><br>
</blockquote></div>