Debian Codegraph @

asdf_astropy/converters/wcs/tests/conftest.py

raw
1 import pytest
2 from astropy.wcs import WCS
3
4
5 @pytest.fixture
6 def gwcs_4d_identity_units():
7 pytest.importorskip("gwcs")
8 from gwcs.examples import gwcs_4d_identity_units
9
10 return gwcs_4d_identity_units()
11
12
13 @pytest.fixture
14 def astropy_wcs_4d():
15 wcs = WCS(naxis=4)
16 wcs.wcs.ctype = "RA---CAR", "DEC--CAR", "FREQ", "TIME"
17 wcs.wcs.cunit = "deg", "deg", "Hz", "s"
18 wcs.wcs.cdelt = -2.0, 2.0, 3.0e9, 1
19 wcs.wcs.crval = 4.0, 0.0, 4.0e9, 3
20 wcs.wcs.crpix = 6.0, 7.0, 11.0, 11.0
21 wcs.wcs.cname = "Right Ascension", "Declination", "Frequency", "Time"
22 return wcs
23
24
25 @pytest.fixture(
26 params=[
27 "gwcs_4d_identity_units",
28 "astropy_wcs_4d",
29 ],
30 )
31 def all_4d_wcses(request):
32 return request.getfixturevalue(request.param)