Skip to content

Commit

Permalink
Test validation of slit range
Browse files Browse the repository at this point in the history
  • Loading branch information
Cadair committed Oct 20, 2023
1 parent f041dde commit 7d1eb5e
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions dkist/wcs/tests/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,25 @@ def test_vct_shape_errors():
VaryingCelestialTransform3D(crval_table=crval_table[0], pc_table=pc_table[0], **kwargs)


@pytest.mark.parametrize("slit", [-1, np.nan, 3, 10])
def test_vct_slit_bounds(slit):
crpix=[0, 0]
cdelt=[1, 1]
pc_table=np.identity(2)
crval_table=np.array([[1,1], [2,2]])
lon_pole=180

with pytest.raises(ValueError,
match="must be one of the first two pixel dimensions"):
varying_celestial_transform_from_tables(
crpix=crpix,
cdelt=cdelt,
pc_table=pc_table,
crval_table=crval_table,
lon_pole=lon_pole,
slit=slit,
)

@pytest.mark.parametrize("num_varying_axes", [pytest.param(1, id='1D'), pytest.param(2, id='2D'), pytest.param(3, id='3D')])
@pytest.mark.parametrize("slit", [pytest.param(1, id="spectrograph"), pytest.param(None, id="imager")])
@pytest.mark.parametrize("has_units", [pytest.param(True, id="With Units"), pytest.param(False, id="Without Units")])
Expand Down

0 comments on commit 7d1eb5e

Please sign in to comment.