optic.optic_updater#
Optic Updater Module
This module contains the OpticModifier class, which is responsible for updating the optical system properties, such as the surface radii of curvature, thicknesses, materials, conic constants, polarization, etc.
Kramer Harrison, 2024
Classes
|
Class to update or modify an optical system |
- class OpticUpdater(optic)[source]#
Class to update or modify an optical system
This class is responsible for updating the optical system properties, such as the surface radii of curvature, thicknesses, materials, conic constants, polarization, etc.
- Parameters:
optic (Optic) – The optical system to be modified.
- flip()[source]#
Flips the optical system, reversing the order of surfaces (excluding object and image planes), their geometries, and materials. Pickups and solves referencing surface indices are updated accordingly. The new first optical surface (originally the last) is placed at z=0.0.
- image_solve()[source]#
Adjusts the position of the image surface (last surface) such that the paraxial marginal ray crosses the optical axis at this new location. This effectively sets the paraxial focus.
- Raises:
UnsupportedParaxialGeometryError – If the system’s unfolded axial coordinate is not global z (folded or off-axis-entered systems), before any surface is mutated – the focus offset is an unfolded axial distance and writing it into
cs.zwould move the image plane off its physical leg.
- scale_system(scale_factor)[source]#
Scales the optical system by a given scale factor.
- Parameters:
scale_factor (float) – The factor by which to scale all relevant system dimensions (radii, thicknesses, EPD, physical apertures).
- Raises:
UnsupportedParaxialGeometryError – If the beam path is folded off global +z (or entered along another direction), before any value is read or any geometry is touched. Scaling rebuilds positions from cumulative thicknesses along global z, which would move folded surfaces off their physical legs; guarding only inside
set_thicknesswould leave the system partially scaled.
- set_apodization(apodization: BaseApodization | str | dict = None, **kwargs)[source]#
Sets the apodization for the optical system.
This method supports setting the apodization in multiple ways:
By providing an instance of a BaseApodization subclass.
By providing a string identifier (e.g., “GaussianApodization”) and keyword arguments for its parameters.
By providing a dictionary that can be passed to from_dict.
By passing None to remove any existing apodization.
- Parameters:
- Raises:
TypeError – If the provided apodization is not a supported type.
ValueError – If the string identifier is not found in the registry.
- set_asphere_coeff(value, surface_number, aspher_coeff_idx)[source]#
Set the asphere coefficient on a surface
- set_index(value: float, surface_number: int) None[source]#
Set the index of refraction of a surface.
- set_material(material: BaseMaterial, surface_number: int) None[source]#
Set the material of a surface.
- Parameters:
value (BaseMaterial) – The new material.
surface_number (int) – The material of the surface whose post-material (material after the surface) will be updated. This also updates the pre-material of the subsequent surface.
- set_norm_radius(value, surface_number, is_fixed=True)[source]#
Set the normalization radius on a surface.
- set_polarization(polarization: PolarizationState | str)[source]#
Set the polarization state of the optic.
- Parameters:
polarization (PolarizationState or str) – The polarization state to set. Can be a PolarizationState object or the string ‘ignore’.
- update() None[source]#
Update the optical system by applying all defined pickups and solves. If certain surface types requiring paraxial updates are present, update_paraxial() is also called.