geometries.standard
Standard Geometry
The Standard geometry represents a surface defined by a sphere or conic in two dimensions. The surface is defined as:
z = r^2 / (R * (1 + sqrt(1 - (1 + k) * r^2 / R^2)))
where - r^2 = x^2 + y^2 - R is the radius of curvature - k is the conic constant
Kramer Harrison, 2024
Classes
|
Represents a standard geometry with a given coordinate system, radius, and conic. |
- class StandardGeometry(coordinate_system, radius, conic=0.0)[source]
Represents a standard geometry with a given coordinate system, radius, and conic.
- Parameters:
coordinate_system (CoordinateSystem) – The coordinate system of the geometry.
radius (float) – The radius of curvature of the geometry.
conic (float, optional) – The conic constant of the geometry. Defaults to 0.0.
- surface_normal(rays)[source]
Calculates the surface normal of the geometry at the given ray positions.
- distance(rays)[source]
Find the propagation distance to the geometry for the given rays.
- Parameters:
rays (RealRays) – The rays for which to calculate the distance.
- Returns:
An array of distances from each ray’s current position to its intersection point with the geometry.
- Return type:
be.ndarray
- flip()[source]
Flip the geometry.
Changes the sign of the radius of curvature. The conic constant remains unchanged.
- classmethod from_dict(data)[source]
Create a geometry from a dictionary.
- Parameters:
data (dict) – The dictionary representation of the geometry.
- Returns:
An instance of StandardGeometry.
- Return type:
- globalize(rays)
Convert rays from the local coordinate system to the global coordinate system.
- Parameters:
rays (RealRays) – The rays to convert.
- localize(rays)
Convert rays from the global coordinate system to the local coordinate system.
- Parameters:
rays (RealRays) – The rays to convert.
- sag(x=0, y=0)[source]
Calculate the surface sag of the geometry at the given coordinates.
- Parameters:
x (float or be.ndarray, optional) – The x-coordinate(s). Defaults to 0.
y (float or be.ndarray, optional) – The y-coordinate(s). Defaults to 0.
- Returns:
The sag value(s) at the given coordinates.
- Return type:
be.ndarray or float
- scale(scale_factor: float)[source]
Scale the geometry parameters.
- Parameters:
scale_factor (float) – The factor by which to scale the geometry.
- set_radius(value: float) None[source]
Set the radius of curvature.
- Parameters:
value (float) – The new radius of curvature.
- surface_normal(rays)[source]
Calculate the surface normal of the geometry at the given points.
- Parameters:
rays (RealRays) – The rays, positioned at the surface, for which to calculate the surface normals.
- Returns:
The x, y, and z components of the surface normal vectors.
- Return type:
tuple[be.ndarray, be.ndarray, be.ndarray]
- to_dict()[source]
Convert the geometry to a dictionary.
- Returns:
The dictionary representation of the geometry.
- Return type:
dict
- update_normalization(semi_aperture: float) None
Update the normalization attributes of the geometry based on its defined normalization_mode (‘auto’ or ‘manual’). Base geometry generally does not maintain a normalization radius.
- Parameters:
semi_aperture (float) – The current semi-aperture of the surface.