Skip to content

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

Open
@eteq

Description

@eteq

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions