[AstroPy] Recovering and interpolating contents of a Spectrum1D spectrum

Peter Dzwig pdzwig at summaventures.com
Mon Jun 15 12:16:04 EDT 2020


All,

It turns out that  I was running Specutils 0.5, which FWIW, is what
shipped with Ubuntu 19.10 which is what I run. Watch out for that!!

{Python is 3.6.9]

I ran

>>>pip install --upgrade specutils

and got astropy 4.0.1-post1, specutils-1.0 and upgrades to asdf, gwcs
as part of the upgrade.

The demos on the specutils site for resampling now run fine.

I am posting this in case anyone else runs into similar problems!

Peter

PS Just in passing it may be that the upgrade to gwcs may have some
bearing on issues I saw people experiencing on GitHub when looking for
solutions last week to my problem.

On 15/06/2020 15:09, Derek Homeier wrote:
> On 14 Jun 2020, at 3:52 pm, Peter Dzwig <pdzwig at summaventures.com> wrote:
>>
>> ImportError                               Traceback (most recent call last)
>> <ipython-input-3-a44cc2071722> in <module>
>>      2 import astropy.units as u
>>      3 from specutils import Spectrum1D
>> ----> 4 from specutils.manipulation import FluxConservingResampler
>>      5 input_spectra = Spectrum1D(
>>      6     flux=np.array([1, 3, 7, 6, 20]) * u.mJy,
>>
>> ImportError: cannot import name 'FluxConservingResampler'
>>
>>
>> similarly for the other resamplers: SplineInterpolatedResampler and
>> LinearInterpolatedResampler.
>>
>> Is there a specutils issue?
> 
> Hmm, the error indicates there exist no such classes in specutils.manipulation.
> What is your installed version of specutils? Some of the functionality has been
> evolving fairly rapidly, but the manipulation utilities have been in at least since
> v0.6 as far as I can see.
> 
> Cheers,
> 					Derek
> 

-- 

Dr. Peter Dzwig


More information about the AstroPy mailing list