rayoptics.seq.sequential module
Manager class for a sequential optical model
- class SequentialModel(opt_model, do_init=True, **kwargs)[source]
Bases:
object
Manager class for a sequential optical model
A sequential optical model is a sequence of surfaces and gaps.
The sequential model has this structure
IfcObj Ifc1 Ifc2 Ifc3 ... Ifci-1 IfcImg \ / \ / \ / \ / GObj G1 G2 Gi-1
where
There are N interfaces and N-1 gaps. The initial configuration has an object and image Surface and an object gap.
The Interface API supports implementation of an optical action, such as refraction, reflection, scatter, diffraction, etc. The Interface may be realized as a physical profile separating the adjacent gaps or an idealized object, such as a thin lens or 2 point HOE.
The Gap class maintains a simple separation (z translation) and the medium filling the gap. More complex coordinate transformations are handled through the Interface API.
- opt_model
parent optical model
- lcl_tfrms
forward transform, interface to interface
- rndx
a list with refractive indices for all wvls
- z_dir
-1 if gap follows an odd number of reflections, otherwise +1
- gbl_tfrms
global coordinates of each interface wrt the 1st interface
- path(wl=None, start=None, stop=None, step=1)[source]
returns an iterable path tuple for a range in the sequential model
- Parameters:
wl – wavelength in nm for path, defaults to central wavelength
start – start of range
stop – first value beyond the end of the range
step – increment or stride of range
- Returns:
(ifcs, gaps, lcl_tfrms, rndx, z_dir)
- reverse_path(wl=None, start=None, stop=None, step=-1)[source]
returns an iterable path tuple for a range in the sequential model
- Parameters:
wl – wavelength in nm for path, defaults to central wavelength
start – start of range
stop – first value beyond the end of the range
step – increment or stride of range
- Returns:
(ifcs, gaps, lcl_tfrms, rndx, z_dir)
- calc_ref_indices_for_spectrum(wvls)[source]
returns a list with refractive indices for all wvls
- Parameters:
wvls – list of wavelengths in nm
- insert(ifc, gap, z_dir=1, prev=False)[source]
insert surf and gap at the cur_gap edge of the sequential model graph
- remove(*args, prev=False)[source]
Remove surf and gap at cur_surface or an input index argument.
To avoid invalid sequence states, both an interface and a gap must be removed at the same time. The
prev
argument, if True, removes the gap preceding the interface. The default behavior is to remove the following gap.
- add_surface(surf_data, **kwargs)[source]
add a surface where surf_data is a list that contains:
[curvature, thickness, refractive_index, v-number, semi-diameter]
The curvature entry is interpreted as radius if radius_mode is True
The thickness is the signed thickness
The refractive_index, v-number entry can have several forms:
refractive_index, v-number (numeric)
refractive_index only -> constant index model
glass_name, catalog_name as 1 or 2 strings
an instance with a rindex attribute
air, str -> om.Air
blank -> defaults to om.Air
‘REFL’ -> set interact_mode to ‘reflect’
The semi-diameter entry is optional. It may also be entered using the sd keyword argument.
- list_decenters(full=False)[source]
List decenter data and gap separations.
- Parameters:
full – lists all values if True, else only y offset and alpha tilt
- trace_grid(fct, fi, wl=None, num_rays=21, form='grid', append_if_none=True, **kwargs)[source]
fct is applied to the raw grid and returned as a grid
- gen_sequence(surf_data_list, **kwargs)[source]
create a sequence iterator from the surf_data_list
- Parameters:
surf_data_list – a list of lists containing: [curvature, thickness, refractive_index, v-number]
**kwargs – keyword arguments
- Returns:
(ifcs, gaps, rndx, lcl_tfrms, z_dir)
- create_surface_and_gap(surf_data, radius_mode=False, prev_medium=None, wvl=550.0, **kwargs)[source]
create a surface and gap where surf_data is a list that contains:
[curvature, thickness, refractive_index, v-number, semi-diameter]
The curvature entry is interpreted as radius if radius_mode is True
The thickness is the signed thickness
The refractive_index, v-number entry can have several forms:
refractive_index, v-number (numeric)
refractive_index only -> constant index model
glass_name, catalog_name as 1 or 2 strings
an instance with a rindex attribute
air, str -> om.Air
blank -> defaults to om.Air
‘REFL’ -> set interact_mode to ‘reflect’
The semi-diameter entry is optional. It may also be entered using the sd keyword argument.