Repository navigation
v2.9.0
The thin-grating efficiencies were wrong in two of five profiles (#237)
Checking optika.rulings against Table 1 of Magnusson and Gaylord (1978),
which every profile's docstring cites, turned up two formula errors and two
numerical ones. Square and rectangular rulings were correct.
SinusoidalRulings.efficiencyreturned the Bessel function itself where
the paper and its own docstring give the square. For a 2200 lines/mm
grating with a 42 nm sinusoid at 121 to 185 nm, that was 0.55 to 0.58 in
first order where the squared formula gives 0.30 to 0.34, and a rigorous
C-method simulation of that grating by its manufacturer gives 0.30 to
0.33 once the coating is divided out.TriangularRulings.efficiencyadded the square of the order to its
denominator where the paper subtracts it. As written, the efficiency
summed over all orders was 0.2 to 0.9 rather than one.- The sawtooth and triangular formulas are 0 / 0 when the profile is a
whole number of waves deep, and returned NaN there and lost precision
nearby. Both are rewritten as squared sinc functions, which are the same
formulas with the singularity removed analytically.
The efficiencies now have the obliquity of a relief grating (#238)
Magnusson and Gaylord analyze a volume phase grating, a slab whose index
is modulated sideways, so their normalized amplitude carries a 1 / cos θ
from the longer path an oblique ray takes through the slab. The rulings
here are a relief on a surface, and every one sits on a mirror. Under the
Kirchhoff approximation the phase a ray picks up from a relief of height h
between media n₁ and n₂ is the path difference across the profile,
h (n₁ cos α − n₂ cos β), and a reflection grating is the case n₂ = −n₁,
which falls with obliquity rather than rising.
This changes results at oblique incidence for every user of these
classes, which is why this is a minor release. In the thin-grating limit
the change is the swap of 1 / cos θ for cos θ. At 14 degrees the phase
moves by 5 percent; at 45 degrees by a factor of 2.8; at grazing incidence
the old form diverged where the physical one goes to zero. Gratings used
within a few degrees of normal change by well under a percent.
- One shared helper computes γ from that factor, with the diffraction
angle of each order taken fromincident_effective, so the factor is
per order and evanescent orders get zero efficiency instead of NaN. A
consequence is that normal incidence is no longer bit-identical to
before, since a diffracted order still leaves at an angle. efficiencygains two optional arguments,index_refraction_newand
is_mirror, whose defaults reproduce reflection in the ray's own
medium.Surface.propagate_rayspasses them from its material, along
with the true incident rays rather than the effective ones it builds for
Snell's law, so the same helper now handles transmission relief
gratings, whose modulation is the index contrast across the profile.- Reciprocity holds: sending the diffracted light back along its path
gives the same efficiency, for every profile.
The entrance-pupil fit sees the field's uncertainty (#239)
The per-field entrance-pupil fit flattened its inputs with na.nominal
because the polynomial fit could not take uncertain inputs. named-arrays
2.10 gives uncertain matrices an inverse, so the pin is bumped to
named-arrays~=2.10 and the fit is made against the field as it is. On a
Newtonian test system with a 5 percent uncertain field stop, the residual
over the distribution drops from 6.4e-2 mm to 5.5e-8 mm.