<div dir="ltr">Hey Luke,<div><br></div><div>What do the raw density values in your data look like?</div><div><br></div><div>dens = ds.all_data()['density']</div><div>print dens.max()</div><div>print dens.min()</div>
<div><br></div><div>-Nathan</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Jun 23, 2014 at 1:37 PM, Luke Zoltan Kelley <span dir="ltr"><<a href="mailto:lkelley@cfa.harvard.edu" target="_blank">lkelley@cfa.harvard.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello again yt-users,<br>
<br>
I'm trying to plot density from a FLASH simulation in 2D spherical. I assumed that a 'SlicePlot' would be the natural choice, slicing along axis '2'/'z'/'phi'.<br>
<br>
pf = load('starwind_hdf5_plt_cnt_0000')<br>
slc = SlicePlot(pf, 2, "density")<br>
<br>
However, I get the error:<br>
<br>
yt : [INFO ] 2014-06-23 16:31:42,631 xlim = -400000000000.000000 400000000000.000000<br>
yt : [INFO ] 2014-06-23 16:31:42,632 ylim = -400000000000.000000 400000000000.000000<br>
yt : [INFO ] 2014-06-23 16:31:42,632 Making a fixed resolution buffer of (('gas', 'density')) 800 by 800<br>
yt : [INFO ] 2014-06-23 16:31:42,698 xlim = -400000000000.000000 400000000000.000000<br>
yt : [INFO ] 2014-06-23 16:31:42,698 ylim = -400000000000.000000 400000000000.000000<br>
yt : [INFO ] 2014-06-23 16:31:42,699 Making a fixed resolution buffer of (('gas', 'density')) 800 by 800<br>
yt : [INFO ] 2014-06-23 16:31:42,703 Making a fixed resolution buffer of (('gas', 'density')) 800 by 800<br>
ERROR: ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all() [numpy.ma.core]<br>
astropy: [ERROR ] 2014-06-23 16:31:42,864 ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()<br>
---------------------------------------------------------------------------<br>
ValueError Traceback (most recent call last)<br>
<ipython-input-26-62c5de6a0872> in <module>()<br>
----> 1 slc = SlicePlot(pf, 2, "density")<br>
<br>
/Users/lzkelley/Applications/yt/yt-x86_64/src/yt-hg/yt/visualization/plot_window.pyc in SlicePlot(pf, normal, fields, axis, *args, **kwargs)<br>
1872 del kwargs['north_vector']<br>
1873<br>
-> 1874 return AxisAlignedSlicePlot(pf, normal, fields, *args, **kwargs)<br>
<br>
/Users/lzkelley/Applications/yt/yt-x86_64/src/yt-hg/yt/visualization/plot_window.pyc in __init__(self, pf, axis, fields, center, width, axes_unit, origin, fontsize, field_parameters, window_size, aspect)<br>
1093 if axes_unit is None:<br>
1094 axes_unit = get_axes_unit(width, pf)<br>
-> 1095 self.set_axes_unit(axes_unit)<br>
1096<br>
1097 class ProjectionPlot(PWViewerMPL):<br>
<br>
/Users/lzkelley/Applications/yt/yt-x86_64/src/yt-hg/yt/visualization/plot_container.pyc in newfunc(*args, **kwargs)<br>
67 rv = f(*args, **kwargs)<br>
68 args[0]._plot_valid = False<br>
---> 69 args[0]._setup_plots()<br>
70 return rv<br>
71 return newfunc<br>
<br>
/Users/lzkelley/Applications/yt/yt-x86_64/src/yt-hg/yt/visualization/plot_window.pyc in _setup_plots(self)<br>
836 self._colormaps[f], extent, zlim,<br>
837 self.figure_size, fp.get_size(),<br>
--> 838 self.aspect, fig, axes, cax)<br>
839<br>
840 axes_unit_labels = ['', '']<br>
<br>
/Users/lzkelley/Applications/yt/yt-x86_64/src/yt-hg/yt/visualization/plot_window.pyc in __init__(self, data, cbname, cmap, extent, zlim, figure_size, fontsize, unit_aspect, figure, axes, cax)<br>
1703 size, axrect, caxrect, zlim, figure, axes, cax)<br>
1704<br>
-> 1705 self._init_image(data, cbname, cmap, extent, unit_aspect)<br>
1706<br>
1707 self.image.axes.ticklabel_format(scilimits=(-2, 3))<br>
<br>
/Users/lzkelley/Applications/yt/yt-x86_64/src/yt-hg/yt/visualization/base_plot_types.pyc in _init_image(self, data, cbnorm, cmap, extent, aspect)<br>
114 extent=extent, norm=norm, vmin=self.zmin,<br>
115 aspect=aspect, vmax=self.zmax, cmap=cmap)<br>
--> 116 self.cb = self.figure.colorbar(self.image, self.cax)<br>
117<br>
118 def _repr_png_(self):<br>
<br>
/Users/lzkelley/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/matplotlib/figure.pyc in colorbar(self, mappable, cax, ax, use_gridspec, **kw)<br>
1449 cax, kw = cbar.make_axes(ax, **kw)<br>
1450 cax.hold(True)<br>
-> 1451 cb = cbar.colorbar_factory(cax, mappable, **kw)<br>
1452<br>
1453 self.sca(current_ax)<br>
<br>
/Users/lzkelley/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/matplotlib/colorbar.pyc in colorbar_factory(cax, mappable, **kwargs)<br>
1272 cb = ColorbarPatch(cax, mappable, **kwargs)<br>
1273 else:<br>
-> 1274 cb = Colorbar(cax, mappable, **kwargs)<br>
1275<br>
1276 mappable.callbacksSM.connect('changed', cb.on_mappable_changed)<br>
<br>
/Users/lzkelley/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/matplotlib/colorbar.pyc in __init__(self, ax, mappable, **kw)<br>
875 kw['alpha'] = mappable.get_alpha()<br>
876<br>
--> 877 ColorbarBase.__init__(self, ax, **kw)<br>
878<br>
879 def on_mappable_changed(self, mappable):<br>
<br>
/Users/lzkelley/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/matplotlib/colorbar.pyc in __init__(self, ax, cmap, norm, alpha, values, boundaries, orientation, ticklocation, extend, spacing, ticks, format, drawedges, filled, extendfrac, extendrect, label)<br>
315 # The rest is in a method so we can recalculate when clim changes.<br>
316 self.config_axis()<br>
--> 317 self.draw_all()<br>
318<br>
319 def _extend_lower(self):<br>
<br>
/Users/lzkelley/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/matplotlib/colorbar.pyc in draw_all(self)<br>
336 and do all the drawing.<br>
337 '''<br>
--> 338 self._process_values()<br>
339 self._find_range()<br>
340 X, Y = self._mesh()<br>
<br>
/Users/lzkelley/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/matplotlib/colorbar.pyc in _process_values(self, b)<br>
650 self.norm.vmin = 0<br>
651 self.norm.vmax = 1<br>
--> 652 b = self.norm.inverse(self._uniform_y(self.cmap.N + 1))<br>
653 if self._extend_lower():<br>
654 b[0] = b[0] - 1<br>
<br>
/Users/lzkelley/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/matplotlib/colors.pyc in inverse(self, value)<br>
1001 if cbook.iterable(value):<br>
1002 val = ma.asarray(value)<br>
-> 1003 return vmin * ma.power((vmax / vmin), val)<br>
1004 else:<br>
1005 return vmin * pow((vmax / vmin), value)<br>
<br>
/Users/lzkelley/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/numpy/ma/core.pyc in __mul__(self, other)<br>
3705 def __mul__(self, other):<br>
3706 "Multiply other by self, and return a new masked array."<br>
-> 3707 return multiply(self, other)<br>
3708 #<br>
3709 def __rmul__(self, other):<br>
<br>
/Users/lzkelley/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/numpy/ma/core.pyc in __call__(self, a, b, *args, **kwargs)<br>
936 # Case 1. : scalar<br>
937 if not result.ndim:<br>
--> 938 if m:<br>
939 return masked<br>
940 return result<br>
<br>
ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()<br>
<br>
<br>
yt instinfo<br>
Version = 3.0-dev<br>
Changeset = 90a724768665<br>
<br>
<br>
Any help would be greatly appreciated,<br>
Thanks so much!<br>
Luke<br>
<br>
<br>
<br>
<br>
_______________________________________________<br>
yt-users mailing list<br>
<a href="mailto:yt-users@lists.spacepope.org">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/listinfo.cgi/yt-users-spacepope.org</a><br>
</blockquote></div><br></div>