Skip to content

2D wavelength calibration - #325

Open
hpparvi wants to merge 6 commits into
astropy:mainfrom
hpparvi:v110_wavesol2d
Open

hpparvi wants to merge 6 commits into
astropy:mainfrom
hpparvi:v110_wavesol2d

Conversation

@hpparvi

@hpparvi hpparvi commented Sep 29, 2026

Copy link
Copy Markdown
Contributor

This PR adds

  • WavelengthSolution2D class for 2D wavelength calibration
  • WavelengthSolution1D.from_gwcs method to create a 1D wavelength solution from an exported one, and
  • TiltSolution.to_asdf and TiltSolution.from_asdf methods to serialise 2D tilt solutions.

The 2D wavelength solution is created by chaining a 2D tilt solution and a 1D wavelength solution, and provides method to map between the pixel and wavelength space (both directions), to serialise the mapping to ASDF, and to resample 2D frames losslessly.

AI/LLM Disclaimer: The same as in #319. I've used Claude Code with Fable 5.1 to co-develop the PR, but I understand what the code does and how it works, and can explain it when needed.

- Added the tests for these methods.
…s constructed by combining a tilt solution and 1D wavelength solution.

- Revised the changelog and docs.
…by the pixel wavelength width, which made the output off by the local dispersion and broke flux conservation. The output is now a bin-averaged flux density with the bin edges stored on the spectral axis.

- Changed WavelengthSolution2D.resample to support decreasing dispersion, copy the input metadata, return no uncertainty when the input has none, and reject nbins=0.
@codecov

codecov Bot commented Sep 29, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.15%. Comparing base (742264f) to head (198e6f4).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #325      +/-   ##
==========================================
+ Coverage   92.52%   93.15%   +0.63%     
==========================================
  Files          18       19       +1     
  Lines        2341     2558     +217     
==========================================
+ Hits         2166     2383     +217     
  Misses        175      175              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant