Repository navigation
Feature: detector field of astigmatic beamlets as a 3D vector, Poynthing flux definition - #161
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #161 +/- ##
==========================================
- Coverage 90.26% 90.25% -0.01%
==========================================
Files 82 85 +3
Lines 4632 4587 -45
==========================================
- Hits 4181 4140 -41
+ Misses 451 447 -4 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Ich hab eine generelle Anmerkung zu den verschiedenen Ansätzen zu den Projektionsfaktoren. Ich würde gerne eine einheitliche Lösung haben, wäre dann eine Frage welche Definition am sinnvollsten ist. Soll ich ein seperate issue anlegen? Am liebsten wäre mir: Projection factorsSide note, not blocking for this PR: with this change the astigmatic beamlets use the same vector sum as
The The ray fields are raw/unscaled, so this affects no absolute power. At high NA, though, the scalar and the polarized PSF of the same system weight the marginal rays differently (cos² θ vs. 1). Part of the difference between the two PSFs is then this weighting, not the vector effect. |
|
Yes, a separate issue makes sense. I'd split your proposal into two independent questions, though: 1. Return type. Agreed: vector field for polarized hit types ( 2. Projection. I wouldn't tie it to polarization. The projection describes flux through a tilted surface and has nothing to do with polarization. With your proposal, an AGB on a detector tilted by 45° would give My proposal for one definition:
3. Ray hits are a separate problem. For them the "projection factor" stands in for a missing quadrature weight: rays are samples, not fields. For an aplanatic system with uniformly sampled pupil and equal power per ray, Richards–Wolf gives a per-ray amplitude weight ∝ |
|
A follow up my Opus 5.5, how it would tackle 2. and 3.: Sketches for 2 and 3 below. They are independent; I'd do 2 first, since it fixes the beamlets, and 3 then only changes the per-hit amplitudes. 2: the detector reads the normal Poynting flux
# vector hits (PolarizedRayHit, AstigmaticGaussianBeamletHit)
E += E_j # unprojected, returned by electric_field
H += n_j / Z_vacuum * (s_j × E_j)
# readout: S_n = ½ Re((E × conj(H)) ⋅ n̂)
# scalar hits (RayHit, GaussianBeamletHit)
E += E_j
F += n_j / Z_vacuum * (s_j ⋅ n̂) * E_j
# readout: S_n = ½ Re(conj(E) * F)
3: ray hits as quadrature points of the Debye integralIn the focal region the field is the Debye–Wolf integral over the directions of the converging wave, For vector hits, What a hit needs in addition:
Validity, for the docstring: focal region only (Fresnel number ≫ 1); it fails where the mapping from pupil to direction folds ( Checked numerically (standalone script; ideal aplanatic rays on a polar pupil lattice,
|
|
Return types skalar/vektoriell ist keine debatte, und wo man den projektions-faktor anwendet ist auch nur eine frage der API. Aber da die funktion ist im wesentlichen was dein klanker auch sagt. alles was danach kommt schießt über meine eigentlich frage hinaus |
`electric_field(pd)` added the scalar fields of AstigmaticGaussianBeamlet
hits, `E_ref_amp · ψ`, where the reference amplitude has the phase of the
largest component of the polarization. This summed the polarization out:
- orthogonally polarized beamlets interfered: an x and a z polarized
beamlet on top of each other gave 4 times the power of one instead
of 2, wrong for any polarization interferometry
- for a circular polarization, two components are equally large and
rounding decides the reference: hits that chose differently added
with a 90° phase error, e.g. a coherent cone source with circular E0
carried 0.866 of the power with linear E0 (502 hits referred to x,
498 to z)
The field is now added as 3D vectors, Σ beamlet_hit_field(hit, p) ·
beamlet_hit_polarization(hit), as for PolarizedRay hits and as the
OpticsBase extension already does; the reference phase cancels.
`electric_field(pd)` returns a `Matrix{Point3{Complex}}` for these hits;
`intensity` and `optical_power` are unchanged in use.
Tests: equal, orthogonal and opposite polarizations of two beamlets,
the source with circular vs. linear E0; three tests that read the
scalar field take its dominant component or `sum(abs2, e)`.
Docs: electric_field, detectors page. Agent skill:
`components/detectors.md`, `API.md`.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…tector `electric_field(pd)` returns the coherent sum of the unprojected fields of the hits, and `intensity(pd)` the Poynting flux through the detector, ½ Re(E × H*)·n̂ with H = Σ (n/Z₀) s × E (scalar hits: ½ Re(E* F), F = Σ (n/Z₀) cos θ E). A single hit gives n|E|² cos θ / (2Z₀), so `optical_power` is the beam power for any angle of incidence, and hits under different angles interfere with the mean of their cos θ. Before, beamlets carried √cos θ on the amplitude, rays cos θ and polarized rays nothing. - `electric_field(hit, p)`: field of one hit, the only per-type method of a hit - `electric_field(pd, xs, zs)`, `intensity(pd, xs, zs)`: grids of one's own, all readouts share one sampling loop - `intensity(pd)` has no `Z` argument any more - `GaussianBeamletHit`: field divided by √n, the scalar model is √n too large in a medium; beamlet hits drop `sqrt_proj` - automatic window of beamlet hits grows with 1/cos θ of the footprint Tests: power on a detector tilted by 0–60° for both beamlet models, the unprojected field, cos θ irradiance of rays, crossing beams, grid methods. Docs: docstrings, detectors page, OpticsBase extension. Agent skill: `API.md`, `components/detectors.md`. Co-Authored-By: Claude Opus 5.5 <[email protected]>
b8f9d63 to
005f578
Compare
|
Summary of changes in spirit of 1+2:
Left-to-do:
|
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…t buffers Pure move, no code changes. Detectors/Detectors.jl holds the includes. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Also drops the unused argument name of spot_diagram(::Detector, ::Nothing). Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Hab die Detectors.jl Datei aufgesplittet, weil die mit 600+ Zeilen nicht mehr übersichtlich war |
The docstrings state the field of each hit type, the Poynting flux of the coherent sum through the detector and the integral of the power. The detectors page embeds them. intensity(E) of a field value is |E|^2/(2Z), not the irradiance on a detector. Co-Authored-By: Claude Opus 5.5 <[email protected]>
On a tilted detector in a medium, the phase ramp of ray hits was too flat by the factor n. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Docs sind geprüft, dabei noch ein kleiner bug für einen theoretischen case behoben (detektor in glas) |
Features
electric_field(pd, xs, zs),intensity(pd, xs, zs): field and intensity on a grid of one's ownBugfixes
electric_field(pd)returns complex 3-vectors for astigmatic beamlet hits, as for polarized raysintensity(pd)has noZargument; it is the Poynting flux through the detectoroptical_poweris the beam power for every beam type, field unprojectedGaussianBeamletHitfield was √n too large inside a mediumnin a mediumDoc changes
electric_field,intensity,optical_power: formulas per hit type, Poynting flux, power integralintensity(E)of a field value documented as|E|²/(2Z), not the detector irradianceAPI.md,components/detectors.mdupdatedInternal changes
Detector.jlsplit into abstract type, hits, detector and hit buffersCloses #159, closes #160