Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SpecreduceOperation has a method to coerce everything to Spectrum1D which does not make sense for some operations #195

Open
eteq opened this issue Nov 22, 2023 · 0 comments

Comments

@eteq
Copy link
Member

eteq commented Nov 22, 2023

The SpecreduceOperation class has as its superclass _ImageParser. That seems to do nothing other than offering a _parse_image method, which notable coerces Everything into a Spectrum1D object (

return Spectrum1D(img * unit, spectral_axis=spectral_axis,
uncertainty=uncertainty, mask=mask)
).

In a spectroscopic workshop last week, several people were confused by this given that most of the operations illustrated here: #71 do not take in an image and output a spectrum1D. Many instead take in or output spectrumcollection, or take in spectrum1d, etc.

It's actually unclear to me why this class even exists. It seems to do a very specific parsing operation that's used a couple different places but very confusingly - e.g. an "image" is converted into a spectrum1D but then set to be an image, whereas an image really should be an image class (i.e., a CCDImage) unless it has a meaningful wavelength solution.

It's possible this is all just an oversight, as that particular code hasn't been touched in like a year or more even as other things were implemented. It might be the straightforward fix is to remove the subclass and instead implement this as some kind of utility function? Or maybe it should just be removed entirely and the one or two blocks that use it be re-imagined to use images directly?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant