CurvedMirror

class raytracing.CurvedMirror(R, diameter=inf, label='')

Bases: Matrix

A curved mirror of radius R and infinite or finite diameter.

Parameters:
  • R (float) – the radius of curvature of the mirror, converging is negative

  • diameter (float) – The diameter of the element (default=Inf)

  • label (string) – The label of the curved mirror

Examples

>>> from raytracing import *
>>> #define a curved mirror with R=5 and diameter 20
>>> M=CurvedMirror(R=5,diameter=20,label='curved mirror')
>>> print(M) #print the transfer matrix of curved mirror
|  1.000    0.000 |
|                 |
|  0.400    1.000 |
f=-2.500

Notes

A concave mirror (i.e. converging mirror) has a negative radius of curvature if we want to keep the same sign convention. (there was a mistake up to version 1.2.7 of the module)

flipOrientation()

This function flips the element around (as in, we turn a lens around front-back).

Notes

In this case, R -> -R. It is important to call the super implementation because other things must be flipped (vertices for instance)

property forwardSurfaces

A list of surfaces that represents the element for drawing purposes

pointsOfInterest(z)

List of points of interest for this element as a dictionary:

Parameters:

z (float) – Position of the lens

Returns:

pointsOfInterest – List of points of interest for the input element

Return type:

List

Methods

__init__(R[, diameter, label])

flipOrientation()

This function flips the element around (as in, we turn a lens around front-back).

pointsOfInterest(z)

List of points of interest for this element as a dictionary:

Inherited Methods

backFocalLength()

The focal lengths measured from the back vertex.

backwardConjugate()

With an image at the back edge of the element, where is the object ? Distance before the element by which a ray must travel to reach the conjugate plane at the back of the element.

display()

displayHalfHeight()

A reasonable height for display purposes for an element, whether it is infinite or not.

effectiveFocalLengths()

The effective focal lengths calculated from the power (C) of the matrix.

focalDistances()

This is the synonym of effectiveFocalLengths()

focusPositions(z)

Positions of both focal points on either side of the element.

forwardConjugate()

With an object at the front edge of the element, where is the image? Distance after the element by which a ray must travel to reach the conjugate plane of the front of the element.

fromFocusToFocus()

A simple method to obtain a MatrixGroup that includes all three matrices to travel from the front focus, through the lens, and then to the back focus.

fromStruct(theStruct)

frontFocalLength()

The focal lengths measured from the front vertex.

hasFiniteApertureDiameter()

If the system has a finite aperture size

magnification()

The magnification of the element

mul_beam(rightSideBeam)

This function calculates the multiplication of a coherent beam with complex radius of curvature q by an ABCD matrix.

mul_matrix(rightSideMatrix)

This function is used to combine two elements into a single matrix.

mul_ray(rightSideRay)

This function does the multiplication of a ray by a matrix.

opticalInvariant(ray1, ray2[, z])

The optical invariant is a quantity that is conserved for any two rays in the system.

principalPlanePositions(z)

Positions of the input and output principal planes.

profileFromRayTraces(rayTraces[, z])

toStruct()

trace(ray)

The ray matrix formalism, through multiplication of a ray by a matrix, will give the correct ray but will never consider apertures.

traceMany(inputRays[, useOpenCL])

This function trace each ray from a group of rays from front edge of element to the back edge.

traceManyNative(inputRays)

This function trace each ray from a group of rays from front edge of element to the back edge.

traceManyOpenCL(inputRays)

This function trace each ray from a group of rays from front edge of element to the back edge.

traceManyThrough(inputRays[, progress, ...])

This function trace each ray from a list or a Rays() distribution from front edge of element to the back edge.

traceManyThroughInParallel(inputRays[, ...])

This is an advanced technique to gain from parallel computation: it is the same as traceManyThrough(), but splits this call in several other parallel processes using the multiprocessing module, which is os-independent.

traceThrough(inputRay)

Contrary to trace(), this only returns the last ray.

transferMatrices()

The list of Matrix() that corresponds to the propagation through this element (or group).

transferMatrix([upTo])

The Matrix() that corresponds to propagation from the edge of the element (z=0) up to distance "upTo" (z=upTo).

Attributes

Struct

determinant

The determinant of the ABCD matrix is always frontIndex/backIndex, which is often 1.0.

forwardSurfaces

A list of surfaces that represents the element for drawing purposes

hasPower

If True, then there is a non-null focal length because C!=0.

isIdentity

isImaging

If B=0, then the matrix represents that transfer from a conjugate plane to another (i.e. object at the front edge and image at the back edge).

largestDiameter

Largest diameter for a group of elements

surfaces