Skip to content

Commit

Permalink
TST: decouple FITSDataset and SpectralCubeCoordinateHandler to allow …
Browse files Browse the repository at this point in the history
…inializing this geometry from the stream frontend
  • Loading branch information
neutrinoceros committed Oct 23, 2022
1 parent 35467e3 commit e860cf1
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions yt/geometry/coordinates/spec_cube_coordinates.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from yt.funcs import setdefaultattr

from .cartesian_coordinates import CartesianCoordinateHandler
from .coordinate_handler import _get_coord_fields

Expand All @@ -6,6 +8,15 @@ class SpectralCubeCoordinateHandler(CartesianCoordinateHandler):
name = "spectral_cube"

def __init__(self, ds, ordering=("x", "y", "z")):

setdefaultattr(ds, "lon_axis", 0)
setdefaultattr(ds, "lat_axis", 1)
setdefaultattr(ds, "spec_axis", 2)
setdefaultattr(ds, "lon_name", "X")
setdefaultattr(ds, "lat_name", "Y")
setdefaultattr(ds, "spec_name", "z")
setdefaultattr(ds, "spec_unit", "")

ordering = tuple(
"xyz"[axis] for axis in (ds.lon_axis, ds.lat_axis, ds.spec_axis)
)
Expand Down

0 comments on commit e860cf1

Please sign in to comment.