From 2e9c757c78604996d0021cc57074ec25ab00a658 Mon Sep 17 00:00:00 2001 From: Kyle Westfall Date: Mon, 1 Jul 2024 10:56:33 -0700 Subject: [PATCH] allow for empty 2d wavecal hdu extension --- pypeit/wavecalib.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pypeit/wavecalib.py b/pypeit/wavecalib.py index db1b5b8aa0..d76fa9baf4 100644 --- a/pypeit/wavecalib.py +++ b/pypeit/wavecalib.py @@ -217,7 +217,8 @@ def from_hdu(cls, hdu, chk_version=True, **kwargs): # Parse all the WAVE2DFIT extensions # TODO: It would be good to have the WAVE2DFIT extensions follow the # same naming convention as the WAVEFIT extensions... - wave2d_fits = [fitting.PypeItFit.from_hdu(hdu[e], chk_version=chk_version) + wave2d_fits = [fitting.PypeItFit() if len(hdu[e].data) == 0 + else fitting.PypeItFit.from_hdu(hdu[e], chk_version=chk_version) for e in ext if 'WAVE2DFIT' in e] if len(wave2d_fits) > 0: d['wv_fit2d'] = np.asarray(wave2d_fits)