diff --git a/yt/utilities/lib/pyoctree_raytracing.py b/yt/utilities/lib/pyoctree_raytracing.py index f5fd46056b8..b20d48dac9f 100644 --- a/yt/utilities/lib/pyoctree_raytracing.py +++ b/yt/utilities/lib/pyoctree_raytracing.py @@ -63,7 +63,9 @@ def set_fields(self, fields, log_fields, no_ghost, force=False): vertex_data = np.log10(vertex_data) # Vertex_data has shape (2, 2, 2, ...) - self.data = vertex_data.reshape(8, -1) + # Note: here we have the wrong ordering within the oct (classical Fortran/C + # ordering issue) so we need to swap axis 0 and 2. + self.data = vertex_data.swapaxes(0, 2).reshape(8, -1) def cast_rays(self, vp_pos, vp_dir): """Cast the rays through the oct.