From c5a99b56d2e86cf99cefbc64a2048295ba24e9b2 Mon Sep 17 00:00:00 2001 From: ojustino Date: Tue, 15 Nov 2022 00:02:00 -0500 Subject: [PATCH] Drop _to_spectrum1d_pixels to allow other axes --- specreduce/extract.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/specreduce/extract.py b/specreduce/extract.py index a3b1cf88..a4bd9a9c 100644 --- a/specreduce/extract.py +++ b/specreduce/extract.py @@ -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): """ @@ -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