Classes and Attributes
This page is a faithful conversion of Section 2 of the provisional manual
(KrakenOS/Docs/USER_MANUAL_KrakenOS_Provisional.pdf, pages 4–10). For a
UI-focused summary that maps these fields onto the current Layout Editor, see
Core Model: Surfaces And Systems.
The library has been simplified to the extent of having only two classes of
objects for the definition of a system. These objects are surf and
system; their application is described in Table 1 — surf class attributes and
Table 2 — system class implementations and attributes.
The surf object contains all the relevant information of any optical
interface. Every optical interface — from the object plane to the image plane —
is an instance of surf and carries attributes for size, shape, material, or
orientation.
Section 2 of the source PDF contains no figures; it is composed entirely of the two reference tables below.
Table 1 — surf class attributes
Attribute |
Description |
|---|---|
|
Name of the element. Useful only for 2D diagram or ray identification. |
|
Position of the note with the name |
|
Useful for adding user notes to a surface. Default value: |
|
Paraxial radius of curvature in millimeters. Default value
|
|
Ratio between the axial and sagittal radius of curvature. Useful for
cylindrical and toroidal lenses. Default value: |
|
Axicon simulation. For values other than zero an axicon is generated
with the angle entered. Default value: |
|
Distance between this surface and the next surface. Default value:
|
|
Outside diameter of the surface. Default value: |
|
Internal diameter of the surface. Useful for items such as a
central-aperture primary mirror. Default value: |
|
Conic constant for classical conic surfaces ( |
surf.DespX = 0.0surf.DespY = 0.0surf.DespZ = 0.0 |
Displacement of the surface in the X, Y and Z axes (in millimeters).
Default values: |
surf.TiltX = 0.0surf.TiltY = 0.0surf.TiltZ = 0.0 |
Rotation of the surface in the X, Y and Z axes (in degrees). Default
values: |
|
Defines the order of the transformations. If the value is |
|
Defines what will happen to the optical axis after a coordinate
transformation. If the value is |
|
Diffraction order. Converts the element into a diffraction grating. The
radius-of-curvature value is automatically omitted to make it a planar
diffraction grating. This option can be used in transmission or
refraction. Default value: |
|
Separation between the lines of the diffraction grating. Default value:
|
|
Angle of the grating lines in the plane of the surface — i.e., around
the optical axis. Useful for simulating conic dispersion. Default value:
|
|
NumPy array of 36 elements corresponding to the coefficients of the Zernike polynomials in the Noll nomenclature (Ref. 2). |
surf.ShiftX = 0surf.ShiftY = 0 |
Offset of the surface profile on the X or Y axis. Useful, for example,
for off-axis surfaces such as parabolas. Default value: |
|
Type of mask to apply. The different values are: |
|
Form of the mask to apply, built with the PyVista ( |
|
Array of coefficients for an aspherical surface. The array is a NumPy list. |
|
User-created surface with a sagitta function dependent on |
|
Receives an error map generated with NumPy arrays for the coordinates in X, Y and the height in Z, plus a spacing value between samples. See Example - Tel 2M Error Map in the appendix. |
|
|
|
Defines the color of the element in the format |
|
Path of the 3D solid object in STL format. |
The surf.ExtraData sagitta function and coefficient list are constructed
as follows:
def f(x, y, E):
DeltaX = E[0] * np.rint(x / E[0])
DeltaY = E[0] * np.rint(y / E[0])
x = x - DeltaX
y = y - DeltaY
s = np.sqrt((x * x) + (y * y))
c = 1.0 / E[1]
InRoot = 1 - (E[2] + 1.0) * c * c * s * s
z = (c * s * s / (1.0 + np.sqrt(InRoot)))
return z
# Coefficients are defined, if necessary, in a list:
Coef = [3.0, -3, 0]
# The shape of the function is assigned to the surface:
L1c.ExtraData = [f, Coef]
Table 2 — system class implementations and attributes
The system object is intended as a container for all interfaces. It exposes
implementations for ray tracing and for obtaining different parameters of the
ray, which are cumulative across the surfaces through which the ray passes. The
example in Appendix 7.11 walks through how these are called.
Implementation / attribute |
Description |
|---|---|
|
pS = [1.0, 0.0, 0.0]
dC = [0.0, 0.0, 1.0]
wV = 0.4
|
|
Like |
|
Returns the following paraxial calculations (also accessible from
Prx = SistemMatrix, S_Matrix, N_Matrix, a, b, c, d, EFFL, PPA, PPP, CC, N_Prec, DD
|
system.disable_innersystem.enable_inner |
Enables and disables the central openings. Very useful, for example, to calculate a ray trace without vignetting at the aperture of a primary mirror. |
|
Returns a list of the number of surfaces the ray passed through. |
|
Returns a list of the names of the surfaces the ray passed through. If no name is given to the surfaces, the list will contain empty fields. Naming surfaces is useful, for example, to identify whether a ray has struck a given surface. |
|
Returns a list of the materials the ray has pierced. |
|
Returns the |
|
Returns the |
|
Returns the |
|
Returns the |
|
Returns a list with the distances traveled by the ray between intersection points. |
|
Returns a list with the optical paths traveled by the ray between intersection points; the dispersion of the glass and the distance between intersection points are considered. |
|
Returns a single value with the total optical path of the ray from the source to the last point of intersection. |
|
Returns a cumulative list with values of the ray’s optical path from the source to the last intersection point. |
|
Returns a list with the absorption coefficients for the materials on the intercepted surfaces, considering the wavelength. These values are obtained from the originally provided material catalog. |
|
Returns a list with the transmission through all the paths within the system; the optical paths and the absorption coefficients of the materials are considered. |
|
Returns a list with the direction cosines |
|
Returns a list with the direction cosines |
|
Returns a list with the direction cosines |
|
Refractive indices before and after each interface through which the ray passes. This index is calculated with the dispersion of the material and the wavelength of the ray in question. |
|
Refractive indices after each interface through which the ray passes.
This index is calculated with the dispersion of the material and the
wavelength of the ray in question. The difference with N0 = [n1, n2, n3, n4, n5]
N1 = [n2, n3, n4, n5, n5]
So if we want to know the direction of a ray at the first interface, we
use |
|
Wavelength of the ray in question. Although this command returns a list of all the values, they are the same because the wavelength is constant for a ray; the size of the list indicates only the number of iterations with system interfaces. Units: µm. |
|
Returns a list with the terms |
|
Returns a list with the diffraction orders associated with the ray in question. |
|
Distance between lines of the diffraction grating. Units: µm. |
system.RPsystem.RSsystem.TPsystem.TS |
Returns a list with the Fresnel reflection and transmission coefficients for polarization S and P. |
|
Total energy transmitted or reflected per element. |
|
Total energy transmitted or reflected total. |
|
Limits the ray tracing to the defined surface; the argument is an integer equal to the surface number. If the value is zero (the default) the ray tracing is carried out to the last surface. |
|
Defined with the integer number of the surface that needs to be made
flat. The value |