Hi Matt,<div>Awesome, thanks for the quick response!  I'll give it a go and report back.</div><div><br></div><div>Sam<br><br><div class="gmail_quote">On Tue, Jan 11, 2011 at 10:50 AM, Matthew Turk <span dir="ltr"><<a href="mailto:matthewturk@gmail.com">matthewturk@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hi Sam,<br>
<br>
This has been on my list for a while, but I have never gotten around<br>
to it.  It'll be kind of important with the future things I have<br>
planned, but possibly in a different way.<br>
<br>
For now, I think it should be straightforward to implement this.  As<br>
long as you do not touch the .hierarchy file itself, you should be<br>
able to (broadly speaking) add fields at will.  My suggestion is to<br>
add a method to the grid object:<br>
<br>
def write_field(self, field_name):<br>
    self.hierarchy.io.write_field_to_disk(self, field_name, self[field])<br>
<br>
This would be a method of GridPatch, not EnzoGrid.<br>
<br>
Then, add to the base IOHandler object:<br>
<br>
def write_field_to_disk(self, grid, field_name, field_value):<br>
    raise NotImplementedError<br>
<br>
Then in the yt/frontends/enzo/io.py, under the Packed HDF5 (and then<br>
others can implement as necessary) add a write_field_to_disk that<br>
opens (in 'a' mode) the grid.filename, just like it normally would,<br>
and writes to disk using that.<br>
<br>
If you give this a shot and test it, let us know how it goes, and feel<br>
free to push if it works out.<br>
<br>
-Matt<br>
<div><div></div><div class="h5"><br>
On Tue, Jan 11, 2011 at 12:40 PM, Sam Skillman <<a href="mailto:samskillman@gmail.com">samskillman@gmail.com</a>> wrote:<br>
> Hi all,<br>
> I've started dealing with a lot of time-consuming derived fields and am<br>
> wondering if there is already support for writing derived fields back to the<br>
> raw data files (e.g. .cpu files).  If not, any thoughts on doing so?<br>
><br>
> Sam<br>
</div></div>> _______________________________________________<br>
> Yt-dev mailing list<br>
> <a href="mailto:Yt-dev@lists.spacepope.org">Yt-dev@lists.spacepope.org</a><br>
> <a href="http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org</a><br>
><br>
><br>
_______________________________________________<br>
Yt-dev mailing list<br>
<a href="mailto:Yt-dev@lists.spacepope.org">Yt-dev@lists.spacepope.org</a><br>
<a href="http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org</a><br>
</blockquote></div><br></div>