astropy / specreduce

Tools for the reduction of spectroscopic observations from Optical and NIR instruments
https://specreduce.readthedocs.io
62 stars 38 forks source link

Rectify 2D spectrum #170

Open PatrickOgle opened 1 year ago

PatrickOgle commented 1 year ago

Use spectral trace object to rectify a 2D spectrum by shift-interpolating columns in the spatial direction. This doesn't require a wavelength solution. This simplest case assumes no mixing of spatial and spectral dimensions.

PatrickOgle commented 1 year ago

This works well, and could form the basis of the algorithm: center = trace_r.guess spec2d_rectified = 1.0 *spec2d for col in range(ncols): shift = center - trace_r[col] shifted_col = ndimage.interpolation.shift(spec2d[:,col], shift, order=2) spec2d_rectified[:,col] = shifted_col