<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    Hi Matt, Boyan,<br>
    <br>
    Although I'm not currently struggling with this, I will eventually
    encounter a similar situation... What would one do if the grid was <i>not</i>
    uniform? Would a derived field still work if the grids were
    identical?<br>
    <br>
    Best,<br>
    Jonah<br>
    <br>
    <div class="moz-cite-prefix">On 15-06-16 09:34 AM, Matthew Turk
      wrote:<br>
    </div>
    <blockquote
cite="mid:CALO3=5EKquRGiftUryyqGROnWKsrcNEvuKruwv21VCXXwfcnTw@mail.gmail.com"
      type="cite">
      <pre wrap="">Hi Boyan,

Since the grids are uniform, you can do one of a few different things.
The first would be if you want to set up a derived field, you could do
something like:

ds1 = ...
ds2 = ...

@yt.derived_field(name = "my_field", validators = [yt.ValidateSpatial()])
def my_field(field, data):
    f1 = ds1.index.grids[data.id - data._id_offset][field.name]
    f2 = data[field.name]
    return f1 - f2

If you want to simply inspect, you can do
ds1.index.grids[whatever][field] - ds2.index.grids[whatever][field].

-Matt

On Mon, Jun 15, 2015 at 11:05 PM, bh11e <a class="moz-txt-link-rfc2396E" href="mailto:bh11e@my.fsu.edu"><bh11e@my.fsu.edu></a> wrote:
</pre>
      <blockquote type="cite">
        <pre wrap="">Hi,

I was wondering if someone could advise on the following problem. Consider two (Enzo) datasets with identical grids. What is the way to plot the difference between a field in one set and a field in the other. Alternatively is there a way to create a new dataset with the calculated difference, after which plotting will be as usual.

Thanks,

--Boyan Hristov
_______________________________________________
yt-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:yt-users@lists.spacepope.org">yt-users@lists.spacepope.org</a>
<a class="moz-txt-link-freetext" href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a>
</pre>
      </blockquote>
      <pre wrap="">_______________________________________________
yt-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:yt-users@lists.spacepope.org">yt-users@lists.spacepope.org</a>
<a class="moz-txt-link-freetext" href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>