Skip to content

Commit

Permalink
Use Tabular1D, Tabular2D instead of tabular_model
Browse files Browse the repository at this point in the history
  • Loading branch information
ViciousEagle03 authored and Cadair committed Nov 6, 2024
1 parent 95486b0 commit 4fb5288
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions ndcube/extra_coords/table_coord.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
import astropy.units as u
from astropy.coordinates import SkyCoord
from astropy.modeling import models
from astropy.modeling.models import tabular_model
from astropy.modeling.tabular import _Tabular
from astropy.modeling.tabular import Tabular1D, Tabular2D, _Tabular
from astropy.time import Time
from astropy.wcs.wcsapi.wrappers.sliced_wcs import combine_slices, sanitize_slices

Expand Down Expand Up @@ -136,7 +135,10 @@ def _generate_tabular(lookup_table, interpolation='linear', points_unit=u.pix, *
raise TypeError("lookup_table must be a Quantity.") # pragma: no cover

ndim = lookup_table.ndim
TabularND = tabular_model(ndim, name=f"Tabular{ndim}D")
if ndim == 1:
TabularND = Tabular1D
elif ndim == 2:
TabularND = Tabular2D

# The integer location is at the centre of the pixel.
points = [(np.arange(size) - 0) * points_unit for size in lookup_table.shape]
Expand Down

0 comments on commit 4fb5288

Please sign in to comment.