Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix order of Athena++ cylindrical coords #4801

Merged
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions yt/frontends/athena_pp/data_structures.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
"kerr-schild": "spherical",
}


class AthenaPPGrid(AMRGridPatch):
_id_offset = 0

Expand Down Expand Up @@ -153,13 +152,22 @@ def __init__(
zrat = self._handle.attrs["RootGridX3"][2]
self._nonuniform = xrat != 1.0 or yrat != 1.0 or zrat != 1.0
self._magnetic_factor = get_magnetic_normalization(magnetic_normalization)

geom = self._handle.attrs["Coordinates"].decode("utf-8")
self.geometry = Geometry(geom_map[geom])
matthewturk marked this conversation as resolved.
Show resolved Hide resolved
if geom_map[geom] == "cylindrical":
forrestglines marked this conversation as resolved.
Show resolved Hide resolved
axis_order = ("r","theta","z")
else:
axis_order = None

Dataset.__init__(
self,
filename,
dataset_type,
units_override=units_override,
unit_system=unit_system,
default_species_fields=default_species_fields,
axis_order=axis_order
)
if storage_filename is None:
storage_filename = self.basename + ".yt"
Expand Down Expand Up @@ -200,9 +208,6 @@ def _parse_parameter_file(self):
self.domain_left_edge = np.array([xmin, ymin, zmin], dtype="float64")
self.domain_right_edge = np.array([xmax, ymax, zmax], dtype="float64")

self.geometry = Geometry(
geom_map[self._handle.attrs["Coordinates"].decode("utf-8")]
)
self.domain_width = self.domain_right_edge - self.domain_left_edge
self.domain_dimensions = self._handle.attrs["RootGridSize"]

Expand Down
Loading