fix wwinp reader

This commit is contained in:
Ethan Peterson 2022-10-01 09:22:57 -04:00
parent 46045588f5
commit 9c13e85dc2

View file

@ -560,10 +560,13 @@ def wwinp_to_wws(path):
end_idx = start_idx + (nfx * nfy * nfz) * nt_i * ne_i
# read values and reshape according to ordering
# slowest to fastest: z, y, x, e
ww_values = ww_data[start_idx:end_idx].reshape(nfz, nfy, nfx, ne_i)
# swap z and x axes for correct shape and (ijk, e) mesh indexing
ww_values = np.swapaxes(ww_values, 2, 0)
# slowest to fastest: t, e, z, y, x
# reorder with transpose since our ordering is x, y, z, e, t
ww_shape = (nt_i, ne_i, nfz, nfy, nfx)
ww_values = ww_data[start_idx:end_idx].reshape(ww_shape).T
# Only use first time bin since we don't support time dependent weight
# windows yet.
ww_values = ww_values[:, :, :, :, 0]
start_idx = end_idx
# create a weight window object