<div dir="ltr">Hi Rasmi,<div><br></div><div>Is there any chance you can make a small test script that triggers the error you're seeing, using one of the public test datasets on <a href="http://yt-project.org/data">yt-project.org/data</a>? There are several Enzo datasets there that should be usable.</div><div><br></div><div>That will make it much easier for one of us to reproduce the error you're seeing.</div><div><br></div><div>-Nathan</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, May 23, 2016 at 1:36 PM, Rasmi Elasmar <span dir="ltr"><<a href="mailto:re2300@columbia.edu" target="_blank">re2300@columbia.edu</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">Hi all,<div><br></div><div>I'm using yt 3.2.3. I've created some derived fields (specifically 'dark_matter' and 'stars'), and I'm trying to plot radial profiles of ('gas', 'density'), ('deposit', 'dark_matter_density'), and ('deposit', 'stars_density'). I'm using yt.create_profile(sphere, 'radius', field) (where field is one of the above) and appending each of those profiles to a list called profiles. Those are created fine, and accessing profile[1].field_units (for example) gives '{('deposit', 'stars_density'): g/cm**3}', which is what I expect. </div><div><br></div><div>The issue occurs when I call yt.ProfilePlot.from_profiles(profiles, labels=labels) -- I get an error in profile_plotter.py when accessing profile.field_units on a profile:</div><div>







<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><font face="monospace, monospace"><span>Traceback (most recent call last):<br></span><span>  File "/work/03330/tg826294/applications/scripts/halo_profiles.py", line 50, in <module><br></span><span>    plot = yt.ProfilePlot.from_profiles(profiles, labels=labels)<br></span><span>  File "/work/03330/tg826294/applications/pythonenv/lib/python2.7/site-packages/yt/visualization/profile_plotter.py", line 415, in from_profiles<br></span><span>    return cls._initialize_instance(obj, profiles, labels, plot_specs, y_log)<br></span><span>  File "/work/03330/tg826294/applications/pythonenv/lib/python2.7/site-packages/yt/visualization/profile_plotter.py", line 365, in _initialize_instance<br></span><span>    obj._setup_plots()<br></span><span>  File "/work/03330/tg826294/applications/pythonenv/lib/python2.7/site-packages/yt/visualization/profile_plotter.py", line 339, in _setup_plots<br></span><span>    xtitle, ytitle = self._get_field_title(fname, profile)<br></span><span>  File "/work/03330/tg826294/applications/pythonenv/lib/python2.7/site-packages/yt/visualization/profile_plotter.py", line 633, in _get_field_title<br></span><span>    y_unit = profile.field_units[field_y]<br></span><span>KeyError: ('gas', 'density')</span></font></blockquote><div><br></div><div>I tried explicitly passing the units in yt.create_profile(sphere, 'radius', field, units={field: units[field]}) (where units is a dictionary and units[field] gives 'g/cm**3'), but I still get the error. I also tried adding the units to ds.field_units, and that didn't help either.<br><br></div><div>You can see my code <a href="https://gist.github.com/rasmi/6d936b077527e245025b73059e59b9c0" target="_blank">here</a>.</div><div><br></div><div>I also tried creating all the profiles at once with:</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><font face="monospace, monospace">profile = yt.Profile1D(sp, 'radius', 32, minimum, maximum, True, weight_field=None)<br>profile.add_values(fields.values())</font></blockquote><div><br></div><div>But everything was 0, and I got errors with other approaches (I can detail them if you're curious, but I think the yt.ProfilePlot.from_profiles() is probably the best approach, right?).</div><div><br></div><div>Any ideas? Thanks for your help!</div><span class="HOEnZb"><font color="#888888"><div><br></div><div>Rasmi</div>


























</font></span></div>















</div>
<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" rel="noreferrer" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org</a><br>
<br></blockquote></div><br></div>