[yt-users] add_field or grids.get_data different in yt-3.0 for FLASH data?

James Guillochon jguillochon at cfa.harvard.edu
Thu Nov 14 17:11:20 PST 2013


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:

    for cnt, g in enumerate(pf.h.grids):
>         if g.Level > pf.h.max_level - args.undersample: continue
>         if len(g.Children) != 0 and g.Level != pf.h.max_level -
> args.undersample: continue
>         evals = list()
>         vvals = list()
> #vvals = g.get_data(args.var).ravel()
>         for e, ev in enumerate(args.vars):
>             vvals.append(g.get_data(ev).ravel())


...and here's the error:

vvals.append(g.get_data(ev).ravel())
> AttributeError: 'NoneType' object has no attribute 'ravel'


I initialized the fields using a loop in the following way:

myvars = []
> for e, ev in enumerate(list(set(args.vars) | set(args.excludevars))):
>     myvars += [var(ev)]
>     add_field(ev, function=myvars[e].mesh, take_log=args.log)


I understand that how fields behave has changed somewhat in 3.0. Any idea
what could be causing the issue?

The whole routine is here: http://goo.gl/R7FmsK

Thanks all!

-- 
James Guillochon
Einstein Fellow at the Harvard-Smithsonian CfA
jguillochon at cfa.harvard.edu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.spacepope.org/pipermail/yt-users-spacepope.org/attachments/20131114/2c13237c/attachment.htm>


More information about the yt-users mailing list