[yt-users] Problem with covering_grid

Matthew Turk matthewturk at gmail.com
Fri Nov 29 05:40:02 PST 2013


Hi Wolfram,

Ahh, sorry this is an issue for you.

On Thu, Nov 28, 2013 at 10:01 AM, Wolfram Schmidt
<schmidt at astro.physik.uni-goettingen.de> wrote:
> Hi,
>
> I want to read in the root-grid data from AMR output produce by Nyx. The
> following piece of code used to work a while ago and something similar can
> be found in the recipes:
>
> n_levels = 0
> pf =load(path)
> left=na.amin(pf.h.grid_left_edge,axis=0)
> right=na.amax(pf.h.grid_right_edge,axis=0)
> resolution = 2**n_levels*pf.domain_dimensions
> print n_levels, left, right, resolution
> cg = pf.h.covering_grid(n_levels, left_edge=left, right_edge=right,
> dims=resolution)
>
>
> With the current stable yt version, however, I get the following error:
>
> 0 [ 0.  0.  0.] [  2.46880000e+25   1.23440000e+25   1.23440000e+25] [256,
> 128, 128]
> Traceback (most recent call last):
>   File "/usr/users/wschmid2/scripts/radial_profile.py", line 71, in <module>
>     cg = pf.h.covering_grid(n_levels, left_edge=left, right_edge=right,
> dims=resolution)
>   File
> "/home/uni05/wschmid2/yt-x86_64/src/yt-hg/yt/data_objects/data_containers.py",
> line 3706, in __init__
>     rdx[np.where(dims - 2 * num_ghost_zones <= 1)] = 1   # issue 602
> TypeError: list indices must be integers, not tuple
>
> Since the output in the first line produced by the print statement shows
> that all parameters are perfectly ok, I don't understant what's the problem.
> Can anyone help?

A couple things -- right_edge is no longer a parameter.  The covering
grid uses left_edge, level, and resolution to compute the extent of
the grid.  And, I think you can use pf.domain_dimensions and/or
pf.domain_left_edge in place of dims and left edge (respectively.)

Can you also verify what:

type(pf.domain_dimensions)

returns?

Thanks,

Matt

>
> Cheers,
> Wolfram
> _______________________________________________
> 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