rayoptics.parax.paraxialdesign module¶
First order paraxial design space
-
class
ParaxialModel
(opt_model, opt_inv=1.0, seq_mapping=None, **kwargs)[source]¶ Bases:
object
-
init_from_nodes
(nodes, type_sel, rndx_and_imode=None)[source]¶ Construct a diagram using nodes, a list of diagram vertices.
-
add_node
(node, new_vertex, type_sel, interact_mode)[source]¶ Add a node in the paraxial data structures
-
assign_object_to_node
(node, 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
-
compute_principle_points
(seq)[source]¶ Returns paraxial p and q rays, plus partial first order data.
Parameters: seq – a sequence containing interfaces and gaps to be traced. for each iteration, the sequence should return a list containing: Intfc, Gap, Trfm, Index, Z_Dir Returns: (p_ray, q_ray, (efl, pp1, ppk, ffl, bfl)) - p_ray: [ht, slp, aoi], [1, 0, -]
- q_ray: [ht, slp, aoi], [0, 1, -]
- efl: effective focal length
- pp1: distance of front principle plane from 1st interface
- ppk: distance of rear principle plane from last interface
- ffl: front focal length
- bfl: back focal length
-
-
generate_mapping_for_key
(opm, key, type_sel)[source]¶ generate all of the mappings, ht and slp, for key.
-
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.
-
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.