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.
- 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).
- 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: 1. By providing an instance of a BaseApodization subclass. 2. 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:
apodization (BaseApodization | str | dict, optional) – The apodization to apply. Defaults to None.
**kwargs – Additional keyword arguments used to initialize the apodization class when apodization is a string.
- 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
- Parameters:
value (float) – The new value for the aspheric coefficient.
surface_number (int) – The index of the surface to modify.
aspher_coeff_idx (int) – The index of the aspheric coefficient within the surface’s coefficient list to set.
- set_conic(value, surface_number)[source]
Set the conic constant of a surface.
- Parameters:
value (float) – The new conic constant.
surface_number (int) – The index of the surface to modify.
- set_index(value: float, surface_number: int) None[source]
Set the index of refraction of a surface.
- Parameters:
value (float) – The new refractive index value.
surface_number (int) – The index of the surface whose post-material (material after the surface) will be updated. This also updates the pre-material of the subsequent 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.
- Parameters:
value (float) – The new value for the normalization radius.
surface_number (int) – The index of the surface to modify.
is_fixed (bool, optional) – Whether to lock the normalization radius from automatic paraxial updates. Defaults to True.
- 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’.
- set_radius(value, surface_number)[source]
Set the radius of curvature of a surface.
- Parameters:
value (float) – The new radius of curvature.
surface_number (int) – The index of the surface to modify.
- set_thickness(value, surface_number)[source]
Set the thickness of a surface.
- Parameters:
value (float) – The new thickness value to set for the space following the specified surface.
surface_number (int) – The index of the surface before the thickness to be modified.
- 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.