Skip to content

Commit 1f6eded

Browse files
authored
Merge pull request #839 from rosteen/fix-failing-loaders
Fix loader failures in remote data test
2 parents 6dd54ad + ac6564e commit 1f6eded

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

specutils/io/default_loaders/apogee.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,7 @@ def apStar_loader(file_obj, **kwargs):
146146
return Spectrum1D(data=data * unit,
147147
uncertainty=uncertainty,
148148
spectral_axis=dispersion * dispersion_unit,
149-
meta=meta,
150-
wcs=wcs)
149+
meta=meta)
151150

152151

153152
@data_loader(label="APOGEE aspcapStar", identifier=aspcapStar_identify, extensions=['fits'])

specutils/spectra/spectrum1d.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,11 +191,13 @@ def __init__(self, flux=None, spectral_axis=None, wcs=None,
191191
temp_axes = []
192192
phys_axes = wcs.world_axis_physical_types
193193
for i in range(len(phys_axes)):
194+
if phys_axes[i] is None:
195+
continue
194196
if phys_axes[i][0:2] == "em":
195197
temp_axes.append(i)
196198
if len(temp_axes) != 1:
197-
raise ValueError("Input WCS must have exactly one axis"
198-
" with spectral units")
199+
raise ValueError("Input WCS must have exactly one axis with "
200+
"spectral units, found {}".format(len(temp_axes)))
199201

200202
# Due to FITS conventions, a WCS with spectral axis first corresponds
201203
# to a flux array with spectral axis last.

0 commit comments

Comments
 (0)