Skip to content

Commit

Permalink
add test for nddata translation with non-WCS coords
Browse files Browse the repository at this point in the history
  • Loading branch information
bmorris3 committed Jul 31, 2024
1 parent fde205a commit a54b5b0
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion glue_astronomy/translators/tests/test_nddata.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

from glue.core import Data, DataCollection
from glue.core.component import Component
from glue.core.coordinates import Coordinates
from glue.core.coordinates import Coordinates, IdentityCoordinates

WCS_CELESTIAL = WCS(naxis=2)
WCS_CELESTIAL.wcs.ctype = ['RA---TAN', 'DEC--TAN']
Expand Down Expand Up @@ -222,3 +222,17 @@ def test_meta_round_trip():
assert len(image_new.meta) == 2
assert image_new.meta['BUNIT'] == 'Jy/beam'
assert image_new.meta['some_variable'] == 10


def test_other_coords():
coords = IdentityCoordinates(n_dim=2)

flux = [[2, 3], [4, 5]] * u.Jy
ndd = NDDataArray(data=flux)

data_collection = DataCollection()

data_collection['image'] = ndd
data_collection['image'].coords = coords
round_trip_ndd = data_collection['image'].get_object(cls=NDDataArray)
assert round_trip_ndd.shape == (2, 2)

0 comments on commit a54b5b0

Please sign in to comment.