Hi G.S.,<br><br>This is pretty far outside of how fields are designed to work in yt.  The access of data in yt isn't currently designed to work with more than one pf.  I don't actually see a way to do this without combining the data so that it can be seen as a single pf.  If parallel wasn't an issue and this were only a unigrid run, you might be able to read in all the data at once from both pfs and do some of this by hand.  If this is AMR, then I think this may not be possible at all, considering the hierarchy is unlikely to be exactly the same between two different datasets.<br>
<br>Britton<br><br><div class="gmail_quote">On Mon, Jul 18, 2011 at 5:27 PM,  <span dir="ltr"><<a href="mailto:gso@physics.ucsd.edu">gso@physics.ucsd.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hi,<br>
<br>
I was wondering if it is possible to specify two different sources of<br>
input to create a derived field.  Currently with a single source, I have a<br>
derived field defined as:<br>
<br>
def _HII_HFraction(field, data):<br>
   return data["HII_Density"]/(data["HI_Density"]+data["HII_Density"])<br>
<br>
add_field("HII_HFraction", function=_HII_HFraction,<br>
units=r"\frac{\rho_{HII}}{\rho_H}")<br>
<br>
And I can access the total quantity in parallel<br>
<br>
pf=load(file)<br>
<br>
dd = pf.h.all_data()<br>
<br>
dd.quantities["TotalQuantity"]("HII_HFraction")[0]<br>
<br>
But I'm dealing with<br>
<br>
pf1=load(file1)<br>
pf2=load(file2)<br>
<br>
pf1 has the HI_Density field data and pf2 has the HII_Density field data.<br>
Is there a way to create a derived field and use TotalQuantity to operate<br>
on the data in parallel?<br>
<br>
From<br>
G.S.<br>
<br>
PS. I guess my alternative is to glue the two HDF5 files into one, but<br>
want to avoid it if possible.<br>
<br>
<br>
_______________________________________________<br>
yt-users mailing list<br>
<a href="mailto:yt-users@lists.spacepope.org">yt-users@lists.spacepope.org</a><br>
<a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br>
</blockquote></div><br>