Skip to content

Add beam-footprint utilities and PSF metrics for the wavefield path#174

Open
jacobdparker wants to merge 2 commits into
feature/wavefieldsfrom
feature/wavefield-footprint
Open

Add beam-footprint utilities and PSF metrics for the wavefield path#174
jacobdparker wants to merge 2 commits into
feature/wavefieldsfrom
feature/wavefield-footprint

Conversation

@jacobdparker

Copy link
Copy Markdown
Contributor

Summary

Stacked on #173. Promotes the patterns proven while modeling ESIS into general utilities, so a physical-optics model of a real (multi-channel, obscured) instrument is a few lines instead of a page:

  • SequentialSystem.footprint(surface, ...): positions where a dense pupil grid of rays traced through the entire system (all masks active) intersects a given surface, in local surface coordinates, plus the mask of rays that reach the sensor - i.e. the used portion of each optic. Useful for geometric work independently of wavefields.
  • optika.apertures.footprint_aperture(position, where): a PolygonalAperture from the convex hull of a footprint - the constructor for an effective channel pupil (e.g. the sector of the ESIS primary delimited by the obscuration hub, the octagon edge, and the projected grating trapezoid).
  • wavefield(bound="footprint", padding_relative=..., padding_absolute=...): automatic per-surface sampling regions from the beam footprint. The absolute padding floor handles intermediate-focus surfaces, where the geometric footprint collapses to a point but the diffraction pattern needs a finite window.
  • PSF metrics (optika.wavefields.encircled_energy_radius, ensquared_energy, fwhm): image-quality numbers that were previously recomputed by hand for every analysis; ensquared_energy is the natural pixel-limited criterion. Validated against an analytic Gaussian, including broadcasting over extra axes.
  • A jupyter-execute example on SequentialSystem.psf (footprint-bounded Huygens PSF of a parabolic telescope).
  • scipy promoted from transitive to explicit dependency (scipy.spatial.ConvexHull).

Validation

Reproducing the hand-built ESIS f1 channel model through this API (footprint + footprint_aperture + bound="footprint" with padding_absolute=50 um) matches the reference results: image centroid within 0.13 um of the geometric raytrace and EE50 = 3.97 um vs the 3.98 um reference.

🤖 Generated with Claude Code

@codecov

codecov Bot commented Jun 11, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.68%. Comparing base (fbddae6) to head (a020bd1).

Additional details and impacted files
@@                  Coverage Diff                   @@
##           feature/wavefields     #174      +/-   ##
======================================================
+ Coverage               98.64%   98.68%   +0.04%     
======================================================
  Files                     127      129       +2     
  Lines                    6878     7094     +216     
======================================================
+ Hits                     6785     7001     +216     
  Misses                     93       93              
Flag Coverage Δ
unittests 98.68% <100.00%> (+0.04%) ⬆️

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.

@jacobdparker jacobdparker force-pushed the feature/wavefield-footprint branch from 79bcb98 to 3010b30 Compare June 15, 2026 17:58
- SequentialSystem.footprint(): the positions where a dense grid of rays
  traced through the entire system intersects a given surface, in local
  surface coordinates, with a mask selecting rays that reach the sensor.
- optika.apertures.footprint_aperture(): a PolygonalAperture from the
  convex hull of a footprint, for building the effective pupil of one
  channel of a multi-channel instrument.
- SequentialSystem.wavefield(bound="footprint"): automatic per-surface
  sampling regions from the beam footprint, padded by a relative fraction
  and an absolute minimum (which handles intermediate-focus surfaces).
- optika.wavefields.encircled_energy_radius / ensquared_energy / fwhm:
  image-quality metrics of sampled point-spread functions, validated
  against an analytic Gaussian.
- jupyter-execute example on SequentialSystem.psf demonstrating the
  footprint-bounded Huygens PSF of a parabolic telescope.

Validated end-to-end on the ESIS flight-1 design: the channel pupil built
from footprint() + footprint_aperture() with bound="footprint" matches
the geometric image centroid to ~0.1 um and reproduces the expected
diffraction-limited EE50.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@jacobdparker jacobdparker force-pushed the feature/wavefield-footprint branch from 3010b30 to e42c338 Compare July 2, 2026 23:31
…tures

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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