diff --git a/iris/sg/_spectrograph.py b/iris/sg/_spectrograph.py index 4a2a284..65aa846 100644 --- a/iris/sg/_spectrograph.py +++ b/iris/sg/_spectrograph.py @@ -255,6 +255,10 @@ def from_fits( raise ValueError(f"{window=} not in {windows=}") hdu_prototype = hdul_prototype[index_window] + + if hdu_prototype.header["CDELT3"] == 0: + hdu_prototype.header["CDELT3"] = 1 + wcs_prototype = astropy.wcs.WCS(hdu_prototype) axes_wcs = list(reversed(wcs_prototype.axis_type_names)) @@ -293,6 +297,9 @@ def from_fits( hdu = hdul[index_window] hdu_aux = hdul[~1] + if hdu.header["CDELT3"] == 0: + hdu.header["CDELT3"] = 1 + detector_type = hdul[0].header[f"TDET{index_window}"] key_timedelta = "EXPTIMEF" if "FUV" in detector_type else "EXPTIMEN" diff --git a/iris/sg/_spectrograph_test.py b/iris/sg/_spectrograph_test.py index c1702b7..76d4cb2 100644 --- a/iris/sg/_spectrograph_test.py +++ b/iris/sg/_spectrograph_test.py @@ -12,7 +12,11 @@ time_start=astropy.time.Time("2021-09-23T06:00"), time_stop=astropy.time.Time("2021-09-23T07:00"), nrt=True, - ) + ), + iris.sg.SpectrographObservation.from_time_range( + time_start=astropy.time.Time("2019-01-23T02:49:03"), + time_stop=astropy.time.Time("2019-01-23T02:50:03"), + ), ], ) class TestSpectrographObservation: