[yt-users] empty plot issue
Kathy Eastwood
kathy.eastwood at nau.edu
Tue Nov 26 11:41:06 PST 2013
Hi, helpful folks. Another issue I have been struggling with, which is
similar to this thread
http://lists.spacepope.org/pipermail/yt-users-spacepope.org/2013-May/003652.html
I am working on some FLASH data with the current version of yt using MacOS
10.7.5. Using this exact same data set, I managed to create some nice
phaseplots using spheres centered on the densest spot. However, I now want
to make some plots for a much larger volume of scientific interest...
Here is the code
from yt.mods import *
%matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
pf = load("Strat_Box_hdf5_plt_cnt_0064")
pc = PlotCollection(pf, [0.5, 0.5, 0.5])
plane = pf.h.region([0.5,0.5,0.5],[0.0,0.0,0.4],[1.0,1.0,0.6])
pc.save("plane_cnt_0064")
I then get the following error
ValueError: Data has no positive values, and therefore can not be log-scaled
Following the advice in the thread listed above, John Wise suggested
"For your "empty" plot, do you have any gas with densities between
1e-26 and 1e-27 g/cm^3 in this sphere? If there's no gas in this
range, then CellVolume will be zero and will give you that error
message when it tries to take the log of CellVolume. If you want
to manually inspect the CellVolume field, you can print out the
following variable
pc.plots[-1].data['CellVolume']
which will give you the CellVolume as a function of the x-variable
for the last plot you have added to your PlotCollection."
The writer did not respond in the next thread, so I'm not sure if
this worked. But when I try it, I get the following:
KeyError Traceback (most recent call
last)<ipython-input-18-71f93f9e2cb6> in <module>()----> 1
pc.plots[-1].data["CellVolume"]
/Users/kde/yt-x86_64/src/yt-hg/yt/data_objects/profiles.pyc in
__getitem__(self, key) 160 # This raises a KeyError if it
doesn't exist 161 # This is because we explicitly want to
add all fields--> 162 return self.field_data[key] 163
164 def __setitem__(self, key, value):
KeyError: 'CellVolume'
Even though CellVolume is explicitly listed in my list of derived fields...
Also, I did try the same command for Density rather than CellVolume,
and the numbers were in the e-24 g cm-3 range...in fact, all the numbers
were exactly the same. So I don't know if I've screwed up my data container
somehow, or if the density values really are too low?
any ideas?
thanks SO much
kathy
--
Kathy DeGioia Eastwood, Ph.D.
Professor of Physics and Astronomy
Northern Arizona University
Flagstaff, AZ 86011-6010
Ph: 928-523-7159 FX: 928-523-1371
Kathy.Eastwood at nau.edu
deliveries: 602 S. Humphreys St., Bldg 19 Rm 209
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.spacepope.org/pipermail/yt-users-spacepope.org/attachments/20131126/65db5d9d/attachment.htm>
More information about the yt-users
mailing list