optiland.rays.ray_aiming.initialization

Ray Aiming Initialization Module

This module implements the initialization logic for determining the physical aperture stop size (Stop Radius) before the main Ray Aiming iteration begins. It uses a Strategy Pattern to handle different ways of calculating this radius.

Kramer Harrison, 2025

Functions

get_stop_radius_strategy(optic, aiming_mode)

Factory function to select the appropriate stop size strategy.

Classes

FloatByStopStrategy(optic)

Strategy for 'Float By Stop Size' aperture type.

ParaxialReferenceStrategy(optic)

Strategy using paraxial ray trace to determine stop radius.

RealReferenceStrategy(optic)

Strategy using real ray trace to determine stop radius.

StopSizeStrategy(optic)

Abstract base class for stop size determination strategies.

class FloatByStopStrategy(optic: Optic)[source]

Strategy for ‘Float By Stop Size’ aperture type.

Simply returns the user-defined semi-diameter of the Stop Surface.

calculate_stop_radius() float[source]

Calculate the radius of the stop surface.

class ParaxialReferenceStrategy(optic: Optic)[source]

Strategy using paraxial ray trace to determine stop radius.

Traces a Paraxial Marginal Ray from the center of the object to the Stop Surface.

calculate_stop_radius() float[source]

Calculate the radius of the stop surface.

class RealReferenceStrategy(optic: Optic)[source]

Strategy using real ray trace to determine stop radius.

Traces a Real Ray from the center of the object toward the edge of the Paraxial Entrance Pupil. Fallbacks to ParaxialReferenceStrategy on failure.

calculate_stop_radius() float[source]

Calculate the radius of the stop surface.

class StopSizeStrategy(optic: Optic)[source]

Abstract base class for stop size determination strategies.

abstract calculate_stop_radius() float[source]

Calculate the radius of the stop surface.

get_stop_radius_strategy(optic: Optic, aiming_mode: str) StopSizeStrategy[source]

Factory function to select the appropriate stop size strategy.

Parameters:
  • optic – The optical system.

  • aiming_mode – The ray aiming mode (‘paraxial’, ‘iterative’, ‘robust’).

Returns:

The instantiated strategy instance.