<meta http-equiv="Content-Type" content="text/html; charset=utf-8"><div dir="ltr"><div class="gmail_extra">Hi Matt,</div><div class="gmail_extra"><br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">> I am attempting to create a derived field from a cosmological simulation<br>
> dataset using Grackle.  Specifically, I have a simulation that was run with<br>
> Grackle, but which unfortunately did not output the cooling time.  Ergo, I'd<br>
> like to create that as a derived field.  Does anybody have an example of a<br>
> Grackle-based derived field in yt that I can use as a model?  I would note<br>
> that I looked at the "run_from_yt.py" example in the Grackle distro, but it<br>
> isn't quite what I need.<br>
<br>
</div></div>You'll probably need to use bits of that, and actually call Grackle on<br>
your data object.  If you can set up Grackle outside of the derived<br>
field you can minimize the overhead cost.  But, calling grackle just<br>
like it would be otherwise, but inside the derived field definition,<br>
is going to be the way to go I think.<br></blockquote><div><br></div><div>As a very high-level answer, that makes sense.  Implementation seems to be a bit harder - I've been trying to reconcile the way that grackle is called from its python wrapper with the way that yt generates derived fields.  In grid_to_grackle(), you feed in individual grids and each grid's fields (including other derived fields) are accessed by stepping through a grid in slabs, with a great deal of information about the grid itself being required.  When I look at derived fields in yt, everything works by calling data[], possibly using adjacent slabs/cells in various ways, but never referring to individual grids.  Could you point me toward an example of a derived field where grids are manipulated more directly?  I don't really have any idea about how to actually *do* what you've suggested, at least given the grackle python interface as it stands in grackle 2.</div><div><br></div><div>Thank you!</div><div><br></div><div>--Brian</div><div><br></div></div></div></div>