thespacedoctor / soxspipe

The pipeline for the SOXS instrument
GNU General Public License v3.0
3 stars 0 forks source link

Rethink generation of 2D wavelength, slit-position, order maps from full dispersion solution #147

Closed thespacedoctor closed 2 years ago

thespacedoctor commented 2 years ago

This task is by far the most CPU-intensive and slowest section of the pipeline reduction cascade. 2 ideas to speed up the (currently brute force iteration) the code:

  1. Fit 2 bspline surfaces (wavelength and slit-position) seeded with a grid of wavelength and slit-position. This could allow interpolating of wavelength/slit-position to the centre of each detector pixel.
  2. When fitting the full dispersion solution (x and y as functions of wavelength, slit-position and order) also then fit the opposite (wavelength and slit-position as functions of x and y and order).

Solution 1 might be a quick win, so trying this first.

thespacedoctor commented 2 years ago

bspline surfaces

thespacedoctor commented 2 years ago

In the end I switched from a bspline surface fit to nearest-neighbour (cubic spline) interpolation seeded with a grid of wavelength and slit-position.

The 2D wavelength/slit-position/order image maps are now generated 6-8 times faster (10-12 mins down to ~90sec) and are 100 times more accurate.