Hi Eric,

Did the load command succeed.  I noticed in the code you included that you did
ds = load("RD0009")
and not
ds = load("RD0009/RD0009")

It's not that is it?

Britton


On Wed, Aug 20, 2014 at 5:18 PM, Eric Hallman <hallman@txcorp.com> wrote:
Hello again,
  I'm again running a very simple script from the cookbook, learning how to use the stellar spectrum generator.  It's just a simple tests of spectrum generation with stars of all the same age and mass. It fails with a key error on the dataset, even thought it's not really using the dataset for anything but a reference time (I think). Since it's all small, I'll clip it in below.  Here's the script itself:

from yt.mods import *
from yt.analysis_modules.star_analysis.api import *
ds = load("RD0009")

spec = SpectrumBuilder(ds, bcdir="/Users/hallman/work/data/sfData", model="chabrier")

sm = np.ones(100)
ct = np.zeros(100)

spec.calculate_spectrum(star_mass=sm, star_creation_time=ct, star_metallicity_constant=0.02)

spec.write_out(name="spec.out")


And here is the output:

Traceback (most recent call last):
  File "starSpec.py", line 13, in <module>
    spec.calculate_spectrum(star_mass=sm, star_creation_time=ct, star_metallicity_constant=0.02)
  File "/Users/hallman/work/yt-x86_64/src/yt-hg/yt/analysis_modules/star_analysis/sfr_spectrum.py", line 387, in calculate_spectrum
    dt = (self.time_now - self.star_creation_time * self._ds['Time']) / YEAR
  File "/Users/hallman/work/yt-x86_64/src/yt-hg/yt/data_objects/static_output.py", line 249, in __getitem__
    return self.parameters[key]
KeyError: 'Time'


Even if I modify "sfr_spectrum.py" to use the key "current_time", it still fails with the same error.  This is with yt-3.0, dataset created with the tip of enzo-dev as of about 20 minutes ago.  It fails on older enzo datasets as well with the same error.

Thanks for any help.

Eric
-- 
Eric Hallman
Tech-X Corporation               hallman@txcorp.com
5621 Arapahoe Ave, Suite A       Phone: (720) 254-5833
Boulder, CO 80303                Fax:   (303) 448-7756
--





_______________________________________________
yt-users mailing list
yt-users@lists.spacepope.org
http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org