-
-
Notifications
You must be signed in to change notification settings - Fork 130
Description
#600 adds an example of spectral shifting by creating a new Spectrum1D
object. As it stands this makes sense, but the method shown there has the flow that it requires the user to specify everything the want to copy over manually. So if e.g. there's an uncertainty
, or a meta
or a mask
, the user has to remember to include them by hand.
Instead, I think it would be better if this worked:
>>> original_spectrum = ...
>>> shifted_spectrum = Spectrum1D(original_spectrum, spectral_axis=original_spectrum + shift)
i.e., the Spectrum1D(spec, ...something else..)
construct would be understood to copy everything in spec
except anything explicitly overridden in something else
.
Right now Spectrum1D(original_spectrum, spectral_axis=original_spectrum + shift)
works, but silently fails to update the spectral_axis
. So I think this may just be a bug that needs fixing... but once it's fixed the example in #600 should be updated to reflect this idiom instead of explicitly copying the spectral axis.