Open dhomeier opened 4 years ago
We're discussing ways to make the uncertainty creation easier, but currently, you should be initializing the Spectrum1D
with an explicit uncertainty class in order for everything to Just Work™️
from astropy.nddata import StdDevUncertainty
input_spectrum = Spectrum1D(flux=[1, 3, 7, 6, 20] * u.mJy,
spectral_axis=[2, 4, 12, 16, 20] * u.nm,
uncertainty=StdDevUncertainty([0.4, 0.5, 0.6, 0.8, 1]))
resample_grid = [1, 5, 9, 13, 14, 17, 21, 22, 23] * u.nm
fluxc_resample = LinearInterpolatedResampler()
We're discussing ways to make the uncertainty creation easier, but currently, you should be initializing the
Spectrum1D
with an explicit uncertainty class in order for everything to Just Work™️
Yes, was just wondering if incorrect instantiation should be intercepted earlier – e.g. adding an additional check for uncertainty_type
to
if hasattr(self, 'uncertainty') and self.uncertainty is not None:
...
But an optional keyword like uncertainty_type='std'
would be convenient, too.
Indeed. See #529 for some early discussion. Most recent discussion has happened out-of-band.
I was also unable to write out a spectrum with an uncertainty of UnknownUncertainty
type.
When (unsuccessfully) trying to reproduce #647 I raised a different exception by modifying the docs' example:
Is there other functionality that would handle an
astropy.nddata.nduncertainty.UnknownUncertainty
correctly, or should this best be checked on initialisingSpectrum1D
?