rayoptics.raytr.vigcalc module
Vignetting and clear aperture setting operations
- set_ape(opm)[source]
From existing fields and vignetting, calculate clear apertures.
This function modifies the max_aperture maintained by the list of
Interface
in theSequentialModel
. For each interface, the smallest aperture that will pass all of the (vignetted) boundary rays, for each field, is chosen.The change of the apertures is propagated to the
ElementModel
viasync_to_seq()
.
- set_pupil(opm)[source]
From existing stop size, calculate pupil spec and vignetting.
Use the upper Y marginal ray on-axis (field #0) and iterate until it goes through the edge of the stop surface. Use the object or image segments of this ray to update the pupil specification value e.g. EPD, NA or f/#.
- calc_vignetting_for_field(opm, fld, wvl, **kwargs)[source]
Calculate and set the vignetting parameters for fld.
- calc_vignetted_ray(opm, xy, start_dir, fld, wvl, max_iter_count=10)[source]
Find the limiting aperture and return the vignetting factor.
- Parameters:
opm –
OpticalModel
instancexy – 0 or 1 depending on x or y axis as the pupil direction
start_dir – the unit length starting pupil coordinates, e.g [1., 0.]. This establishes the radial direction of the ray iteration.
fld –
Field
point for wave aberration calculationwvl – wavelength of ray (nm)
max_iter_count – fail-safe limit on aperture search
- Returns:
(vig, last_indx, ray_pkg)
vig - vignetting factor
last_indx - the index of the limiting interface
ray_pkg - the vignetting-limited ray
- calc_vignetted_ray_by_bisection(opm, xy, start_dir, fld, wvl, max_iter_count=10)[source]
Find the limiting aperture and return the vignetting factor.
- Parameters:
opm –
OpticalModel
instancexy – 0 or 1 depending on x or y axis as the pupil direction
start_dir – the unit length starting pupil coordinates, e.g [1., 0.]. This establishes the radial direction of the ray iteration.
fld –
Field
point for wave aberration calculationwvl – wavelength of ray (nm)
max_iter_count – fail-safe limit on aperture search
- Returns:
(vig, last_indx, ray_pkg)
vig - vignetting factor
last_indx - the index of the limiting interface
ray_pkg - the vignetting-limited ray
- iterate_pupil_ray(opt_model, indx, xy, start_r0, r_target, fld, wvl, **kwargs)[source]
iterates a ray to r_target on interface indx, returns aim points on the paraxial entrance pupil plane
If indx is None, i.e. a floating stop surface, returns r_target.
If the iteration fails, a
TraceError
will be raised- Parameters:
opm –
OpticalModel
instanceindx – index of interface whose edge is the iteration target
xy – 0 or 1 depending on x or y axis as the pupil direction
start_r0 – iteration starting point
r_target – clear aperture radius that is the iteration target.
fld –
Field
point for wave aberration calculationwvl – wavelength of ray (nm)
- Returns:
pupil coordinates for ray thru r_target on ifc indx.
- Return type:
start_coords