Added SequentialSystem.vignetting(), a method to fit a polynomial vignetting model#184
Merged
Conversation
…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
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Lm9SxSpyNg9hx8dNL9pUXc
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #184 +/- ##
=======================================
Coverage 99.37% 99.37%
=======================================
Files 116 116
Lines 6230 6257 +27
=======================================
+ Hits 6191 6218 +27
Misses 39 39
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Pass where to PolynomialVignettingModel so that field points with no unvignetted rays are excluded from the polynomial fit, and compute the unity normalization from the average over only the included points. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Lm9SxSpyNg9hx8dNL9pUXc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replaces #183, which GitHub closed when its base branch (
feature/system-distortion, #181) was squash-merged and deleted; the branch is rebased ontomainso only the vignetting commits remain.Summary
AbstractSequentialSystem.vignetting(), the vignetting counterpart ofdistortion(): the relative illumination at each scene coordinate is estimated from the fraction of unvignetted rays in the pupil, normalized so that its average over the field of view is unity, and fit with anoptika.radiometry.PolynomialVignettingModel.distortion(): customwavelength/field/pupilgrids (traced withrayfunction(), so grids left asNoneinherit the corresponding component ofgrid_input),normalized_field/normalized_pupilflags, polynomialdegree, and a clearValueErrorwhen the wavelength grid has no logical axis._rayfunction_and_axes()helper instead of duplicating ~30 lines.Tests
test_vignettingmirrorstest_distortion: parametrized over both grid sources and two polynomial degrees, asserting the model type, degree, the scalar-wavelength error branch, non-negative illumination, and that the illumination averages to unity over the field axes.pytest optika/systems/_sequential_test.py -k "test_vignetting or test_distortion": 48 passed;black --checkandruff checkclean.🤖 Generated with Claude Code
https://claude.ai/code/session_01Lm9SxSpyNg9hx8dNL9pUXc