[yt-users] Problem with covering_grid

Wolfram Schmidt schmidt at astro.physik.uni-goettingen.de
Thu Nov 28 07:01:25 PST 2013


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?

Cheers,
Wolfram



More information about the yt-users mailing list