rayoptics.parax.paraxialdesign module
First order paraxial design space
- class ParaxialModel(opt_model, opt_inv=1.0, seq_mapping=None, **kwargs)[source]
Bases:
object
- parax_from_dgms(dgm_list, opt_inv, rndx_and_imode=None)[source]
Construct a diagram using dgm_list, a list of diagram vertices.
- replace_node_with_dgm(e_node, dgm, **kwargs)[source]
Update the parax model from the node list, nodes.
- apply_scale_factor(scale_factor)[source]
Apply scale factor to height diagram and update parax_model.
- assign_object_to_node(node, new_node, type_sel, factory, **inputs)[source]
create a new element from factory and replace node with it
- compute_signed_rindx()[source]
Reset the state of the refractive index array.
This method resets the signs of the refractive indices so that they are negative following an odd number of reflections, but positive otherwise.
- apply_ht_dgm_data(surf, new_vertex=None)[source]
This routine calculates all data dependent on the input height coordinates (y,ybar) at surface surf.
- apply_slope_dgm_data(surf, new_vertex=None)[source]
This routine calculates all data dependent on the input slope coordinates (nu,nubar) at surface surf.
- seq_path_to_paraxial_lens(path)[source]
returns lists of power, reduced thickness, signed index and refract mode
- paraxial_lens_to_seq_model()[source]
Applies a paraxial lens spec (power, reduced distance) to the model
- lens_from_dgm(idx: int, bending=0.0, th=None, sd=1.0, **kwargs)[source]
Return single lens constructional parameters from parax_model.
This method uses a method for thickening a lens element developed by Lopez-Lopez in his PhD dissertation The application of the Delano \(y-\overline{y}\) diagram to optical design.
The variables are named following the notation in the thesis. He used z for the \(y-\overline{y}\) coordinates; the reduced slopes and system parameters include a (inverse) factor of the optical invariant, and are capitalized here: T, W, Pwr
- compute_principle_points_from_dgm(os_idx=0, is_idx=-2)[source]
Calculate focal points and principal points.
- Parameters:
os_idx – object space gap index
is_idx – image space gap index
- Returns:
(power, efl, fl_obj, fl_img, pp1, ppk, pp_sep, ffl, bfl)
power: optical power of system
efl: effective focal length
fl_obj: object space focal length, f
fl_img: image space focal length, f’
pp1: distance from the 1st interface to the front principle plane
ppk: distance from the last interface to the rear principle plane
- pp_sep: distance from the front principle plane to the rear
principle plane
- ffl: front focal length, distance from the 1st interface to the
front focal point
- bfl: back focal length, distance from the last interface to the back
focal point
- nodes_to_new_model(*args, **inputs)[source]
Sketch a 2d polyline and populate an opt_model from it.
- air_gaps_to_node_defs(air_gap_list)[source]
generate the node defs for composite layers, based on airgaps.
- get_valid_ht_nodes(parax_model, node_defs_in)[source]
given the input node defs, replace non-physical thin lenses as needed.
- ht_nodes_from_node_defs(parax_model, node_defs)[source]
produce a list of ht nodes given the parax_model and node_defs.
node_defs is a list of tuples, each with either one or two indices. if there is a single index, it is to a node in parax_model. if there are 2 indices, the first is to the gap preceding the element; the second is to the gap following the element (also the last interface of the element). The node is calculated from the intersection of the diagram edges corresponding to these gaps.
There is no guarentee that the nodes calculated here represent a physically realizable system, i.e. there may be virtual airspaces.
- slp_nodes_from_node_defs(parax_model, node_defs)[source]
produce a list of slopes given the parax_model and node_defs.
node_defs is a list of tuples, each with either one or two indices. if there is a single index, it is to a node in parax_model. if there are 2 indices, the first is to the gap preceding the element; the second is to the gap following the element (also the last interface of the element). The node is calculated from the intersection of the diagram edges corresponding to these gaps.
There is no guarentee that the nodes calculated here represent a physically realizable system, i.e. there may be virtual airspaces.
- scan_nodes(parax_model, node_defs, nodes)[source]
scan node defs for any invalid thin elements
Replace the first invalid thin element found with two 3 element tuples, signifying a thick node. The first tuple element is the index to the node in the parax_model and the last two elements are the range of indices in the parax_model covered by the thick element.
Return the updated node_def list.
- build_from_yybar(opm, dgm_list, type_sel, seq_mapping)[source]
Returns a parax_model for the input nodes and seq_mapping.
- gen_ifcs_node_mapping(parax_model, node_defs, nodes)[source]
Create mapping between composite diagram and interface based diagram.
Each node in the composite diagram is associated with one or a range of nodes in parax_model.layer[‘ifcs’]. node_defs and nodes define the composite diagram.
node_defs is a list of tuples, one per composite node, of length 1, 2, or 3. The number of entries is as follows:
the composite node maps directly to node idx in the ‘ifcs’ layer
the composite node is generated from the previous and following gap indices
the composite node is part of a thick node
A thick node is what is used when reducing a range of interfaces to a single node requires virtual propagation distances. In this case, the first and last nodes in the range are retained in the composite diagram; interior nodes are scaled according to how the thick edge is stretched.
Changes in the composite diagram are propagated to the underlying ‘ifcs’ layer by applying a 2D stretch to the nodes in the ‘ifcs’ layer. The ‘ifcs’ node is parameterized by the calculating the intersection of the composite edge with the vector from the origin through the composite node. The scale factors are:
t1: parametric distance of the intersection point along the composite edge
t2: fractional distance of the composite node to the intersection point
The map_to_ifcs list connects the edge in the composite diagram to the ‘ifcs’ node and the scale factors needed to update the ‘ifcs’ node position when the composite diagram changes.
- opt_inv_from_dgm_and_osp(Z, osp, efl=1, t=None)[source]
Use the osp database to update the diagram data
- calc_object_and_pupil_from_dgm(Z, idx: int)[source]
calculate axial intercepts of line between idx and idx+1
- compute_principle_points_from_dgm(Z, sys, opt_inv, os_idx=0, is_idx=-2)[source]
Calculate focal points and principal points.
- Parameters:
Z – array of diagram points
sys – the system data for the diagram
opt_inv – optical invariant
os_idx – object space gap index
is_idx – image space gap index
- Returns:
(power, efl, fl_obj, fl_img, pp1, ppk, pp_sep, ffl, bfl)
power: optical power of system
efl: effective focal length
fl_obj: object space focal length, f
fl_img: image space focal length, f’
pp1: distance from the 1st interface to the front principle plane
ppk: distance from the last interface to the rear principle plane
- pp_sep: distance from the front principle plane to the rear
principle plane
- ffl: front focal length, distance from the 1st interface to the
front focal point
- bfl: back focal length, distance from the last interface to the back
focal point
- specsheet_from_dgm(parax_model, optical_spec, specsheet)[source]
update specsheet to contents of parax_model, while preserving inputs