[yt-users] Flush to file

Matthew Turk matthewturk at gmail.com
Fri Sep 14 09:38:40 PDT 2012


Hi Dave,

(Assuming this is Enzo...)

Derived quantity or derived field?

If derived field, it depends on how it's defined.  Is it defined
inside grid objects?  If so, something like this:

for g in pf.h.grids:
    f = h5py.File(g.filename)
    f["/Grid%08i" % g.id].create_dataset("Something", data=g[whatever])
    f.close()

Note you may need to apply conversions.  This could be sped up if you
sort by filename and only open as needed.  If it's defined in a data
object, you'll need to flush back to the grids using _flush_to_grids
and supply a default value, as it won't be defined except where there
are no child zones.  Then in enzo you'll likely need to apply a
correction from the child grids to get the correct value back.

-Matt

On Fri, Sep 14, 2012 at 12:35 PM, david collins <antpuncher at gmail.com> wrote:
> Hi, all--
>
> Is there a way to write a derived quantity directly to the original data files?
>
> d.
>
> --
> Sent from my computer.
> _______________________________________________
> yt-users mailing list
> yt-users at lists.spacepope.org
> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org



More information about the yt-users mailing list