Skip to content

Commit

Permalink
Drop _to_spectrum1d_pixels to allow other axes
Browse files Browse the repository at this point in the history
  • Loading branch information
ojustino committed Nov 15, 2022
1 parent d3f6545 commit c5a99b5
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions specreduce/extract.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,12 +117,6 @@ def _ap_weight_image(trace, width, disp_axis, crossdisp_axis, image_shape):
return wimage


def _to_spectrum1d_pixels(fluxes):
# TODO: add wavelength units, uncertainty and mask to spectrum1D object
return Spectrum1D(spectral_axis=np.arange(len(fluxes)) * u.pixel,
flux=fluxes)


@dataclass
class BoxcarExtract(SpecreduceOperation):
"""
Expand Down Expand Up @@ -515,7 +509,8 @@ def __call__(self, image=None, trace_object=None,
extraction = result * norms

# convert the extraction to a Spectrum1D object
return _to_spectrum1d_pixels(extraction * unit)
return Spectrum1D(extraction * unit,
spectral_axis=self.image.spectral_axis)


@dataclass
Expand Down

0 comments on commit c5a99b5

Please sign in to comment.