<div dir="ltr">Hi, I have a histogram routine I wrote to process FLASH data. The routine works in yt 2.x, but gives me an error when call get_data from a grids object. Here's the snippet that fails:<div><br></div><div>
<div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><font face="courier new, monospace"> for cnt, g in enumerate(pf.h.grids):<br>
if g.Level > pf.h.max_level - args.undersample: continue<br> if len(g.Children) != 0 and g.Level != pf.h.max_level - args.undersample: continue<br> evals = list()<br> vvals = list()<br>#vvals = g.get_data(args.var).ravel()<br>
for e, ev in enumerate(args.vars):<br> vvals.append(g.get_data(ev).ravel())</font></blockquote></div><div><br></div><div>...and here's the error:</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<font face="courier new, monospace">vvals.append(g.get_data(ev).ravel())<br></font><font face="courier new, monospace">AttributeError: 'NoneType' object has no attribute 'ravel'</font></blockquote><div><br>
</div><div>I initialized the fields using a loop in the following way:</div><div><br></div><div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<font face="courier new, monospace">myvars = []<br>for e, ev in enumerate(list(set(args.vars) | set(args.excludevars))):<br> myvars += [var(ev)]<br> add_field(ev, function=myvars[e].mesh, take_log=args.log)</font></blockquote>
<div><br></div><div>I understand that how fields behave has changed somewhat in 3.0. Any idea what could be causing the issue?</div></div><div><br></div><div>The whole routine is here: <a href="http://goo.gl/R7FmsK">http://goo.gl/R7FmsK</a></div>
<div><br></div><div>Thanks all!</div><div><br></div>-- <br><div dir="ltr">James Guillochon<br>Einstein Fellow at the Harvard-Smithsonian CfA<br><a href="mailto:jguillochon@cfa.harvard.edu" target="_blank">jguillochon@cfa.harvard.edu</a><br>
</div>
</div></div>