astropy / specreduce

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

allow matched pixels/wavelengths to be in either direction #177

Closed cshanahan1 closed 1 year ago

cshanahan1 commented 1 year ago

This PR removes sorting in wavelength calibration to allow for either right-to-left or left-to-right inputs. A check that input matched pixels/wavelengths are monotonic in either direction is added.

Addresses #174

codecov[bot] commented 1 year ago

Codecov Report

Merging #177 (b6c792f) into main (014f37b) will increase coverage by 0.06%. The diff coverage is 85.71%.

@@            Coverage Diff             @@
##             main     #177      +/-   ##
==========================================
+ Coverage   81.28%   81.35%   +0.06%     
==========================================
  Files          10       10              
  Lines         983      992       +9     
==========================================
+ Hits          799      807       +8     
- Misses        184      185       +1     
Impacted Files Coverage Δ
specreduce/wavelength_calibration.py 87.39% <85.71%> (+0.12%) :arrow_up:

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

kecnry commented 1 year ago

Can we remove the internal sorting with this check in place? Is there anything fundamental in the logic that would prevent us from handling the inverted case (besides the internal sorting - if the check was instead to make sure that they either increase or decrease, would that work)?

cshanahan1 commented 1 year ago

thanks everyone, im going to merge this now :)