Skip to content

Commit

Permalink
Merge pull request #4801 from forrestglines/fix-athena_pp-cylindrical…
Browse files Browse the repository at this point in the history
…-order

Fix order of Athena++ cylindrical coords
  • Loading branch information
matthewturk authored Feb 15, 2024
2 parents 8be1f8b + 2aba96b commit 75b04d8
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions yt/frontends/athena_pp/data_structures.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,13 +153,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])
if self.geometry == "cylindrical":
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 +209,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

0 comments on commit 75b04d8

Please sign in to comment.