Skip to content

Add background / gradient subtraction for spectroscopic profiles

Adrian Knagg-Baugh requested to merge cut_dark into master

I've removed the Draft status: the code is ready for review now but I still have a little work to do to update the documentation MR with new images of the UI and a bit more explanation.

Description

A small merge request to add the ability to do background /gradient subtraction when reducing spectra.

Changes Made

The options available in the profile dialog change depending on whether spectrographic data is set in the spectro dialog. In order to use this, after selecting the spectrographic data (marked points, wavelengths / wavenumbers and averaging width) select spectro (w/ bg removal). The outside profile lines will be used for background subtraction: they can be shifted to a reasonably clear bit of sky using the offset parameter, but it doesn't matter if a few stars are on the background lines as the actual background level to be subtracted is computed from the raw data using a libgsl polynomial fit in conjunction with the RANSAC technique to ensure a fit that is robust to outliers.

Related Issues

Based on discussion with Robin Leadbeater and others on Cloudy Nights around what is essential for spectrographic reduction software. This is the last of the "essential" items I want to include for 1.4; there is more to do in the following development cycle to make Siril a potential competitor to ISIS and such programs.

Additional Notes

  • The GUI is a bit rough: I don't want it to grow much as it is visible when dragging the profile line and therefore competes for screen space with the image, but it could perhaps use a little polish to make it feel more intuitive. Updated
  • Is linear fitting enough for background removal? The algorithm needs to be very resilient to outliers but if the spectrum extends over a substantial part of the image perhaps there is something more sophisticated required? Moved to a polynomial fit in place of the previously used robust_linear_fit().

Merge Request Checklists

  • Code follows project coding guidelines and its checklist
  • I have submitted a MR in the documentation repository if required
  • I have updated Changelog and NEWS, listing the related issues.
  • If my MR introduces new dependencies, I have run all the CIs, even the optional (manual) jobs. N/A
Edited by Adrian Knagg-Baugh

Merge request reports