Add photons_absorbed, the inverse of the sensor signal/expose - #191
Merged
Conversation
Add `photons_absorbed` to the sensor materials and to `ImagingSensor`, mapping measured electrons back into the number of absorbed photons. For the materials this inverts the noiseless `signal` (which uses unit absorbance, since absorbance is folded into the effective area) and so depends only on the quantum yield and the charge collection efficiency, not the absorbance. `IdealSensorMaterial` and the silicon materials each supply a concrete implementation, and a new `test_photons_absorbed` checks that it recovers the photons passed through `signal`. `ImagingSensor.photons_absorbed` mirrors `expose`: it inverts the material response and divides by the exposure time, giving the incident photon rate. This provides the detector-response inverse needed to make `LinearSystem.image`/`backproject` a matched pair. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CtdKmedevWkDab6BWupXqQ
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #191 +/- ##
=======================================
Coverage 99.54% 99.54%
=======================================
Files 116 116
Lines 6374 6414 +40
=======================================
+ Hits 6345 6385 +40
Misses 29 29
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:
|
Add a roundtrip test covering `ImagingSensor.photons_absorbed`, which was otherwise unexercised, restoring patch coverage on the PR. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CtdKmedevWkDab6BWupXqQ
Use the sensor's own exposure time (via `dataclasses.replace`) instead of passing `timedelta` explicitly, so the default branch of `ImagingSensor.photons_absorbed` is exercised for patch coverage. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CtdKmedevWkDab6BWupXqQ
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.
Adds
photons_absorbedto the sensor materials and toImagingSensor, mapping measured electrons back into the number of absorbed photons.Materials
AbstractSensorMaterial.photons_absorbed(electrons, wavelength, direction=1)inverts the noiselesssignal. Because the sensor absorbance is folded into the effective area,signalruns at unit absorbance, so the inverse depends only on the quantum yield and the charge collection efficiency, not the absorbance (it isphotons_absorbed, notphotons_incident).IdealSensorMaterialand the silicon materials each supply a concrete implementation.A new
test_photons_absorbedchecks that it exactly recovers the photons passed throughsignalat unit absorbance, for both ideal and silicon materials and for normal/oblique incidence.Sensor
ImagingSensor.photons_absorbedmirrorsexpose: it inverts the material response and divides by the exposure time, giving the incident photon rate.Why
This is the detector-response inverse needed to make
optika.systems.LinearSystem.image/backprojecta matched forward/transpose pair (that wiring lives in the interpolated-system branch, #152).🤖 Generated with Claude Code