<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi,<div><br></div><div>I was trying some simple script for making ProjectionPlot and </div><div>failed for some reason.<font class="Apple-style-span" color="#ff3e29"> Here is the script:</font></div><div><br></div><div><div>import os, sys, time</div><div>from yt.mods import * # set up our namespace</div><div>import h5py as h5</div><div>from yt.utilities.amr_kdtree.api import AMRKDTree</div><div><br></div><div>fn = "redshift0085" # parameter file to load</div><div>pf = load(fn, file_style="%s.grid.cpu%%04i") # load data</div><div><br></div><div>center = [0.5,0.5,0.5]</div><div>sp = pf.h.sphere(center, 1.0/pf['mpc'])</div><div><br></div><div>p = ProjectionPlot(sp, "x","Density")</div><div>p.set_width(1.0,'mpc')</div><div>p.save()</div></div><div><br></div><div><br></div><div><font class="Apple-style-span" color="#ff3e29">The error message is this:</font></div><div><div>    p = ProjectionPlot(sp, "x","Density")</div><div>Traceback (most recent call last):</div><div>  File "projectOVIgasCZ3z0200.py", line 24, in <module></div><div>  File "/u/jhwise/local/lib/python2.7/site-packages/yt-2.4dev-py2.7-linux-x86_64.egg/yt/visualization/plot_window.py", line 828, in __init__</div><div>    p = ProjectionPlot(sp, "x","Density")</div><div>    p = ProjectionPlot(sp, "x","Density")</div><div>  File "/u/jhwise/local/lib/python2.7/site-packages/yt-2.4dev-py2.7-linux-x86_64.egg/yt/visualization/plot_window.py", line 828, in __init__</div><div>  File "/u/jhwise/local/lib/python2.7/site-packages/yt-2.4dev-py2.7-linux-x86_64.egg/yt/visualization/plot_window.py", line 828, in __init__</div><div>    p = ProjectionPlot(sp, "x","Density")</div><div>  File "/u/jhwise/local/lib/python2.7/site-packages/yt-2.4dev-py2.7-linux-x86_64.egg/yt/visualization/plot_window.py", line 828, in __init__</div><div>    (bounds,center) = GetBoundsAndCenter(axis,center,width,pf)</div><div>    (bounds,center) = GetBoundsAndCenter(axis,center,width,pf)</div><div>    (bounds,center) = GetBoundsAndCenter(axis,center,width,pf)</div><div>  File "/u/jhwise/local/lib/python2.7/site-packages/yt-2.4dev-py2.7-linux-x86_64.egg/yt/visualization/plot_window.py", line 136, in GetBoundsAndCenter</div><div>  File "/u/jhwise/local/lib/python2.7/site-packages/yt-2.4dev-py2.7-linux-x86_64.egg/yt/visualization/plot_window.py", line 136, in GetBoundsAndCenter</div><div>    (bounds,center) = GetBoundsAndCenter(axis,center,width,pf)</div><div>  File "/u/jhwise/local/lib/python2.7/site-packages/yt-2.4dev-py2.7-linux-x86_64.egg/yt/visualization/plot_window.py", line 136, in GetBoundsAndCenter</div><div>  File "/u/jhwise/local/lib/python2.7/site-packages/yt-2.4dev-py2.7-linux-x86_64.egg/yt/visualization/plot_window.py", line 136, in GetBoundsAndCenter</div><div>    width = (Wx/pf[unit], Wy/pf[unit])</div><div>  File "/u/jhwise/local/lib/python2.7/site-packages/yt-2.4dev-py2.7-linux-x86_64.egg/yt/data_objects/data_containers.py", line 327, in __getitem__</div><div>    width = (Wx/pf[unit], Wy/pf[unit])</div><div>  File "/u/jhwise/local/lib/python2.7/site-packages/yt-2.4dev-py2.7-linux-x86_64.egg/yt/data_objects/data_containers.py", line 327, in __getitem__</div><div>    width = (Wx/pf[unit], Wy/pf[unit])</div><div>  File "/u/jhwise/local/lib/python2.7/site-packages/yt-2.4dev-py2.7-linux-x86_64.egg/yt/data_objects/data_containers.py", line 327, in __getitem__</div><div>    width = (Wx/pf[unit], Wy/pf[unit])</div><div>  File "/u/jhwise/local/lib/python2.7/site-packages/yt-2.4dev-py2.7-linux-x86_64.egg/yt/data_objects/data_containers.py", line 327, in __getitem__</div><div>    self.get_data(key)</div><div>    self.get_data(key)</div><div>    self.get_data(key)</div><div>    self.get_data(key)</div><div>  File "/u/jhwise/local/lib/python2.7/site-packages/yt-2.4dev-py2.7-linux-x86_64.egg/yt/data_objects/data_containers.py", line 2510, in get_data</div><div>  File "/u/jhwise/local/lib/python2.7/site-packages/yt-2.4dev-py2.7-linux-x86_64.egg/yt/data_objects/data_containers.py", line 2510, in get_data</div><div>  File "/u/jhwise/local/lib/python2.7/site-packages/yt-2.4dev-py2.7-linux-x86_64.egg/yt/data_objects/data_containers.py", line 2510, in get_data</div><div>  File "/u/jhwise/local/lib/python2.7/site-packages/yt-2.4dev-py2.7-linux-x86_64.egg/yt/data_objects/data_containers.py", line 2510, in get_data</div><div>    if self._generate_field(field):</div><div>    if self._generate_field(field):</div><div>  File "/u/jhwise/local/lib/python2.7/site-packages/yt-2.4dev-py2.7-linux-x86_64.egg/yt/data_objects/data_containers.py", line 360, in _generate_field</div><div>  File "/u/jhwise/local/lib/python2.7/site-packages/yt-2.4dev-py2.7-linux-x86_64.egg/yt/data_objects/data_containers.py", line 360, in _generate_field</div><div>    if self._generate_field(field):</div><div>  File "/u/jhwise/local/lib/python2.7/site-packages/yt-2.4dev-py2.7-linux-x86_64.egg/yt/data_objects/data_containers.py", line 360, in _generate_field</div><div>    if self._generate_field(field):</div><div>  File "/u/jhwise/local/lib/python2.7/site-packages/yt-2.4dev-py2.7-linux-x86_64.egg/yt/data_objects/data_containers.py", line 360, in _generate_field</div><div>    raise KeyError(field)</div><div>    raise KeyError(field)</div><div>KeyError: 'unitary'</div><div>    raise KeyError(field)</div><div>KeyError: 'unitary'</div><div>KeyError: 'unitary'</div><div>    raise KeyError(field)</div><div>KeyError: 'unitary'</div></div><div><br></div><div><br></div><div>Thanks in advance for your help </div><div>Renyue</div><div><br></div></body></html>