Skip to content

WCS TypeError in EchelleSpectrum.from_fits #29

@cgehan

Description

@cgehan

Hi, I receive a TypeError: The wcs argument must implement either the high or low level WCS API when using aesop.EchelleSpectrum. How can I solve this issue? I join below the errors I obtain. Thank you in advance!

/usr/local/lib/python3.8/dist-packages/aesop-0.0.dev85-py3.8.egg/aesop/spectra.py in from_fits(cls, path)
329 """
330 spectrum_list = [Spectrum1D.from_specutils(s)
--> 331 for s in read_fits_spectrum1d(path)]
332 header = fits.getheader(path)
333

/usr/local/lib/python3.8/dist-packages/aesop-0.0.dev85-py3.8.egg/aesop/legacy_specutils/readspec.py in read_fits_spectrum1d(filename, dispersion_unit, flux_unit)
553 for spectrum_data, spectrum_wcs in zip(data, multi_wcs.values()):
554 multispec.append(
--> 555 Spectrum1D(spectrum_data, wcs=spectrum_wcs))
556 return multispec
557

/usr/local/lib/python3.8/dist-packages/aesop-0.0.dev85-py3.8.egg/aesop/legacy_specutils/spectrum1d.py in init(self, flux, wcs, unit, uncertainty, mask, meta, indexer, *args, **kwargs)
189 meta=None, indexer=None, *args, **kwargs):
190
--> 191 super(Spectrum1D, self).init(data=flux, unit=unit, wcs=wcs, uncertainty=uncertainty,
192 mask=mask, meta=meta, *args, **kwargs)
193

~/.local/lib/python3.8/site-packages/astropy/nddata/nddata.py in init(self, data, uncertainty, mask, wcs, meta, unit, copy)
229 if wcs is not None:
230 # Validate the wcs
--> 231 self.wcs = wcs
232 self.meta = meta # TODO: Make this call the setter sometime
233 self._unit = unit

/usr/local/lib/python3.8/dist-packages/aesop-0.0.dev85-py3.8.egg/aesop/legacy_specutils/spectrum1d.py in setattr(self, name, value)
246 self._wcs_attributes[name[:-5]]['unit'] = u.Unit(value)
247 else:
--> 248 super(Spectrum1D, self).setattr(name, value)
249
250 def dir(self):

~/.local/lib/python3.8/site-packages/astropy/nddata/nddata.py in wcs(self, wcs)
293 self._wcs = HighLevelWCSWrapper(wcs)
294 else:
--> 295 raise TypeError("The wcs argument must implement either the high or"
296 " low level WCS API.")
297

TypeError: The wcs argument must implement either the high or low level WCS API.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions