[yt-users] Comparing different timesteps

Matthew Turk matthewturk at gmail.com
Sat Nov 9 12:41:04 PST 2013


Hi Stephanie,

Sorry for the delay in replying.  Your question is a hard one!

On Fri, Nov 8, 2013 at 1:12 PM, Stephanie Tonnesen <stonnes at gmail.com> wrote:
> Hi yt-users!
>
> I am trying to compare how my magnetic field varies in a couple runs that
> start with different initial magnetic field configurations.  Right now I
> would like to take a look at two things:  a SlicePlot and a phase_object.  I
> would like the "z" of the SlicePlot to be the B-field of the "current" time
> / B-field of the initial output.  I would like the phase_plot to be the
> B-field of the "current" time / B-field of the initial output vs a fluid
> tracer field.  So for a single output:
>
>>pc.add_phase_object(alld,["specific_scalar[0]","BMagnitude","CellMassSolar"],
> weight=None,x_bins=50,y_bins=50,x_log=False,y_log=False)
>
> But I want two phase_objects from different times divided by eachother.  I
> looked at Time Series, but that doesn't seem to be what I want.  I am not
> sure if I have explained myself clearly, and can try again if it doesn't
> make sense.  If it does, can I do this?
>

So, yes, we kind of can for your specific use case, since I think
you're using Athena data, which will retain a constant mesh structure.
 The problem comes in in mapping a spatial location from one timestep
to the same spatial location in another timestep.  If the mapping is
basically the same, we can do this (with some trickery / sleight of
hand) but if the mapping is odd or different, it can be challenging.
I think that the types of development Sam and I have been working on
in yt 3.0 to support things like contour finding will support this
type of thing, but right now it's hard.  What it comes down to is the
idea that if your mesh structure remains the same, then the mapping of
x,y,z to f(x,y,z) will have the same number of values between
timesteps.  If your mesh changes, one data value might correspond to a
different number of data values in a subsequent timestep, so you'd
need to essentially take the union of the meshes to get it.

Anyway, that's beside the point.  You can do this essentially by
tricking yt into thinking that t_0's data field is a data field at
t_1.  I've got a unigrid simulation here that I've tested this piece
of code on.  It uses the field_parameters system to pass in an old
dataset, and it verifies that a data field is a grid.  It requires
that grid IDs between timesteps correspond to *exactly* the same
regions, which is not always a safe assumption.

http://paste.yt-project.org/show/4044/

Also, I've just tossed in some time comparisons, but that kind of
turns it into not-really-meaningful information.  So take from that
what you will.  :)  But this works for me, and I think it should work
for your use case.

Let me know if there's anything else I can do to help!

-Matt

PS I had forgotten about the memory issues you were running into, but
that's on my list next ...

> Thanks,
>
> Stephanie
>
>
> _______________________________________________
> 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