<meta http-equiv="Content-Type" content="text/html; charset=utf-8"><div dir="ltr">Hi Eric,<div><br></div><div>Did the load command succeed.  I noticed in the code you included that you did</div><div>ds = load("RD0009")</div><div>and not</div><div>ds = load("RD0009/RD0009")</div>
<div><br></div><div>It's not that is it?</div><div><br></div><div>Britton</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Aug 20, 2014 at 5:18 PM, Eric Hallman <span dir="ltr"><<a href="mailto:hallman@txcorp.com" target="_blank">hallman@txcorp.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">Hello again,<div>  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:</div>
<div><br></div><div><div>from yt.mods import *</div><div>from yt.analysis_modules.star_analysis.api import *</div><div>ds = load("RD0009")</div><div><br></div><div>spec = SpectrumBuilder(ds, bcdir="/Users/hallman/work/data/sfData", model="chabrier")</div>
<div><br></div><div>sm = np.ones(100)</div><div>ct = np.zeros(100)</div><div><br></div><div>spec.calculate_spectrum(star_mass=sm, star_creation_time=ct, star_metallicity_constant=0.02)</div><div><br></div><div>spec.write_out(name="spec.out")</div>
<div><br></div><div><br></div><div>And here is the output:</div><div><br></div><div><div style="margin:0px;font-size:11px;font-family:Menlo">Traceback (most recent call last):</div><div style="margin:0px;font-size:11px;font-family:Menlo">
  File "starSpec.py", line 13, in <module></div><div style="margin:0px;font-size:11px;font-family:Menlo">    spec.calculate_spectrum(star_mass=sm, star_creation_time=ct, star_metallicity_constant=0.02)</div>
<div style="margin:0px;font-size:11px;font-family:Menlo">  File "/Users/hallman/work/yt-x86_64/src/yt-hg/yt/analysis_modules/star_analysis/sfr_spectrum.py", line 387, in calculate_spectrum</div><div style="margin:0px;font-size:11px;font-family:Menlo">
    dt = (self.time_now - self.star_creation_time * self._ds['Time']) / YEAR</div><div style="margin:0px;font-size:11px;font-family:Menlo">  File "/Users/hallman/work/yt-x86_64/src/yt-hg/yt/data_objects/static_output.py", line 249, in __getitem__</div>
<div style="margin:0px;font-size:11px;font-family:Menlo">    return self.parameters[key]</div><div style="margin:0px;font-size:11px;font-family:Menlo">KeyError: 'Time'</div></div><div><br></div><div><br></div><div>
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.</div>
<div><br></div><div>Thanks for any help.</div><span class="HOEnZb"><font color="#888888"><div><br></div><div>Eric</div><div>
<span style="border-collapse:separate;border-spacing:0px"><span style="border-collapse:separate;color:rgb(0,0,0);font-family:Helvetica;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div style="word-wrap:break-word">
<div>-- <br>Eric Hallman<br>Tech-X Corporation               <a href="mailto:hallman@txcorp.com" target="_blank">hallman@txcorp.com</a><br>5621 Arapahoe Ave, Suite A       Phone: <a href="tel:%28720%29%20254-5833" value="+17202545833" target="_blank">(720) 254-5833</a><br>
Boulder, CO 80303                Fax:   <a href="tel:%28303%29%20448-7756" value="+13034487756" target="_blank">(303) 448-7756</a><br>--</div><div><br></div></div></span><br></span><br>
</div>
<br></font></span></div></div><br>_______________________________________________<br>
yt-users mailing list<br>
<a href="mailto:yt-users@lists.spacepope.org">yt-users@lists.spacepope.org</a><br>
<a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br>
<br></blockquote></div><br></div>