Skip to content

Added SequentialSystem.vignetting(), a method to fit a polynomial vignetting model#183

Closed
roytsmart wants to merge 2 commits into
feature/system-distortionfrom
feature/system-vignetting
Closed

Added SequentialSystem.vignetting(), a method to fit a polynomial vignetting model#183
roytsmart wants to merge 2 commits into
feature/system-distortionfrom
feature/system-vignetting

Conversation

@roytsmart

Copy link
Copy Markdown
Collaborator

Stacked on #181 (targets feature/system-distortion; will retarget to main when that merges).

Summary

  • Add AbstractSequentialSystem.vignetting(), the vignetting counterpart of distortion(): the relative illumination at each scene coordinate is estimated from the fraction of unvignetted rays in the pupil, normalized to its maximum over the field of view, and fit with an optika.radiometry.PolynomialVignettingModel.
  • Same interface as distortion(): custom wavelength/field/pupil grids (traced with rayfunction(), so grids left as None inherit the corresponding component of grid_input), normalized_field/normalized_pupil flags, polynomial degree, and a clear ValueError when the wavelength grid has no logical axis.
  • The grid resolution and axis normalization shared between the two methods is factored into a private _rayfunction_and_axes() helper instead of duplicating ~30 lines.

Tests

test_vignetting mirrors test_distortion: parametrized over both grid sources and two polynomial degrees, asserting the model type, degree, the scalar-wavelength error branch, and that the fitted illumination calibration points lie in [0, 1].

pytest optika/systems/_sequential_test.py: 312 passed; black --check and ruff check clean.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Lm9SxSpyNg9hx8dNL9pUXc

…tting model

The relative illumination at each scene coordinate is estimated from
the fraction of unvignetted rays in the pupil, normalized to its
maximum over the field of view, and fit with a
PolynomialVignettingModel.

The grid resolution and axis normalization shared with distortion() is
factored into a private helper, _rayfunction_and_axes().

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Lm9SxSpyNg9hx8dNL9pUXc
@codecov

codecov Bot commented Jul 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.37%. Comparing base (c6a1b77) to head (7c291c8).

Additional details and impacted files
@@                      Coverage Diff                      @@
##           feature/system-distortion     #183      +/-   ##
=============================================================
- Coverage                      99.37%   99.37%   -0.01%     
=============================================================
  Files                            116      116              
  Lines                           6230     6204      -26     
=============================================================
- Hits                            6191     6165      -26     
  Misses                            39       39              
Flag Coverage Δ
unittests 99.37% <100.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ 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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant