ConicSag#
- class optika.sags.ConicSag(radius=<Quantity inf mm>, conic=<Quantity 0.>, *, transformation=None, parameters_slope_error=None, parameters_roughness=None, parameters_microroughness=None)[source]#
Bases:
AbstractConicSagSurface of revolution of a conic section
The sag (\(z\) coordinate) of a conic sag function is calculated using the expression
\[z(x, y) = \frac{c (x^2 + y^2)}{1 + \sqrt{1 - c^2 (1 + k) (x^2 + y^2)}}\]where \(c\) is the
curvature, \(x,y\), are the 2D components of the evaluation point. and \(k\) is theconicconstant. See the table below for the meaning of the conic constant.conic constant
conic section type
\(k < -1\)
hyperbola
\(k = -1\)
parabola
\(-1 < k < 0\)
ellipse
\(k = 0\)
sphere
\(k > 0\)
oblate ellipsoid
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.ConicSag( radius=100 * u.mm, conic=na.ScalarArray( ndarray=[-1.5, -1, -0.5, 0, 0.5] * u.dimensionless_unscaled, axes="conic", ) ) 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.conic) plt.legend(title="conic constant")
Attributes
The conic constant of this conic section.
The microroughness parameters for this sag profile.
The roughness parameters for this sag profile.
The slope error parameters for this sag profile.
The effective radius of this conic section.
The array shape of this object.
The transformation between the surface coordinate system and the sag coordinate system.
Methods
__init__([radius, conic, transformation, ...])intercept(rays)Compute the intercept of the given rays with this conic surface of revolution.
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

- Parameters:
radius (Quantity | AbstractScalar)
conic (float | AbstractScalar)
transformation (None | AbstractTransformation)
parameters_slope_error (None | SlopeErrorParameters)
parameters_roughness (None | RoughnessParameters)
parameters_microroughness (None | RoughnessParameters)
- intercept(rays)#
Compute the intercept of the given rays with this conic surface of revolution.
The intersection is found in closed form by solving the ray-quadric intersection, which avoids the spurious root that an iterative solver can converge to on the steep flank of a grazing-incidence conic.
- Parameters:
rays (AbstractRayVectorArray) – The rays to intercept with this surface.
- Return type:
Notes
A conic of revolution about the \(z\) axis, with its vertex at the origin, satisfies the implicit equation
\[c (x^2 + y^2) + (1 + k) c z^2 - 2 z = 0,\]where \(c = 1 / R\) is the vertex curvature and \(k\) is the conic constant. Substituting the parametric ray \(\mathbf{x} = \mathbf{o} + t \mathbf{u}\) gives a quadratic \(A t^2 + B t + C = 0\) in the path length \(t\), with
\[\begin{split}A &= c \left[ u_x^2 + u_y^2 + (1 + k) u_z^2 \right] \\ B &= 2 \left[ c (o_x u_x + o_y u_y + (1 + k) o_z u_z) - u_z \right] \\ C &= c \left[ o_x^2 + o_y^2 + (1 + k) o_z^2 \right] - 2 o_z.\end{split}\]Of the (up to two) real roots, the intercept is the one on the same sheet of the conic as the vertex (identified by \(z \, (c (x^2 + y^2) - z) \geq 0\)) that is nearest the ray’s starting point. An iterative solver, by contrast, can converge to the far or wrong-sheet root on the steep flank of a grazing conic.
- normal(position)#
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:
- 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:
- 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.
- conic: float | AbstractScalar = <Quantity 0.>#
The conic constant of this conic section.
- 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 effective radius of this conic section.
- transformation: None | AbstractTransformation = None#
The transformation between the surface coordinate system and the sag coordinate system.