Skip to content
Snippets Groups Projects
Commit a3139649 authored by Francesco Zappa's avatar Francesco Zappa
Browse files

Fix box limits when calling athena reader, fix data ordering for Athena

parent 6ed42f37
No related branches found
No related tags found
No related merge requests found
......@@ -207,36 +207,15 @@ def read_h5_dset_athena(fname, data_sym = None,
if initial_radius == None:
data_ath = athdf(fname, num_ghost = num_ghost, vertex_centered = True, dtype = np.float64, level = level)
else:
data_ath = athdf(fname, num_ghost = num_ghost, vertex_centered = True, dtype = np.float64, level = level, x1_max = initial_radius, x2_max = initial_radius, x3_max = initial_radius)
data_ath = athdf(fname, num_ghost = num_ghost, vertex_centered = True, dtype = np.float64, level = level, x1_max = initial_radius, x2_max = initial_radius, x3_max = initial_radius, x1_min = -initial_radius, x2_min = -initial_radius, x3_min = -initial_radius)
data['time'] = data_ath["Time"]
data['coord_x'] = data_ath["x1f"][0:-1]
data['coord_y'] = data_ath["x2f"][0:-1]
data['coord_z'] = data_ath["x3f"][0:-1]
for fi in fields:
data[fi] = data_ath["adm.{}".format(fi)]
print( np.shape(data['coord_x']) )
print( np.shape(data[fi]) )
#if data_sym == 'octant':
# x_aux = np.zeros((len(data['coord_x'])*2 - 1))
# y_aux = np.zeros((len(data['coord_y'])*2 - 1))
# z_aux = np.zeros((len(data['coord_z'])*2 - 1))
# (nx, ny, nz) = (len(x_aux), len(y_aux), len(z_aux))
# x_aux[0:nx//2+1] = -data['coord_x'][::-1]
# y_aux[0:ny//2+1] = -data['coord_y'][::-1]
# z_aux[0:nz//2+1] = -data['coord_z'][::-1]
# x_aux[nx//2::] = data['coord_x']
# y_aux[ny//2::] = data['coord_y']
# z_aux[nz//2::] = data['coord_z']
# data['coord_x'] = x_aux
# data['coord_y'] = y_aux
# data['coord_z'] = z_aux
#for fi in fields:
# data[fi] = data_ath["adm.{}".format(fi)]
# if data_sym == "octant":
# data[fi] = octant_to_full(data[fi])
## Swap axes because Athena output is zyx. 'C' order after that for Cython
data[fi] = np.swapaxes(data_ath["adm.{}".format(fi)], 0, 2).copy(order='C')
return data
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment