rayoptics.parax.paraxialdesign module

First order paraxial design space

bbox_from_poly(poly)[source]
class ParaxialModel(opt_model, opt_inv=1.0, seq_mapping=None, **kwargs)[source]

Bases: object

sync_to_restore(opt_model)[source]
update_model(**kwargs)[source]
sync_to_seq(seq_model)[source]
build_lens()[source]
init_from_nodes(nodes, type_sel, rndx_and_imode=None)[source]

Construct a diagram using nodes, a list of diagram vertices.

parax_to_nodes(type_sel)[source]

render the paraxial model into a node list

nodes_to_parax(nodes, type_sel)[source]

Update the parax model from the node list, nodes.

get_pt(idx, type_sel=0)[source]
set_pt(idx, pt, type_sel=0)[source]
get_gap_for_node(node_idx, dgm_type)[source]
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.

replace_node_with_seq(node, sys_seq, pp_info)[source]

replaces the data at node with sys_seq

get_object_for_node(node)[source]

basic 1:1 relationship between seq and parax model sequences

delete_node(surf)[source]

delete the node at position surf

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.

process_seq_mapping(nodes)[source]

The composite nodes are mapped and applied to the ifcs layer.

update_composite_node_fct(type_sel)[source]

returns the appropriate ‘apply’ fct for the type_sel.

update_rindex(surf)[source]

Update the refractive index using the gap at surf.

paraxial_trace()[source]

regenerate paraxial axial and chief rays from power and reduced distance

list_model()[source]

list the paraxial axial and chief rays, and power, reduced distance

list_lens()[source]

list the paraxial axial and chief rays, and power, reduced distance

list_sys_seq()[source]
first_order_data()[source]

List out the first order imaging properties of the model.

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

pwr_slope_solve(ray, surf, slp_new)[source]
pwr_ht_solve(ray, surf, ht_new)[source]
thi_ht_solve(ray, surf, ht_new)[source]
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
apply_conjugate_shift(nodes, k, mat, line_type)[source]
paraxial_vignetting(rel_fov=1)[source]

Calculate the vignetting factors using paraxial optics.

create_diagram_for_key(opm, key, type_sel)[source]
update_diagram_for_key(opm, key, type_sel)[source]
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.

build_from_yybar(opm, nodes, type_sel, seq_mapping)[source]
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:

  1. the composite node maps directly to node idx in the ‘ifcs’ layer
  2. the composite node is generated from the previous and following gap indices
  3. 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.