[yt-users] Slice plot error

Nathan Goldbaum nathan12343 at gmail.com
Mon Sep 17 16:05:00 PDT 2012


Hi Suoqing,

Thanks for catching that error.  I've pushed a fix that should clear it up.

Cheers,

Nathan

On Sep 17, 2012, at 4:00 PM, Ji Suoqing wrote:

> Hi Nathan,
> 
> I really appreciate your efforts. However, this time a new error comes out:
> 
>>>> from yt.mods import *
>>>> pf=load('relax_hdf5_chk_0000')
> yt : [INFO     ] 2012-09-18 03:00:44,002 Parameters: current_time              = 0.0
> yt : [INFO     ] 2012-09-18 03:00:44,002 Parameters: domain_dimensions         = [256 128   1]
> yt : [INFO     ] 2012-09-18 03:00:44,002 Parameters: domain_left_edge          = [  0.00000000e+00  -6.55360000e+09   0.00000000e+00]
> yt : [INFO     ] 2012-09-18 03:00:44,002 Parameters: domain_right_edge         = [  1.31072000e+10   6.55360000e+09   1.74532925e-02]
> yt : [INFO     ] 2012-09-18 03:00:44,002 Parameters: cosmological_simulation   = 0.0
>>>> p1 = SlicePlot(pf, 'z', 'dens', origin="left-domain")
> yt : [INFO     ] 2012-09-18 03:01:21,207 Making a fixed resolution buffer of (dens) 800 by 800
>>>> p1.save(pf.basename)
> yt : [INFO     ] 2012-09-18 03:01:29,913 Saving plot relax_hdf5_chk_0000_Slice_z_dens.png
> Traceback (most recent call last):
>  File "<stdin>", line 1, in <module>
>  File "/aphelion/jisuoqing/sw/yt-x86_64/src/yt-hg/yt/visualization/plot_window.py", line 848, in save
>    names.append(v.save(n,mpl_kwargs))
>  File "/aphelion/jisuoqing/sw/yt-x86_64/src/yt-hg/yt/visualization/plot_window.py", line 1295, in save
>    canvas.print_figure(fn,**mpl_kwargs)
> TypeError: print_figure() argument after ** must be a mapping, not NoneType
> 
>> Also, I see that you were plotting a variable you defined elsewhere, my_var, in your original test script for the cartesian data.
> 
> Well, this my_var is just density here. Now the cartesian case has the same error with cylindrical case, as I've pasted above.
> 
> And now I just returned to use an old version of YT (a7570ca33e16), and it works properly.
> 
> Thanks!
> 
> Best wishes,
> Suoqing
> 
> 
> On Sep 17, 2012, at 5:17 PM, Nathan Goldbaum <nathan12343 at gmail.com> wrote:
> 
>> Hi Suoqing,
>> 
>> Can you update your yt installation and try once again?  We've patched a couple of things that might have been causing the issues you were seeing.
>> 
>> Also, I see that you were plotting a variable you defined elsewhere, my_var, in your original test script for the cartesian data.  Since I don't know the definition of my_var, I can't say if the fixes we added will prevent the crash you saw.
>> 
>> However, I suspect that the crash was due to the fact that my_var was identical everywhere.  I think you will avoid the crash if you set the colorbar limits by hand:
>> 
>> slc.set_zlim('my_var',1e-3,1e3)
>> 
>> for example will tell yt to set the color bar limits to 1e-3, 1e3.  If the field is ever less than zero, you might also try defining your field so that yt does not take the log of it when plotting:
>> 
>> add_field('my_var', ..., take_log=False)
>> 
>> Please let us know if these changes have resolve your issue.
>> 
>> Cheers,
>> 
>> Nathan
>> 
>> On Sep 16, 2012, at 4:18 PM, Ji Suoqing wrote:
>> 
>>> Hi Nathan,
>>> 
>>> Thanks for your prompt response.
>>> 
>>>> Can you reply with the output of the 'yt stats' command.
>>> 
>>> (yt-x86_64)[jisuoqing at hpcmanage object]$ yt stats cellular_hdf5_chk_0000 
>>> yt : [INFO     ] 2012-09-17 03:22:02,644 Parameters: current_time              = 0.0
>>> yt : [INFO     ] 2012-09-17 03:22:02,644 Parameters: domain_dimensions         = [1280   64    1]
>>> yt : [INFO     ] 2012-09-17 03:22:02,644 Parameters: domain_left_edge          = [ 0.  0.  0.]
>>> yt : [INFO     ] 2012-09-17 03:22:02,645 Parameters: domain_right_edge         = [ 256.    12.8   12.8]
>>> yt : [INFO     ] 2012-09-17 03:22:02,645 Parameters: cosmological_simulation   = 0.0
>>> yt : [INFO     ] 2012-09-17 03:22:02,655 Adding unknown field enuc to list of fields
>>> yt : [INFO     ] 2012-09-17 03:22:02,655 Adding unknown field ar36 to list of fields
>>> yt : [INFO     ] 2012-09-17 03:22:02,655 Adding unknown field c12  to list of fields
>>> yt : [INFO     ] 2012-09-17 03:22:02,655 Adding unknown field ca40 to list of fields
>>> yt : [INFO     ] 2012-09-17 03:22:02,656 Adding unknown field cr48 to list of fields
>>> yt : [INFO     ] 2012-09-17 03:22:02,656 Adding unknown field fe52 to list of fields
>>> yt : [INFO     ] 2012-09-17 03:22:02,656 Adding unknown field he4  to list of fields
>>> yt : [INFO     ] 2012-09-17 03:22:02,656 Adding unknown field mg24 to list of fields
>>> yt : [INFO     ] 2012-09-17 03:22:02,656 Adding unknown field ne20 to list of fields
>>> yt : [INFO     ] 2012-09-17 03:22:02,656 Adding unknown field ni56 to list of fields
>>> yt : [INFO     ] 2012-09-17 03:22:02,656 Adding unknown field o16  to list of fields
>>> yt : [INFO     ] 2012-09-17 03:22:02,656 Adding unknown field s32  to list of fields
>>> yt : [INFO     ] 2012-09-17 03:22:02,656 Adding unknown field si28 to list of fields
>>> yt : [INFO     ] 2012-09-17 03:22:02,657 Adding unknown field ti44 to list of fields
>>> level	# grids	       # cells
>>> ------------------------------
>>> 0	    64	        262144
>>> ----------------------------
>>> 	    64	        262144
>>> 
>>> 
>>> t = 0.00000000e+00 = 0.00000000e+00 s = 0.00000000e+00 years
>>> 
>>> Smallest Cell:
>>> 	Width: 1.620e-25 mpc
>>> 	Width: 1.620e-22 kpc
>>> 	Width: 1.620e-19 pc
>>> 	Width: 3.342e-14 au
>>> 	Width: 7.190e-12 rsun
>>> 	Width: 3.106e-06 miles
>>> 	Width: 1.953e-03 unitary
>>> 	Width: 5.000e-01 1
>>> 	Width: 5.000e-01 cm
>>> 
>>> It seems that the only problem is related with slice plot.
>>> 
>>> Best wishes,
>>> Suoqing
>>> 
>>> On Sep 16, 2012, at 6:56 PM, Nathan Goldbaum <nathan12343 at gmail.com> wrote:
>>> 
>>>> Hi Suoqing,
>>>> 
>>>> This error will show up if yt cannot select any data.  Recently we
>>>> changed the way yt handles 2D FLASH data so it's possible that these
>>>> changes have messed up data selection for your setup.
>>>> 
>>>> Unfortunately it's difficult to say the exact reason why data
>>>> selection is broken without knowing more about your setup.
>>>> 
>>>> Can you reply with the output of the 'yt stats' command.  Run this
>>>> from the command line.
>>>> 
>>>> It would also help to see the minimum and maximum z values of your
>>>> data.  There are a number of ways to do this but a sample script would
>>>> look something like this:
>>>> 
>>>> pf = load(your_data)
>>>> dd = pf.h.all_data()
>>>> print dd['z'].min(),  dd['z'].max()
>>>> 
>>>> Cheers,
>>>> 
>>>> Nathan
>>>> 
>>>> 
>>>> On Sep 16, 2012, at 2:23 PM, Ji Suoqing <jisuoqing at gmail.com> wrote:
>>>> 
>>>>> 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
>>>>> _______________________________________________
>>>>> yt-users mailing list
>>>>> yt-users at lists.spacepope.org
>>>>> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>>>> _______________________________________________
>>>> yt-users mailing list
>>>> yt-users at lists.spacepope.org
>>>> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>>> 
>>> _______________________________________________
>>> yt-users mailing list
>>> yt-users at lists.spacepope.org
>>> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>> 
>> _______________________________________________
>> yt-users mailing list
>> yt-users at lists.spacepope.org
>> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
> 
> _______________________________________________
> yt-users mailing list
> yt-users at lists.spacepope.org
> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org




More information about the yt-users mailing list