Skip to content

Commit c5a99b5

Browse files
committed
Drop _to_spectrum1d_pixels to allow other axes
1 parent d3f6545 commit c5a99b5

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

specreduce/extract.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -117,12 +117,6 @@ def _ap_weight_image(trace, width, disp_axis, crossdisp_axis, image_shape):
117117
return wimage
118118

119119

120-
def _to_spectrum1d_pixels(fluxes):
121-
# TODO: add wavelength units, uncertainty and mask to spectrum1D object
122-
return Spectrum1D(spectral_axis=np.arange(len(fluxes)) * u.pixel,
123-
flux=fluxes)
124-
125-
126120
@dataclass
127121
class BoxcarExtract(SpecreduceOperation):
128122
"""
@@ -515,7 +509,8 @@ def __call__(self, image=None, trace_object=None,
515509
extraction = result * norms
516510

517511
# convert the extraction to a Spectrum1D object
518-
return _to_spectrum1d_pixels(extraction * unit)
512+
return Spectrum1D(extraction * unit,
513+
spectral_axis=self.image.spectral_axis)
519514

520515

521516
@dataclass

0 commit comments

Comments
 (0)