[yt-users] Slice plot error

Ji Suoqing jisuoqing at gmail.com
Sun Sep 16 14:23:32 PDT 2012


Hi all,

Yesterday I've updated YT (af06f14fcd9e), but after that I found I got some error in slice plot for 2d FLASH data, in both cartesian and cylindrical cases. In cartesian, the error is:

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

yt : [WARNING  ] 2012-09-17 01:19:45,023 integer runtime parameter checkpointfilenumber overwrites a simulation scalar of the same name
yt : [WARNING  ] 2012-09-17 01:19:45,023 integer runtime parameter plotfilenumber overwrites a simulation scalar of the same name
yt : [INFO     ] 2012-09-17 01:19:45,029 Parameters: current_time              = 1.01787779719e-09
yt : [INFO     ] 2012-09-17 01:19:45,029 Parameters: domain_dimensions         = [1280   64    1]
yt : [INFO     ] 2012-09-17 01:19:45,029 Parameters: domain_left_edge          = [ 0.  0.  0.]
yt : [INFO     ] 2012-09-17 01:19:45,030 Parameters: domain_right_edge         = [ 256.    12.8   12.8]
yt : [INFO     ] 2012-09-17 01:19:45,030 Parameters: cosmological_simulation   = 0.0
yt : [INFO     ] 2012-09-17 01:19:45,040 Adding unknown field enuc to list of fields
yt : [INFO     ] 2012-09-17 01:19:45,040 Adding unknown field ar36 to list of fields
yt : [INFO     ] 2012-09-17 01:19:45,040 Adding unknown field c12  to list of fields
yt : [INFO     ] 2012-09-17 01:19:45,040 Adding unknown field ca40 to list of fields
yt : [INFO     ] 2012-09-17 01:19:45,040 Adding unknown field cr48 to list of fields
yt : [INFO     ] 2012-09-17 01:19:45,040 Adding unknown field fe52 to list of fields
yt : [INFO     ] 2012-09-17 01:19:45,041 Adding unknown field he4  to list of fields
yt : [INFO     ] 2012-09-17 01:19:45,041 Adding unknown field mg24 to list of fields
yt : [INFO     ] 2012-09-17 01:19:45,041 Adding unknown field ne20 to list of fields
yt : [INFO     ] 2012-09-17 01:19:45,041 Adding unknown field ni56 to list of fields
yt : [INFO     ] 2012-09-17 01:19:45,041 Adding unknown field o16  to list of fields
yt : [INFO     ] 2012-09-17 01:19:45,041 Adding unknown field s32  to list of fields
yt : [INFO     ] 2012-09-17 01:19:45,041 Adding unknown field si28 to list of fields
yt : [INFO     ] 2012-09-17 01:19:45,041 Adding unknown field ti44 to list of fields
yt : [INFO     ] 2012-09-17 01:19:45,356 Max Value is 4.25001e+07 at 22.7500000000000000 0.8375000000000000 0.5000000000000000 in grid FLASHGrid_0001 ([64 64  1]) at level 0 (45, 33, 0)
yt : [INFO     ] 2012-09-17 01:19:45,401 Making a fixed resolution buffer of (dens) 800 by 800
Traceback (most recent call last):
  File "slice.py", line 14, in <module>
    p1 = SlicePlot(pf, "z", my_var, origin="left-domain")
  File "/aphelion/jisuoqing/yt-x86_64/src/yt-hg/yt/visualization/plot_window.py", line 949, in __init__
    PWViewerMPL.__init__(self, slc, bounds, origin=origin)
  File "/aphelion/jisuoqing/yt-x86_64/src/yt-hg/yt/visualization/plot_window.py", line 473, in __init__
    if setup: self._setup_plots()
  File "/aphelion/jisuoqing/yt-x86_64/src/yt-hg/yt/visualization/plot_window.py", line 725, in _setup_plots
    self.plots[f].image, cax = self.plots[f].cax)
  File "/aphelion/jisuoqing/yt-x86_64/lib/python2.7/site-packages/matplotlib/figure.py", line 1196, in colorbar
    cb = cbar.Colorbar(cax, mappable, **kw)
  File "/aphelion/jisuoqing/yt-x86_64/lib/python2.7/site-packages/matplotlib/colorbar.py", line 743, in __init__
    ColorbarBase.__init__(self, ax, **kw)
  File "/aphelion/jisuoqing/yt-x86_64/lib/python2.7/site-packages/matplotlib/colorbar.py", line 258, in __init__
    self.draw_all()
  File "/aphelion/jisuoqing/yt-x86_64/lib/python2.7/site-packages/matplotlib/colorbar.py", line 272, in draw_all
    self._process_values()
  File "/aphelion/jisuoqing/yt-x86_64/lib/python2.7/site-packages/matplotlib/colorbar.py", line 570, in _process_values
    b = self.norm.inverse(self._uniform_y(self.cmap.N+1))
  File "/aphelion/jisuoqing/yt-x86_64/lib/python2.7/site-packages/matplotlib/colors.py", line 948, in inverse
    return vmin * ma.power((vmax/vmin), val)
  File "/aphelion/jisuoqing/yt-x86_64/lib/python2.7/site-packages/numpy/ma/core.py", line 3642, in __mul__
    return multiply(self, other)
  File "/aphelion/jisuoqing/yt-x86_64/lib/python2.7/site-packages/numpy/ma/core.py", line 936, in __call__
    if m:
ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

And in cylindrical case, the error is:

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

>>> from yt.mods import *
>>> pf=load('relax_hdf5_chk_0000')
yt : [INFO     ] 2012-09-17 01:22:27,082 Parameters: current_time              = 0.0
yt : [INFO     ] 2012-09-17 01:22:27,082 Parameters: domain_dimensions         = [256 128   1]
yt : [INFO     ] 2012-09-17 01:22:27,082 Parameters: domain_left_edge          = [  0.00000000e+00  -6.55360000e+09   0.00000000e+00]
yt : [INFO     ] 2012-09-17 01:22:27,082 Parameters: domain_right_edge         = [  1.31072000e+10   6.55360000e+09   1.74532925e-02]
yt : [INFO     ] 2012-09-17 01:22:27,083 Parameters: cosmological_simulation   = 0.0
>>> p1 = SlicePlot(pf, 'z', 'dens', origin="left-domain")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/aphelion/jisuoqing/yt-x86_64/src/yt-hg/yt/visualization/plot_window.py", line 948, in __init__
    slc = pf.h.slice(axis, center[axis], fields=fields)
  File "/aphelion/jisuoqing/yt-x86_64/src/yt-hg/yt/data_objects/data_containers.py", line 1045, in __init__
    self._refresh_data()
  File "/aphelion/jisuoqing/yt-x86_64/src/yt-hg/yt/data_objects/data_containers.py", line 315, in _refresh_data
    self.get_data()
  File "/aphelion/jisuoqing/yt-x86_64/src/yt-hg/yt/data_objects/data_containers.py", line 830, in get_data
    self._generate_coords()
  File "/aphelion/jisuoqing/yt-x86_64/src/yt-hg/yt/data_objects/data_containers.py", line 1079, in _generate_coords
    for grid in self._get_grids():
  File "/aphelion/jisuoqing/yt-x86_64/src/yt-hg/yt/utilities/parallel_tools/parallel_analysis_interface.py", line 898, in _get_grids
    return ObjectIterator(self, attr='_grids')
  File "/aphelion/jisuoqing/yt-x86_64/src/yt-hg/yt/utilities/parallel_tools/parallel_analysis_interface.py", line 102, in __init__
    raise YTNoDataInObjectError(pobj)
yt.utilities.exceptions.YTNoDataInObjectError: The object requested has no data included in it.  It may lie on a grid face.  Try offsetting slightly.

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

I would very appreciate it if you have any idea on solving these errors.

Best wishes,
Suoqing


More information about the yt-users mailing list