CylindricalSag#

class optika.sags.CylindricalSag(radius=<Quantity inf mm>, *, transformation=None, parameters_slope_error=None, parameters_roughness=None, parameters_microroughness=None)[source]#

Bases: AbstractSag

A cylindrical sag function, where the local \(y\) axis is the axis of symmetry for the cylinder.

The sag (\(z\) coordinate) of a spherical surface is calculated using the expression

\[z(x, y) = \frac{c x^2}{1 + \sqrt{1 - c^2 x^2}}\]

where \(c\) is the curvature, and \(x\) is the horizontal component of the evaluation point.

Examples

Plot a slice through the sag surface

import matplotlib.pyplot as plt
import astropy.units as u
import astropy.visualization
import named_arrays as na
import optika

sag = optika.sags.SphericalSag(
    radius=na.linspace(100, 300, axis="radius", num=3) * u.mm,
)

position = na.Cartesian3dVectorArray(
    x=na.linspace(-90, 90, axis="x", num=101) * u.mm,
    y=0 * u.mm,
    z=0 * u.mm
)

z = sag(position)

with astropy.visualization.quantity_support():
    plt.figure()
    plt.gca().set_aspect("equal")
    na.plt.plot(position.x, z, axis="x", label=sag.radius)
    plt.legend(title="radius")
../_images/optika.sags.CylindricalSag_0_0.png

Attributes

parameters_microroughness

The microroughness parameters for this sag profile.

parameters_roughness

The roughness parameters for this sag profile.

parameters_slope_error

The slope error parameters for this sag profile.

radius

The radius of this cylinder.

shape

The array shape of this object.

transformation

The transformation between the surface coordinate system and the sag coordinate system.

Methods

__init__([radius, transformation, ...])

intercept(rays)

A set of new rays with the same direction as the input rays, but with the optika.rays.RayVectorArray.position updated to their interception point with this sag function.

normal(position)

The vector perpendicular to the surface at the given position.

propagate_rays(rays)

For the given input rays, calculate new rays based off of their interation with this object.

to_string([prefix])

Public-facing version of the __repr__ method that allows for defining a prefix string, which can be used to calculate how much whitespace to add to the beginning of each line of the result.

Inheritance Diagram

Inheritance diagram of optika.sags.CylindricalSag
Parameters:
intercept(rays)[source]#

A set of new rays with the same direction as the input rays, but with the optika.rays.RayVectorArray.position updated to their interception point with this sag function.

Parameters:

rays (AbstractRayVectorArray) – input rays that will intercept this sag function

Return type:

AbstractRayVectorArray

normal(position)[source]#

The vector perpendicular to the surface at the given position.

Parameters:

position (AbstractCartesian3dVectorArray) – The location on the surface to evaluate the normal vector

Return type:

AbstractCartesian3dVectorArray

propagate_rays(rays)#

For the given input rays, calculate new rays based off of their interation with this object.

Parameters:

rays (AbstractRayVectorArray) – a set of input rays that will interact with this object

Return type:

AbstractRayVectorArray

to_string(prefix=None)#

Public-facing version of the __repr__ method that allows for defining a prefix string, which can be used to calculate how much whitespace to add to the beginning of each line of the result.

Parameters:

prefix (None | str) – an optional string, the length of which is used to calculate how much whitespace to add to the result.

Return type:

str

parameters_microroughness: None | RoughnessParameters = None#

The microroughness parameters for this sag profile.

parameters_roughness: None | RoughnessParameters = None#

The roughness parameters for this sag profile.

parameters_slope_error: None | SlopeErrorParameters = None#

The slope error parameters for this sag profile.

radius: Quantity | AbstractScalar = <Quantity inf mm>#

The radius of this cylinder.

property shape: dict[str, int]#

The array shape of this object.

transformation: None | AbstractTransformation = None#

The transformation between the surface coordinate system and the sag coordinate system.