<div dir="ltr"><div class="gmail_extra">Hi Rasmi,</div><div class="gmail_extra"><br></div><div class="gmail_extra">Once I adjust the size of the sphere object you're using to be a bit large (in my case I made it 10 Mpc instead of 30 kpc), I'm able to run your script without errors. If I use 30 kpc, the script errors out since the sphere isn't big enough to accumulate values from more than a single cell in your simulation.</div><div class="gmail_extra"><br></div><div class="gmail_extra">I'm running the latest development version of yt - there were some issues related to profiles that were fixed relative to yt 3.2.3 in the development version - so I'd suggest switching to the development branch until yt 3.3 is released.</div><div class="gmail_extra"><br></div><div class="gmail_extra">There is documentation on how to switch to the development version of yt here:</div><div class="gmail_extra"><br></div><div class="gmail_extra"><a href="http://yt-project.org/docs/dev/installing.html#installing-yt-using-pip-or-from-source">http://yt-project.org/docs/dev/installing.html#installing-yt-using-pip-or-from-source</a><br></div><div class="gmail_extra"><br></div><div class="gmail_extra">If you're using anaconda, you may find using the conda nightly builds to be easier:</div><div class="gmail_extra"><br></div><div class="gmail_extra"><a href="http://yt-project.org/docs/dev/installing.html#nightly-conda-builds">http://yt-project.org/docs/dev/installing.html#nightly-conda-builds</a><br></div><div class="gmail_extra"><br></div><div class="gmail_extra">Hope that's helpful,</div><div class="gmail_extra"><br></div><div class="gmail_extra">Nathan</div><div class="gmail_extra"><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, May 23, 2016 at 3:50 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:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr">I tried fooling around with the test data (the Enzo cosmology datasets in particular) and couldn't find one that gave me a reasonable number of halos. This is obnoxious, but <a href="https://drive.google.com/open?id=0BwK-7Z3S5X_yMDNyZ1RTcG56SFU" target="_blank">here</a>'s a ~3.5gb archive of the data I've been using (with halo catalog and test script). If that's not useful, let me know!<span><font color="#888888"><div><br></div><div><br>Rasmi</div></font></span></div><div><div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, May 23, 2016 at 2:41 PM, Nathan Goldbaum <span dir="ltr"><<a href="mailto:nathan12343@gmail.com" target="_blank">nathan12343@gmail.com</a>></span> wrote:<br><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"><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" target="_blank">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"><div><div>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></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"><div><div><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><font color="#888888"><div><br></div><div>Rasmi</div>


























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















</div>
<br></div></div>_______________________________________________<br>
yt-dev mailing list<br>
<a href="mailto:yt-dev@lists.spacepope.org" target="_blank">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>
<br>_______________________________________________<br>
yt-dev mailing list<br>
<a href="mailto:yt-dev@lists.spacepope.org" target="_blank">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>
</div></div><br>_______________________________________________<br>
yt-dev mailing list<br>
<a href="mailto:yt-dev@lists.spacepope.org" target="_blank">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></div>