[yt-users] convering_grid question

Matthew Turk matthewturk at gmail.com
Wed Aug 14 06:10:37 PDT 2013


Hi Barbara,

Thanks for writing!

There are two different types of covering grids -- the non-smoothed,
and the smoothed.  Note that both apply a few restrictions about how
you can define them, specifically relating to their left/right edges,
as in the past undefined behavior could arise if these were not
followed.  I believe that (unfortunately) the right_edge= argument
that you specified will not be functional; everything is determined
exclusively by the left_edge, dims and the level.  This is a problem
with the yt API which requires a backwards incompatible change, and so
unfortunately we are somewhat stuck with it at the moment (but in the
next version, 3.0, this behavior has been fixed to explicitly throw an
error.)

A non-smoothed covering grid will duplicate coarse cells in finer
refined regions.
A smoothed covering grid will interpolate through cascading interpolation.

So for the way you have defined this, you will get coarse zones
duplicated -- if you have a refine_by 2, then a root-level zone that
is not covered by any higher-resolution data will be duplicated into
2**(3*L) zones, where L is the level of the covering_grid you are
creating.

For a smoothed_covering_grid, the "cascading" interpolation works by
starting at level 0, filling with level 0 zones, interpolating to
level 1, filling with level 1 zones, interpolating to level 2, etc
etc.  These are done simply by trilinearly interpolating.

I hope that helps!

-Matt

On Wed, Aug 14, 2013 at 6:19 AM, barbara ramirez <barbara.rmr at gmail.com> wrote:
> Hello Everyone!
>
> So, I have a question about how does covering grid actually works. I have a
> Flash simulation output of a 28*28 Mpc box containing a cluster. I am trying
> to simulate the spectra from a region of size (0.08 Mpc x, 0.08 Mpc y, 28
> Mpc z) around the centre, (I will assume z is my line of sight) so I use
> this line to define the region:
>
> #The shape of my region
> cube = pf.h.covering_grid(level_max, left_edge=newlep,
> right_edge=newrep,dims=[6, 6, 128])
>
> where level = 5 (max level of refinement for my Flash data), "newlep" is
> centre coordinates (Mpc)  minus 0.08 Mpc and newrep is centre coordinates
> plus 0.08 Mpc, and then into percentage units.
>
> I put them into an array of dimensions [6,6,128] because I want 36 spectra
> (one for each pixel of the ccd) so I will fix an (x,y) position and write an
> XSPEC file for all z elements. (I need basically temperature and density of
> all the elements).
>
> My question is: how does covering grid makes a single field value
> (temperature, for example)  inside the (x,y,z) position? because I am
> arbitrarily saying to divide the region into 6 pixel, but the data file
> might have  many simulation pixels inside , so how are the field values
> calculated? is it just an average? or are just certain points taken into
> consideration?
>
> Thanks for any hints/tips/help!
> Barbara Ramirez
> University of Innsbruck, Austria
>
> _______________________________________________
> 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