Repository: OttoStruve/muler (language: python)

Issue:
(upstream) Equivalent width fails for new version 1.4.1 of specutils
Failure as revealed in the new pip-install daily testing! Success for that idea.


Discussion / hints:

Fix patch:
diff --git a/src/muler/nirspec.py b/src/muler/nirspec.py
index aab78ff..037b1f5 100644
--- a/src/muler/nirspec.py
+++ b/src/muler/nirspec.py
@@ -91,9 +91,7 @@ def __init__(self, *args, file=None, order=63, **kwargs):
             if os.path.exists(fits_with_full_header):
                 hdu_hdr = fits.open(fits_with_full_header)
                 hdr = hdu_hdr[0].header
-                wcs = WCS(hdr)
             else:
-                wcs = None
                 hdr = None
 
             meta_dict = {
@@ -107,7 +105,7 @@ def __init__(self, *args, file=None, order=63, **kwargs):
                 spectral_axis=lamb,
                 flux=flux,
                 mask=mask,
-                wcs=wcs,
+                wcs=None,
                 uncertainty=uncertainty,
                 meta=meta_dict,
                 **kwargs,


Test patch:
diff --git a/tests/test_nirspec.py b/tests/test_nirspec.py
index b249edc..4dabb36 100644
--- a/tests/test_nirspec.py
+++ b/tests/test_nirspec.py
@@ -49,8 +49,8 @@ def test_basic():
 def test_equivalent_width():
     """Can we measure equivalent widths?"""
 
-    spec = KeckNIRSPECSpectrum(file=file)
-    mu = np.median(spec.wavelength.value)
+    spec = KeckNIRSPECSpectrum(file=file).remove_nans().trim_edges()
+    mu = np.nanmedian(spec.wavelength.value)
     equivalent_width = spec.measure_ew(mu)
 
     assert equivalent_width is not None