| | |
- builtins.object
-
- Matrix
-
- Aperture
- CurvedMirror
- DielectricInterface
- Lens
- Space
- ThickLens
-
- DielectricSlab
class Aperture(Matrix) |
| |
Aperture(diameter, label='')
An aperture of finite diameter, null thickness.
If the ray is beyond the finite diameter, the ray is blocked. |
| |
- Method resolution order:
- Aperture
- Matrix
- builtins.object
Methods defined here:
- __init__(self, diameter, label='')
- Initialize self. See help(type(self)) for accurate signature.
- drawAt(self, z, axes, showLabels=False)
- Currently nothing specific to draw because any
aperture for any object is drawn with drawAperture()
Methods inherited from Matrix:
- __mul__(self, rightSide)
- Operator overloading allowing easy to read matrix multiplication
For instance, with M1 = Matrix() and M2 = Matrix(), one can write
M3 = M1*M2. With r = Ray(), one can apply the M1 transform to a ray
with r = M1*r
- __str__(self)
- String description that allows the use of print(Matrix())
- axesToDataScaling(self, axes)
- For drawing properly arrows and other things, sometimes
we need to draw along y in real space but in x in relative space
(i.e. relative to the width of the graph, not x coordinates).
There are transforms in matplotlib, but only between axes-display,
and data-display, not between data-axes. Here we obtain the scaling
so we can set arrow properties intelligently
- backFocalLength(self)
- The focal lengths measured from the back vertex.
This is the distance between the surface and the focal point.
When the principal plane is not at the surface (which is usually
the case in anything except a thin lens), the back and front focal
lengths will be different from effective focal lengths. The effective
focal lengths is always measured from the principal planes, but the
BFL and FFL are measured from the vertex.
If the matrix is the result of the product of several matrices,
we may not know where the front and back vertices are. In that case,
we return None (or undefined).
Currently, it is assumed the index is n=1 on either side and
both focal distances are the same.
- backwardConjugate(self)
- 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. A positive distance means the
object is "distance" in front of the element (or to the
left, or before).
M2 = M1*Space(distance)
# M2.isImaging == True
- display(self)
- Display this component, without any ray tracing but with
all of its cardinal points and planes. If the component has no
power (i.e. C == 0) this will fail.
- displayHalfHeight(self)
- A reasonable height for display purposes for
an element, whether it is infinite or not.
If the element is infinite, currently the half-height
will be '4'. If not, it is the apertureDiameter/2.
- drawAperture(self, z, axes)
- Draw the aperture size for this element. Any element may
have a finite aperture size, so this function is general for all elements.
- drawCardinalPoints(self, z, axes)
- Draw the focal points of a thin lens as black dots
- drawLabels(self, z, axes)
- Draw element labels on plot with starting edge at 'z'.
Labels are drawn 50% above the display height
- drawPointsOfInterest(self, z, axes)
- Labels of general points of interest are drawn below the
axis, at 25% of the largest diameter.
- drawPrincipalPlanes(self, z, axes)
- Draw the principal planes
- drawVertices(self, z, axes)
- Draw vertices of the system
- effectiveFocalLengths(self)
- The effective focal lengths calculated from the power (C)
of the matrix.
Currently, it is assumed the index is n=1 on either side and
both focal lengths are the same.
- flipOrientation(self)
- We flip the element around (as in, we turn a lens around front-back).
This is useful for real elements and for groups. For individual objects,
it does not do anything because they are the same either way. However,
subclasses can override this function and act accordingly.
- focalDistances(self)
- Synonym of effectiveFocalLengths()
- focusPositions(self, z)
- Positions of both focal points on either side of the element.
Currently, it is assumed the index is n=1 on either side and both focal
distances are the same.
- forwardConjugate(self)
- 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. A positive distance means the image is "distance"
beyond the back of the element (or to the right, or after).
M2 = Space(distance)*M1
# M2.isImaging == True
- frontFocalLength(self)
- The focal lengths measured from the front vertex.
This is the distance between the surface and the focal point.
When the principal plane is not at the surface (which is usually
the case in anything except a thin lens), the back and front focal
lengths will be different from effective focal lengths. The effective
focal lengths is always measured from the principal planes, but the
BFL and FFL are measured from the vertices.
If the matrix is the result of the product of several matrices,
we may not know where the front and back vertices are. In that case,
we return None (or undefined).
Currently, it is assumed the index is n=1 on either side and
both focal distances are the same.
- hasFiniteApertureDiameter(self)
- True if the element or group of elements have a finite aperture size
- largestDiameter(self)
- Largest diameter of the element or group of elements
- magnification(self)
- mul_beam(self, rightSideBeam)
- Multiplication of a coherent beam with complex radius
of curvature q by a matrix.
- mul_matrix(self, rightSideMatrix)
- Multiplication of two matrices. Total length of the
elements is calculated. Apertures are lost. We compute
the first and last vertices.
- mul_ray(self, rightSideRay)
- Multiplication of a ray by a matrix. New position of
ray is updated by the physical length of the matrix.
If the ray is beyond the aperture diameter it is labelled
as "isBlocked = True" but can still propagate.
- pointsOfInterest(self, z)
- Any points of interest for this matrix (focal points,
principal planes etc...)
- principalPlanePositions(self, z)
- Positions of the input and output principal planes.
Currently, it is assumed the index is n=1 on either side.
- trace(self, ray)
- Returns a list of rays (i.e. a ray trace) for the input ray through the matrix.
Because we want to manage blockage by apertures, we need to perform a two-step process
for elements that have a finite, non-null length: where is the ray blocked exactly?
It can be blocked at the entrance, at the exit, or anywhere in between.
The aperture diameter for a finite-length element is constant across the length
of the element. We therefore check before entering the element and after having
propagated through the element. For now, this will suffice.
If the length is null, the ray is traced in a single step
- traceMany(self, inputRays)
- Trace each ray from a list from front edge of element to
the back edge.
Returns a list of ray traces for each input ray.
See trace().
- transferMatrices(self)
- The list of Matrix() that corresponds to the propagation through
this element (or group). For a Matrix(), it simply returns a list
with a single element [self].
For a MatrixGroup(), it returns the transferMatrices for
each individual element and appends each element to a list for this group.
- transferMatrix(self, upTo=inf)
- The Matrix() that corresponds to propagation from the edge
of the element (z=0) up to distance "upTo" (z=upTo). If no parameter is
provided, the transfer matrix will be from the front edge to the back edge.
If the element has a null thickness, the matrix representing the element
is returned.
Data descriptors inherited from Matrix:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
- determinant
- hasPower
- isImaging
- If B=0, then the matrix is from a conjugate plane to another
(i.e. object at the front edge and image at the back edge).
In this case, A = transverse magnification, D = angular magnification
As usual, C = -1/f (always).
Data and other attributes inherited from Matrix:
- __epsilon__ = 1e-05
|
class CurvedMirror(Matrix) |
| |
CurvedMirror(R, diameter=inf, label='')
A curved mirror of radius R and infinite or finite diameter |
| |
- Method resolution order:
- CurvedMirror
- Matrix
- builtins.object
Methods defined here:
- __init__(self, R, diameter=inf, label='')
- Initialize self. See help(type(self)) for accurate signature.
- pointsOfInterest(self, z)
- List of points of interest for this element as a dictionary:
'z':position
'label':the label to be used. Can include LaTeX math code.
Methods inherited from Matrix:
- __mul__(self, rightSide)
- Operator overloading allowing easy to read matrix multiplication
For instance, with M1 = Matrix() and M2 = Matrix(), one can write
M3 = M1*M2. With r = Ray(), one can apply the M1 transform to a ray
with r = M1*r
- __str__(self)
- String description that allows the use of print(Matrix())
- axesToDataScaling(self, axes)
- For drawing properly arrows and other things, sometimes
we need to draw along y in real space but in x in relative space
(i.e. relative to the width of the graph, not x coordinates).
There are transforms in matplotlib, but only between axes-display,
and data-display, not between data-axes. Here we obtain the scaling
so we can set arrow properties intelligently
- backFocalLength(self)
- The focal lengths measured from the back vertex.
This is the distance between the surface and the focal point.
When the principal plane is not at the surface (which is usually
the case in anything except a thin lens), the back and front focal
lengths will be different from effective focal lengths. The effective
focal lengths is always measured from the principal planes, but the
BFL and FFL are measured from the vertex.
If the matrix is the result of the product of several matrices,
we may not know where the front and back vertices are. In that case,
we return None (or undefined).
Currently, it is assumed the index is n=1 on either side and
both focal distances are the same.
- backwardConjugate(self)
- 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. A positive distance means the
object is "distance" in front of the element (or to the
left, or before).
M2 = M1*Space(distance)
# M2.isImaging == True
- display(self)
- Display this component, without any ray tracing but with
all of its cardinal points and planes. If the component has no
power (i.e. C == 0) this will fail.
- displayHalfHeight(self)
- A reasonable height for display purposes for
an element, whether it is infinite or not.
If the element is infinite, currently the half-height
will be '4'. If not, it is the apertureDiameter/2.
- drawAperture(self, z, axes)
- Draw the aperture size for this element. Any element may
have a finite aperture size, so this function is general for all elements.
- drawAt(self, z, axes, showLabels=False)
- Draw element on plot with starting edge at 'z'.
Default is a black box of appropriate length.
- drawCardinalPoints(self, z, axes)
- Draw the focal points of a thin lens as black dots
- drawLabels(self, z, axes)
- Draw element labels on plot with starting edge at 'z'.
Labels are drawn 50% above the display height
- drawPointsOfInterest(self, z, axes)
- Labels of general points of interest are drawn below the
axis, at 25% of the largest diameter.
- drawPrincipalPlanes(self, z, axes)
- Draw the principal planes
- drawVertices(self, z, axes)
- Draw vertices of the system
- effectiveFocalLengths(self)
- The effective focal lengths calculated from the power (C)
of the matrix.
Currently, it is assumed the index is n=1 on either side and
both focal lengths are the same.
- flipOrientation(self)
- We flip the element around (as in, we turn a lens around front-back).
This is useful for real elements and for groups. For individual objects,
it does not do anything because they are the same either way. However,
subclasses can override this function and act accordingly.
- focalDistances(self)
- Synonym of effectiveFocalLengths()
- focusPositions(self, z)
- Positions of both focal points on either side of the element.
Currently, it is assumed the index is n=1 on either side and both focal
distances are the same.
- forwardConjugate(self)
- 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. A positive distance means the image is "distance"
beyond the back of the element (or to the right, or after).
M2 = Space(distance)*M1
# M2.isImaging == True
- frontFocalLength(self)
- The focal lengths measured from the front vertex.
This is the distance between the surface and the focal point.
When the principal plane is not at the surface (which is usually
the case in anything except a thin lens), the back and front focal
lengths will be different from effective focal lengths. The effective
focal lengths is always measured from the principal planes, but the
BFL and FFL are measured from the vertices.
If the matrix is the result of the product of several matrices,
we may not know where the front and back vertices are. In that case,
we return None (or undefined).
Currently, it is assumed the index is n=1 on either side and
both focal distances are the same.
- hasFiniteApertureDiameter(self)
- True if the element or group of elements have a finite aperture size
- largestDiameter(self)
- Largest diameter of the element or group of elements
- magnification(self)
- mul_beam(self, rightSideBeam)
- Multiplication of a coherent beam with complex radius
of curvature q by a matrix.
- mul_matrix(self, rightSideMatrix)
- Multiplication of two matrices. Total length of the
elements is calculated. Apertures are lost. We compute
the first and last vertices.
- mul_ray(self, rightSideRay)
- Multiplication of a ray by a matrix. New position of
ray is updated by the physical length of the matrix.
If the ray is beyond the aperture diameter it is labelled
as "isBlocked = True" but can still propagate.
- principalPlanePositions(self, z)
- Positions of the input and output principal planes.
Currently, it is assumed the index is n=1 on either side.
- trace(self, ray)
- Returns a list of rays (i.e. a ray trace) for the input ray through the matrix.
Because we want to manage blockage by apertures, we need to perform a two-step process
for elements that have a finite, non-null length: where is the ray blocked exactly?
It can be blocked at the entrance, at the exit, or anywhere in between.
The aperture diameter for a finite-length element is constant across the length
of the element. We therefore check before entering the element and after having
propagated through the element. For now, this will suffice.
If the length is null, the ray is traced in a single step
- traceMany(self, inputRays)
- Trace each ray from a list from front edge of element to
the back edge.
Returns a list of ray traces for each input ray.
See trace().
- transferMatrices(self)
- The list of Matrix() that corresponds to the propagation through
this element (or group). For a Matrix(), it simply returns a list
with a single element [self].
For a MatrixGroup(), it returns the transferMatrices for
each individual element and appends each element to a list for this group.
- transferMatrix(self, upTo=inf)
- The Matrix() that corresponds to propagation from the edge
of the element (z=0) up to distance "upTo" (z=upTo). If no parameter is
provided, the transfer matrix will be from the front edge to the back edge.
If the element has a null thickness, the matrix representing the element
is returned.
Data descriptors inherited from Matrix:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
- determinant
- hasPower
- isImaging
- If B=0, then the matrix is from a conjugate plane to another
(i.e. object at the front edge and image at the back edge).
In this case, A = transverse magnification, D = angular magnification
As usual, C = -1/f (always).
Data and other attributes inherited from Matrix:
- __epsilon__ = 1e-05
|
class DielectricInterface(Matrix) |
| |
DielectricInterface(n1, n2, R=inf, diameter=inf, label='')
A dielectric interface of radius R, with an index n1 before and n2
after the interface
A convex interface from the perspective of the ray has R > 0 |
| |
- Method resolution order:
- DielectricInterface
- Matrix
- builtins.object
Methods defined here:
- __init__(self, n1, n2, R=inf, diameter=inf, label='')
- Initialize self. See help(type(self)) for accurate signature.
- drawAt(self, z, axes, showLabels=False)
- Draw a curved surface starting at 'z'.
We are not able yet to determine the color to fill with.
It is possible to draw a
quadratic bezier curve that looks like an arc, see:
https://pomax.github.io/bezierinfo/#circles_cubic
- flipOrientation(self)
- We flip the element around (as in, we turn a lens around front-back).
This is useful for real elements and for groups. For individual objects,
it does not do anything because they are the same either way. However,
subclasses can override this function and act accordingly.
Methods inherited from Matrix:
- __mul__(self, rightSide)
- Operator overloading allowing easy to read matrix multiplication
For instance, with M1 = Matrix() and M2 = Matrix(), one can write
M3 = M1*M2. With r = Ray(), one can apply the M1 transform to a ray
with r = M1*r
- __str__(self)
- String description that allows the use of print(Matrix())
- axesToDataScaling(self, axes)
- For drawing properly arrows and other things, sometimes
we need to draw along y in real space but in x in relative space
(i.e. relative to the width of the graph, not x coordinates).
There are transforms in matplotlib, but only between axes-display,
and data-display, not between data-axes. Here we obtain the scaling
so we can set arrow properties intelligently
- backFocalLength(self)
- The focal lengths measured from the back vertex.
This is the distance between the surface and the focal point.
When the principal plane is not at the surface (which is usually
the case in anything except a thin lens), the back and front focal
lengths will be different from effective focal lengths. The effective
focal lengths is always measured from the principal planes, but the
BFL and FFL are measured from the vertex.
If the matrix is the result of the product of several matrices,
we may not know where the front and back vertices are. In that case,
we return None (or undefined).
Currently, it is assumed the index is n=1 on either side and
both focal distances are the same.
- backwardConjugate(self)
- 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. A positive distance means the
object is "distance" in front of the element (or to the
left, or before).
M2 = M1*Space(distance)
# M2.isImaging == True
- display(self)
- Display this component, without any ray tracing but with
all of its cardinal points and planes. If the component has no
power (i.e. C == 0) this will fail.
- displayHalfHeight(self)
- A reasonable height for display purposes for
an element, whether it is infinite or not.
If the element is infinite, currently the half-height
will be '4'. If not, it is the apertureDiameter/2.
- drawAperture(self, z, axes)
- Draw the aperture size for this element. Any element may
have a finite aperture size, so this function is general for all elements.
- drawCardinalPoints(self, z, axes)
- Draw the focal points of a thin lens as black dots
- drawLabels(self, z, axes)
- Draw element labels on plot with starting edge at 'z'.
Labels are drawn 50% above the display height
- drawPointsOfInterest(self, z, axes)
- Labels of general points of interest are drawn below the
axis, at 25% of the largest diameter.
- drawPrincipalPlanes(self, z, axes)
- Draw the principal planes
- drawVertices(self, z, axes)
- Draw vertices of the system
- effectiveFocalLengths(self)
- The effective focal lengths calculated from the power (C)
of the matrix.
Currently, it is assumed the index is n=1 on either side and
both focal lengths are the same.
- focalDistances(self)
- Synonym of effectiveFocalLengths()
- focusPositions(self, z)
- Positions of both focal points on either side of the element.
Currently, it is assumed the index is n=1 on either side and both focal
distances are the same.
- forwardConjugate(self)
- 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. A positive distance means the image is "distance"
beyond the back of the element (or to the right, or after).
M2 = Space(distance)*M1
# M2.isImaging == True
- frontFocalLength(self)
- The focal lengths measured from the front vertex.
This is the distance between the surface and the focal point.
When the principal plane is not at the surface (which is usually
the case in anything except a thin lens), the back and front focal
lengths will be different from effective focal lengths. The effective
focal lengths is always measured from the principal planes, but the
BFL and FFL are measured from the vertices.
If the matrix is the result of the product of several matrices,
we may not know where the front and back vertices are. In that case,
we return None (or undefined).
Currently, it is assumed the index is n=1 on either side and
both focal distances are the same.
- hasFiniteApertureDiameter(self)
- True if the element or group of elements have a finite aperture size
- largestDiameter(self)
- Largest diameter of the element or group of elements
- magnification(self)
- mul_beam(self, rightSideBeam)
- Multiplication of a coherent beam with complex radius
of curvature q by a matrix.
- mul_matrix(self, rightSideMatrix)
- Multiplication of two matrices. Total length of the
elements is calculated. Apertures are lost. We compute
the first and last vertices.
- mul_ray(self, rightSideRay)
- Multiplication of a ray by a matrix. New position of
ray is updated by the physical length of the matrix.
If the ray is beyond the aperture diameter it is labelled
as "isBlocked = True" but can still propagate.
- pointsOfInterest(self, z)
- Any points of interest for this matrix (focal points,
principal planes etc...)
- principalPlanePositions(self, z)
- Positions of the input and output principal planes.
Currently, it is assumed the index is n=1 on either side.
- trace(self, ray)
- Returns a list of rays (i.e. a ray trace) for the input ray through the matrix.
Because we want to manage blockage by apertures, we need to perform a two-step process
for elements that have a finite, non-null length: where is the ray blocked exactly?
It can be blocked at the entrance, at the exit, or anywhere in between.
The aperture diameter for a finite-length element is constant across the length
of the element. We therefore check before entering the element and after having
propagated through the element. For now, this will suffice.
If the length is null, the ray is traced in a single step
- traceMany(self, inputRays)
- Trace each ray from a list from front edge of element to
the back edge.
Returns a list of ray traces for each input ray.
See trace().
- transferMatrices(self)
- The list of Matrix() that corresponds to the propagation through
this element (or group). For a Matrix(), it simply returns a list
with a single element [self].
For a MatrixGroup(), it returns the transferMatrices for
each individual element and appends each element to a list for this group.
- transferMatrix(self, upTo=inf)
- The Matrix() that corresponds to propagation from the edge
of the element (z=0) up to distance "upTo" (z=upTo). If no parameter is
provided, the transfer matrix will be from the front edge to the back edge.
If the element has a null thickness, the matrix representing the element
is returned.
Data descriptors inherited from Matrix:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
- determinant
- hasPower
- isImaging
- If B=0, then the matrix is from a conjugate plane to another
(i.e. object at the front edge and image at the back edge).
In this case, A = transverse magnification, D = angular magnification
As usual, C = -1/f (always).
Data and other attributes inherited from Matrix:
- __epsilon__ = 1e-05
|
class DielectricSlab(ThickLens) |
| |
DielectricSlab(n, thickness, diameter=inf, label='')
A slab of dielectric material of index n and length d, with flat faces |
| |
- Method resolution order:
- DielectricSlab
- ThickLens
- Matrix
- builtins.object
Methods defined here:
- __init__(self, n, thickness, diameter=inf, label='')
- Initialize self. See help(type(self)) for accurate signature.
- drawAt(self, z, axes, showLabels=False)
- Draw a faint blue box of length L starting at 'z'.
Methods inherited from ThickLens:
- drawAperture(self, z, axes)
- Draw the aperture size for this element.
The thick lens requires special care because the corners are not
separated by self.L: the curvature makes the edges shorter.
We are picky and draw it right.
- pointsOfInterest(self, z)
- List of points of interest for this element as a dictionary:
'z':position
'label':the label to be used. Can include LaTeX math code.
Methods inherited from Matrix:
- __mul__(self, rightSide)
- Operator overloading allowing easy to read matrix multiplication
For instance, with M1 = Matrix() and M2 = Matrix(), one can write
M3 = M1*M2. With r = Ray(), one can apply the M1 transform to a ray
with r = M1*r
- __str__(self)
- String description that allows the use of print(Matrix())
- axesToDataScaling(self, axes)
- For drawing properly arrows and other things, sometimes
we need to draw along y in real space but in x in relative space
(i.e. relative to the width of the graph, not x coordinates).
There are transforms in matplotlib, but only between axes-display,
and data-display, not between data-axes. Here we obtain the scaling
so we can set arrow properties intelligently
- backFocalLength(self)
- The focal lengths measured from the back vertex.
This is the distance between the surface and the focal point.
When the principal plane is not at the surface (which is usually
the case in anything except a thin lens), the back and front focal
lengths will be different from effective focal lengths. The effective
focal lengths is always measured from the principal planes, but the
BFL and FFL are measured from the vertex.
If the matrix is the result of the product of several matrices,
we may not know where the front and back vertices are. In that case,
we return None (or undefined).
Currently, it is assumed the index is n=1 on either side and
both focal distances are the same.
- backwardConjugate(self)
- 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. A positive distance means the
object is "distance" in front of the element (or to the
left, or before).
M2 = M1*Space(distance)
# M2.isImaging == True
- display(self)
- Display this component, without any ray tracing but with
all of its cardinal points and planes. If the component has no
power (i.e. C == 0) this will fail.
- displayHalfHeight(self)
- A reasonable height for display purposes for
an element, whether it is infinite or not.
If the element is infinite, currently the half-height
will be '4'. If not, it is the apertureDiameter/2.
- drawCardinalPoints(self, z, axes)
- Draw the focal points of a thin lens as black dots
- drawLabels(self, z, axes)
- Draw element labels on plot with starting edge at 'z'.
Labels are drawn 50% above the display height
- drawPointsOfInterest(self, z, axes)
- Labels of general points of interest are drawn below the
axis, at 25% of the largest diameter.
- drawPrincipalPlanes(self, z, axes)
- Draw the principal planes
- drawVertices(self, z, axes)
- Draw vertices of the system
- effectiveFocalLengths(self)
- The effective focal lengths calculated from the power (C)
of the matrix.
Currently, it is assumed the index is n=1 on either side and
both focal lengths are the same.
- flipOrientation(self)
- We flip the element around (as in, we turn a lens around front-back).
This is useful for real elements and for groups. For individual objects,
it does not do anything because they are the same either way. However,
subclasses can override this function and act accordingly.
- focalDistances(self)
- Synonym of effectiveFocalLengths()
- focusPositions(self, z)
- Positions of both focal points on either side of the element.
Currently, it is assumed the index is n=1 on either side and both focal
distances are the same.
- forwardConjugate(self)
- 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. A positive distance means the image is "distance"
beyond the back of the element (or to the right, or after).
M2 = Space(distance)*M1
# M2.isImaging == True
- frontFocalLength(self)
- The focal lengths measured from the front vertex.
This is the distance between the surface and the focal point.
When the principal plane is not at the surface (which is usually
the case in anything except a thin lens), the back and front focal
lengths will be different from effective focal lengths. The effective
focal lengths is always measured from the principal planes, but the
BFL and FFL are measured from the vertices.
If the matrix is the result of the product of several matrices,
we may not know where the front and back vertices are. In that case,
we return None (or undefined).
Currently, it is assumed the index is n=1 on either side and
both focal distances are the same.
- hasFiniteApertureDiameter(self)
- True if the element or group of elements have a finite aperture size
- largestDiameter(self)
- Largest diameter of the element or group of elements
- magnification(self)
- mul_beam(self, rightSideBeam)
- Multiplication of a coherent beam with complex radius
of curvature q by a matrix.
- mul_matrix(self, rightSideMatrix)
- Multiplication of two matrices. Total length of the
elements is calculated. Apertures are lost. We compute
the first and last vertices.
- mul_ray(self, rightSideRay)
- Multiplication of a ray by a matrix. New position of
ray is updated by the physical length of the matrix.
If the ray is beyond the aperture diameter it is labelled
as "isBlocked = True" but can still propagate.
- principalPlanePositions(self, z)
- Positions of the input and output principal planes.
Currently, it is assumed the index is n=1 on either side.
- trace(self, ray)
- Returns a list of rays (i.e. a ray trace) for the input ray through the matrix.
Because we want to manage blockage by apertures, we need to perform a two-step process
for elements that have a finite, non-null length: where is the ray blocked exactly?
It can be blocked at the entrance, at the exit, or anywhere in between.
The aperture diameter for a finite-length element is constant across the length
of the element. We therefore check before entering the element and after having
propagated through the element. For now, this will suffice.
If the length is null, the ray is traced in a single step
- traceMany(self, inputRays)
- Trace each ray from a list from front edge of element to
the back edge.
Returns a list of ray traces for each input ray.
See trace().
- transferMatrices(self)
- The list of Matrix() that corresponds to the propagation through
this element (or group). For a Matrix(), it simply returns a list
with a single element [self].
For a MatrixGroup(), it returns the transferMatrices for
each individual element and appends each element to a list for this group.
- transferMatrix(self, upTo=inf)
- The Matrix() that corresponds to propagation from the edge
of the element (z=0) up to distance "upTo" (z=upTo). If no parameter is
provided, the transfer matrix will be from the front edge to the back edge.
If the element has a null thickness, the matrix representing the element
is returned.
Data descriptors inherited from Matrix:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
- determinant
- hasPower
- isImaging
- If B=0, then the matrix is from a conjugate plane to another
(i.e. object at the front edge and image at the back edge).
In this case, A = transverse magnification, D = angular magnification
As usual, C = -1/f (always).
Data and other attributes inherited from Matrix:
- __epsilon__ = 1e-05
|
class Lens(Matrix) |
| |
Lens(f, diameter=inf, label='')
A thin lens of focal f, null thickness and infinite or finite diameter |
| |
- Method resolution order:
- Lens
- Matrix
- builtins.object
Methods defined here:
- __init__(self, f, diameter=inf, label='')
- Initialize self. See help(type(self)) for accurate signature.
- drawAt(self, z, axes, showLabels=False)
- Draw a thin lens at z
- pointsOfInterest(self, z)
- List of points of interest for this element as a dictionary:
'z':position
'label':the label to be used. Can include LaTeX math code.
Methods inherited from Matrix:
- __mul__(self, rightSide)
- Operator overloading allowing easy to read matrix multiplication
For instance, with M1 = Matrix() and M2 = Matrix(), one can write
M3 = M1*M2. With r = Ray(), one can apply the M1 transform to a ray
with r = M1*r
- __str__(self)
- String description that allows the use of print(Matrix())
- axesToDataScaling(self, axes)
- For drawing properly arrows and other things, sometimes
we need to draw along y in real space but in x in relative space
(i.e. relative to the width of the graph, not x coordinates).
There are transforms in matplotlib, but only between axes-display,
and data-display, not between data-axes. Here we obtain the scaling
so we can set arrow properties intelligently
- backFocalLength(self)
- The focal lengths measured from the back vertex.
This is the distance between the surface and the focal point.
When the principal plane is not at the surface (which is usually
the case in anything except a thin lens), the back and front focal
lengths will be different from effective focal lengths. The effective
focal lengths is always measured from the principal planes, but the
BFL and FFL are measured from the vertex.
If the matrix is the result of the product of several matrices,
we may not know where the front and back vertices are. In that case,
we return None (or undefined).
Currently, it is assumed the index is n=1 on either side and
both focal distances are the same.
- backwardConjugate(self)
- 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. A positive distance means the
object is "distance" in front of the element (or to the
left, or before).
M2 = M1*Space(distance)
# M2.isImaging == True
- display(self)
- Display this component, without any ray tracing but with
all of its cardinal points and planes. If the component has no
power (i.e. C == 0) this will fail.
- displayHalfHeight(self)
- A reasonable height for display purposes for
an element, whether it is infinite or not.
If the element is infinite, currently the half-height
will be '4'. If not, it is the apertureDiameter/2.
- drawAperture(self, z, axes)
- Draw the aperture size for this element. Any element may
have a finite aperture size, so this function is general for all elements.
- drawCardinalPoints(self, z, axes)
- Draw the focal points of a thin lens as black dots
- drawLabels(self, z, axes)
- Draw element labels on plot with starting edge at 'z'.
Labels are drawn 50% above the display height
- drawPointsOfInterest(self, z, axes)
- Labels of general points of interest are drawn below the
axis, at 25% of the largest diameter.
- drawPrincipalPlanes(self, z, axes)
- Draw the principal planes
- drawVertices(self, z, axes)
- Draw vertices of the system
- effectiveFocalLengths(self)
- The effective focal lengths calculated from the power (C)
of the matrix.
Currently, it is assumed the index is n=1 on either side and
both focal lengths are the same.
- flipOrientation(self)
- We flip the element around (as in, we turn a lens around front-back).
This is useful for real elements and for groups. For individual objects,
it does not do anything because they are the same either way. However,
subclasses can override this function and act accordingly.
- focalDistances(self)
- Synonym of effectiveFocalLengths()
- focusPositions(self, z)
- Positions of both focal points on either side of the element.
Currently, it is assumed the index is n=1 on either side and both focal
distances are the same.
- forwardConjugate(self)
- 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. A positive distance means the image is "distance"
beyond the back of the element (or to the right, or after).
M2 = Space(distance)*M1
# M2.isImaging == True
- frontFocalLength(self)
- The focal lengths measured from the front vertex.
This is the distance between the surface and the focal point.
When the principal plane is not at the surface (which is usually
the case in anything except a thin lens), the back and front focal
lengths will be different from effective focal lengths. The effective
focal lengths is always measured from the principal planes, but the
BFL and FFL are measured from the vertices.
If the matrix is the result of the product of several matrices,
we may not know where the front and back vertices are. In that case,
we return None (or undefined).
Currently, it is assumed the index is n=1 on either side and
both focal distances are the same.
- hasFiniteApertureDiameter(self)
- True if the element or group of elements have a finite aperture size
- largestDiameter(self)
- Largest diameter of the element or group of elements
- magnification(self)
- mul_beam(self, rightSideBeam)
- Multiplication of a coherent beam with complex radius
of curvature q by a matrix.
- mul_matrix(self, rightSideMatrix)
- Multiplication of two matrices. Total length of the
elements is calculated. Apertures are lost. We compute
the first and last vertices.
- mul_ray(self, rightSideRay)
- Multiplication of a ray by a matrix. New position of
ray is updated by the physical length of the matrix.
If the ray is beyond the aperture diameter it is labelled
as "isBlocked = True" but can still propagate.
- principalPlanePositions(self, z)
- Positions of the input and output principal planes.
Currently, it is assumed the index is n=1 on either side.
- trace(self, ray)
- Returns a list of rays (i.e. a ray trace) for the input ray through the matrix.
Because we want to manage blockage by apertures, we need to perform a two-step process
for elements that have a finite, non-null length: where is the ray blocked exactly?
It can be blocked at the entrance, at the exit, or anywhere in between.
The aperture diameter for a finite-length element is constant across the length
of the element. We therefore check before entering the element and after having
propagated through the element. For now, this will suffice.
If the length is null, the ray is traced in a single step
- traceMany(self, inputRays)
- Trace each ray from a list from front edge of element to
the back edge.
Returns a list of ray traces for each input ray.
See trace().
- transferMatrices(self)
- The list of Matrix() that corresponds to the propagation through
this element (or group). For a Matrix(), it simply returns a list
with a single element [self].
For a MatrixGroup(), it returns the transferMatrices for
each individual element and appends each element to a list for this group.
- transferMatrix(self, upTo=inf)
- The Matrix() that corresponds to propagation from the edge
of the element (z=0) up to distance "upTo" (z=upTo). If no parameter is
provided, the transfer matrix will be from the front edge to the back edge.
If the element has a null thickness, the matrix representing the element
is returned.
Data descriptors inherited from Matrix:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
- determinant
- hasPower
- isImaging
- If B=0, then the matrix is from a conjugate plane to another
(i.e. object at the front edge and image at the back edge).
In this case, A = transverse magnification, D = angular magnification
As usual, C = -1/f (always).
Data and other attributes inherited from Matrix:
- __epsilon__ = 1e-05
|
class Matrix(builtins.object) |
| |
Matrix(A: float = 1, B: float = 0, C: float = 0, D: float = 1, physicalLength: float = 0, frontVertex=None, backVertex=None, frontIndex=1.0, backIndex=1.0, apertureDiameter=inf, label='')
A matrix and an optical element that can transform a ray or another
matrix.
The general properties (A,B,C,D) are defined here. The operator "*" is
overloaded to allow simple statements such as:
ray2 = M1 * ray
or
M3 = M2 * M1
The physical length is included in the matrix to allow simple management of
the ray tracing. IF two matrices are multiplied, the resulting matrice
will have a physical length that is the sum of both matrices.
In addition finite apertures are considered: if the apertureDiameter
is not infinite (default), then the object is assumed to limit the
ray height to plus or minus apertureDiameter/2 from the front edge to the back
edge of the element. |
| |
Methods defined here:
- __init__(self, A: float = 1, B: float = 0, C: float = 0, D: float = 1, physicalLength: float = 0, frontVertex=None, backVertex=None, frontIndex=1.0, backIndex=1.0, apertureDiameter=inf, label='')
- Initialize self. See help(type(self)) for accurate signature.
- __mul__(self, rightSide)
- Operator overloading allowing easy to read matrix multiplication
For instance, with M1 = Matrix() and M2 = Matrix(), one can write
M3 = M1*M2. With r = Ray(), one can apply the M1 transform to a ray
with r = M1*r
- __str__(self)
- String description that allows the use of print(Matrix())
- axesToDataScaling(self, axes)
- For drawing properly arrows and other things, sometimes
we need to draw along y in real space but in x in relative space
(i.e. relative to the width of the graph, not x coordinates).
There are transforms in matplotlib, but only between axes-display,
and data-display, not between data-axes. Here we obtain the scaling
so we can set arrow properties intelligently
- backFocalLength(self)
- The focal lengths measured from the back vertex.
This is the distance between the surface and the focal point.
When the principal plane is not at the surface (which is usually
the case in anything except a thin lens), the back and front focal
lengths will be different from effective focal lengths. The effective
focal lengths is always measured from the principal planes, but the
BFL and FFL are measured from the vertex.
If the matrix is the result of the product of several matrices,
we may not know where the front and back vertices are. In that case,
we return None (or undefined).
Currently, it is assumed the index is n=1 on either side and
both focal distances are the same.
- backwardConjugate(self)
- 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. A positive distance means the
object is "distance" in front of the element (or to the
left, or before).
M2 = M1*Space(distance)
# M2.isImaging == True
- display(self)
- Display this component, without any ray tracing but with
all of its cardinal points and planes. If the component has no
power (i.e. C == 0) this will fail.
- displayHalfHeight(self)
- A reasonable height for display purposes for
an element, whether it is infinite or not.
If the element is infinite, currently the half-height
will be '4'. If not, it is the apertureDiameter/2.
- drawAperture(self, z, axes)
- Draw the aperture size for this element. Any element may
have a finite aperture size, so this function is general for all elements.
- drawAt(self, z, axes, showLabels=False)
- Draw element on plot with starting edge at 'z'.
Default is a black box of appropriate length.
- drawCardinalPoints(self, z, axes)
- Draw the focal points of a thin lens as black dots
- drawLabels(self, z, axes)
- Draw element labels on plot with starting edge at 'z'.
Labels are drawn 50% above the display height
- drawPointsOfInterest(self, z, axes)
- Labels of general points of interest are drawn below the
axis, at 25% of the largest diameter.
- drawPrincipalPlanes(self, z, axes)
- Draw the principal planes
- drawVertices(self, z, axes)
- Draw vertices of the system
- effectiveFocalLengths(self)
- The effective focal lengths calculated from the power (C)
of the matrix.
Currently, it is assumed the index is n=1 on either side and
both focal lengths are the same.
- flipOrientation(self)
- We flip the element around (as in, we turn a lens around front-back).
This is useful for real elements and for groups. For individual objects,
it does not do anything because they are the same either way. However,
subclasses can override this function and act accordingly.
- focalDistances(self)
- Synonym of effectiveFocalLengths()
- focusPositions(self, z)
- Positions of both focal points on either side of the element.
Currently, it is assumed the index is n=1 on either side and both focal
distances are the same.
- forwardConjugate(self)
- 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. A positive distance means the image is "distance"
beyond the back of the element (or to the right, or after).
M2 = Space(distance)*M1
# M2.isImaging == True
- frontFocalLength(self)
- The focal lengths measured from the front vertex.
This is the distance between the surface and the focal point.
When the principal plane is not at the surface (which is usually
the case in anything except a thin lens), the back and front focal
lengths will be different from effective focal lengths. The effective
focal lengths is always measured from the principal planes, but the
BFL and FFL are measured from the vertices.
If the matrix is the result of the product of several matrices,
we may not know where the front and back vertices are. In that case,
we return None (or undefined).
Currently, it is assumed the index is n=1 on either side and
both focal distances are the same.
- hasFiniteApertureDiameter(self)
- True if the element or group of elements have a finite aperture size
- largestDiameter(self)
- Largest diameter of the element or group of elements
- magnification(self)
- mul_beam(self, rightSideBeam)
- Multiplication of a coherent beam with complex radius
of curvature q by a matrix.
- mul_matrix(self, rightSideMatrix)
- Multiplication of two matrices. Total length of the
elements is calculated. Apertures are lost. We compute
the first and last vertices.
- mul_ray(self, rightSideRay)
- Multiplication of a ray by a matrix. New position of
ray is updated by the physical length of the matrix.
If the ray is beyond the aperture diameter it is labelled
as "isBlocked = True" but can still propagate.
- pointsOfInterest(self, z)
- Any points of interest for this matrix (focal points,
principal planes etc...)
- principalPlanePositions(self, z)
- Positions of the input and output principal planes.
Currently, it is assumed the index is n=1 on either side.
- trace(self, ray)
- Returns a list of rays (i.e. a ray trace) for the input ray through the matrix.
Because we want to manage blockage by apertures, we need to perform a two-step process
for elements that have a finite, non-null length: where is the ray blocked exactly?
It can be blocked at the entrance, at the exit, or anywhere in between.
The aperture diameter for a finite-length element is constant across the length
of the element. We therefore check before entering the element and after having
propagated through the element. For now, this will suffice.
If the length is null, the ray is traced in a single step
- traceMany(self, inputRays)
- Trace each ray from a list from front edge of element to
the back edge.
Returns a list of ray traces for each input ray.
See trace().
- transferMatrices(self)
- The list of Matrix() that corresponds to the propagation through
this element (or group). For a Matrix(), it simply returns a list
with a single element [self].
For a MatrixGroup(), it returns the transferMatrices for
each individual element and appends each element to a list for this group.
- transferMatrix(self, upTo=inf)
- The Matrix() that corresponds to propagation from the edge
of the element (z=0) up to distance "upTo" (z=upTo). If no parameter is
provided, the transfer matrix will be from the front edge to the back edge.
If the element has a null thickness, the matrix representing the element
is returned.
Data descriptors defined here:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
- determinant
- hasPower
- isImaging
- If B=0, then the matrix is from a conjugate plane to another
(i.e. object at the front edge and image at the back edge).
In this case, A = transverse magnification, D = angular magnification
As usual, C = -1/f (always).
Data and other attributes defined here:
- __epsilon__ = 1e-05
|
class Space(Matrix) |
| |
Space(d, n=1, diameter=inf, label='')
Free space of length d |
| |
- Method resolution order:
- Space
- Matrix
- builtins.object
Methods defined here:
- __init__(self, d, n=1, diameter=inf, label='')
- Initialize self. See help(type(self)) for accurate signature.
- drawAt(self, z, axes, showLabels=False)
- Draw nothing because free space is nothing.
- transferMatrix(self, upTo=inf)
- Returns a Matrix() corresponding to a partial propagation
if the requested distance is smaller than the length of this element
Methods inherited from Matrix:
- __mul__(self, rightSide)
- Operator overloading allowing easy to read matrix multiplication
For instance, with M1 = Matrix() and M2 = Matrix(), one can write
M3 = M1*M2. With r = Ray(), one can apply the M1 transform to a ray
with r = M1*r
- __str__(self)
- String description that allows the use of print(Matrix())
- axesToDataScaling(self, axes)
- For drawing properly arrows and other things, sometimes
we need to draw along y in real space but in x in relative space
(i.e. relative to the width of the graph, not x coordinates).
There are transforms in matplotlib, but only between axes-display,
and data-display, not between data-axes. Here we obtain the scaling
so we can set arrow properties intelligently
- backFocalLength(self)
- The focal lengths measured from the back vertex.
This is the distance between the surface and the focal point.
When the principal plane is not at the surface (which is usually
the case in anything except a thin lens), the back and front focal
lengths will be different from effective focal lengths. The effective
focal lengths is always measured from the principal planes, but the
BFL and FFL are measured from the vertex.
If the matrix is the result of the product of several matrices,
we may not know where the front and back vertices are. In that case,
we return None (or undefined).
Currently, it is assumed the index is n=1 on either side and
both focal distances are the same.
- backwardConjugate(self)
- 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. A positive distance means the
object is "distance" in front of the element (or to the
left, or before).
M2 = M1*Space(distance)
# M2.isImaging == True
- display(self)
- Display this component, without any ray tracing but with
all of its cardinal points and planes. If the component has no
power (i.e. C == 0) this will fail.
- displayHalfHeight(self)
- A reasonable height for display purposes for
an element, whether it is infinite or not.
If the element is infinite, currently the half-height
will be '4'. If not, it is the apertureDiameter/2.
- drawAperture(self, z, axes)
- Draw the aperture size for this element. Any element may
have a finite aperture size, so this function is general for all elements.
- drawCardinalPoints(self, z, axes)
- Draw the focal points of a thin lens as black dots
- drawLabels(self, z, axes)
- Draw element labels on plot with starting edge at 'z'.
Labels are drawn 50% above the display height
- drawPointsOfInterest(self, z, axes)
- Labels of general points of interest are drawn below the
axis, at 25% of the largest diameter.
- drawPrincipalPlanes(self, z, axes)
- Draw the principal planes
- drawVertices(self, z, axes)
- Draw vertices of the system
- effectiveFocalLengths(self)
- The effective focal lengths calculated from the power (C)
of the matrix.
Currently, it is assumed the index is n=1 on either side and
both focal lengths are the same.
- flipOrientation(self)
- We flip the element around (as in, we turn a lens around front-back).
This is useful for real elements and for groups. For individual objects,
it does not do anything because they are the same either way. However,
subclasses can override this function and act accordingly.
- focalDistances(self)
- Synonym of effectiveFocalLengths()
- focusPositions(self, z)
- Positions of both focal points on either side of the element.
Currently, it is assumed the index is n=1 on either side and both focal
distances are the same.
- forwardConjugate(self)
- 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. A positive distance means the image is "distance"
beyond the back of the element (or to the right, or after).
M2 = Space(distance)*M1
# M2.isImaging == True
- frontFocalLength(self)
- The focal lengths measured from the front vertex.
This is the distance between the surface and the focal point.
When the principal plane is not at the surface (which is usually
the case in anything except a thin lens), the back and front focal
lengths will be different from effective focal lengths. The effective
focal lengths is always measured from the principal planes, but the
BFL and FFL are measured from the vertices.
If the matrix is the result of the product of several matrices,
we may not know where the front and back vertices are. In that case,
we return None (or undefined).
Currently, it is assumed the index is n=1 on either side and
both focal distances are the same.
- hasFiniteApertureDiameter(self)
- True if the element or group of elements have a finite aperture size
- largestDiameter(self)
- Largest diameter of the element or group of elements
- magnification(self)
- mul_beam(self, rightSideBeam)
- Multiplication of a coherent beam with complex radius
of curvature q by a matrix.
- mul_matrix(self, rightSideMatrix)
- Multiplication of two matrices. Total length of the
elements is calculated. Apertures are lost. We compute
the first and last vertices.
- mul_ray(self, rightSideRay)
- Multiplication of a ray by a matrix. New position of
ray is updated by the physical length of the matrix.
If the ray is beyond the aperture diameter it is labelled
as "isBlocked = True" but can still propagate.
- pointsOfInterest(self, z)
- Any points of interest for this matrix (focal points,
principal planes etc...)
- principalPlanePositions(self, z)
- Positions of the input and output principal planes.
Currently, it is assumed the index is n=1 on either side.
- trace(self, ray)
- Returns a list of rays (i.e. a ray trace) for the input ray through the matrix.
Because we want to manage blockage by apertures, we need to perform a two-step process
for elements that have a finite, non-null length: where is the ray blocked exactly?
It can be blocked at the entrance, at the exit, or anywhere in between.
The aperture diameter for a finite-length element is constant across the length
of the element. We therefore check before entering the element and after having
propagated through the element. For now, this will suffice.
If the length is null, the ray is traced in a single step
- traceMany(self, inputRays)
- Trace each ray from a list from front edge of element to
the back edge.
Returns a list of ray traces for each input ray.
See trace().
- transferMatrices(self)
- The list of Matrix() that corresponds to the propagation through
this element (or group). For a Matrix(), it simply returns a list
with a single element [self].
For a MatrixGroup(), it returns the transferMatrices for
each individual element and appends each element to a list for this group.
Data descriptors inherited from Matrix:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
- determinant
- hasPower
- isImaging
- If B=0, then the matrix is from a conjugate plane to another
(i.e. object at the front edge and image at the back edge).
In this case, A = transverse magnification, D = angular magnification
As usual, C = -1/f (always).
Data and other attributes inherited from Matrix:
- __epsilon__ = 1e-05
|
class ThickLens(Matrix) |
| |
ThickLens(n, R1, R2, thickness, diameter=inf, label='')
A thick lens of first radius R1 and then R2, with an index n
and length d
A biconvex lens has R1 > 0 and R2 < 0. |
| |
- Method resolution order:
- ThickLens
- Matrix
- builtins.object
Methods defined here:
- __init__(self, n, R1, R2, thickness, diameter=inf, label='')
- Initialize self. See help(type(self)) for accurate signature.
- drawAperture(self, z, axes)
- Draw the aperture size for this element.
The thick lens requires special care because the corners are not
separated by self.L: the curvature makes the edges shorter.
We are picky and draw it right.
- drawAt(self, z, axes, showLabels=False)
- Draw a faint blue box with slightly curved interfaces
of length 'thickness' starting at 'z'.
An arc would be perfect, but matplotlib does not allow to fill
an arc, hence we must use a patch and Bezier curve.
We might as well draw it properly: it is possible to draw a
quadratic bezier curve that looks like an arc, see:
https://pomax.github.io/bezierinfo/#circles_cubic
- pointsOfInterest(self, z)
- List of points of interest for this element as a dictionary:
'z':position
'label':the label to be used. Can include LaTeX math code.
Methods inherited from Matrix:
- __mul__(self, rightSide)
- Operator overloading allowing easy to read matrix multiplication
For instance, with M1 = Matrix() and M2 = Matrix(), one can write
M3 = M1*M2. With r = Ray(), one can apply the M1 transform to a ray
with r = M1*r
- __str__(self)
- String description that allows the use of print(Matrix())
- axesToDataScaling(self, axes)
- For drawing properly arrows and other things, sometimes
we need to draw along y in real space but in x in relative space
(i.e. relative to the width of the graph, not x coordinates).
There are transforms in matplotlib, but only between axes-display,
and data-display, not between data-axes. Here we obtain the scaling
so we can set arrow properties intelligently
- backFocalLength(self)
- The focal lengths measured from the back vertex.
This is the distance between the surface and the focal point.
When the principal plane is not at the surface (which is usually
the case in anything except a thin lens), the back and front focal
lengths will be different from effective focal lengths. The effective
focal lengths is always measured from the principal planes, but the
BFL and FFL are measured from the vertex.
If the matrix is the result of the product of several matrices,
we may not know where the front and back vertices are. In that case,
we return None (or undefined).
Currently, it is assumed the index is n=1 on either side and
both focal distances are the same.
- backwardConjugate(self)
- 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. A positive distance means the
object is "distance" in front of the element (or to the
left, or before).
M2 = M1*Space(distance)
# M2.isImaging == True
- display(self)
- Display this component, without any ray tracing but with
all of its cardinal points and planes. If the component has no
power (i.e. C == 0) this will fail.
- displayHalfHeight(self)
- A reasonable height for display purposes for
an element, whether it is infinite or not.
If the element is infinite, currently the half-height
will be '4'. If not, it is the apertureDiameter/2.
- drawCardinalPoints(self, z, axes)
- Draw the focal points of a thin lens as black dots
- drawLabels(self, z, axes)
- Draw element labels on plot with starting edge at 'z'.
Labels are drawn 50% above the display height
- drawPointsOfInterest(self, z, axes)
- Labels of general points of interest are drawn below the
axis, at 25% of the largest diameter.
- drawPrincipalPlanes(self, z, axes)
- Draw the principal planes
- drawVertices(self, z, axes)
- Draw vertices of the system
- effectiveFocalLengths(self)
- The effective focal lengths calculated from the power (C)
of the matrix.
Currently, it is assumed the index is n=1 on either side and
both focal lengths are the same.
- flipOrientation(self)
- We flip the element around (as in, we turn a lens around front-back).
This is useful for real elements and for groups. For individual objects,
it does not do anything because they are the same either way. However,
subclasses can override this function and act accordingly.
- focalDistances(self)
- Synonym of effectiveFocalLengths()
- focusPositions(self, z)
- Positions of both focal points on either side of the element.
Currently, it is assumed the index is n=1 on either side and both focal
distances are the same.
- forwardConjugate(self)
- 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. A positive distance means the image is "distance"
beyond the back of the element (or to the right, or after).
M2 = Space(distance)*M1
# M2.isImaging == True
- frontFocalLength(self)
- The focal lengths measured from the front vertex.
This is the distance between the surface and the focal point.
When the principal plane is not at the surface (which is usually
the case in anything except a thin lens), the back and front focal
lengths will be different from effective focal lengths. The effective
focal lengths is always measured from the principal planes, but the
BFL and FFL are measured from the vertices.
If the matrix is the result of the product of several matrices,
we may not know where the front and back vertices are. In that case,
we return None (or undefined).
Currently, it is assumed the index is n=1 on either side and
both focal distances are the same.
- hasFiniteApertureDiameter(self)
- True if the element or group of elements have a finite aperture size
- largestDiameter(self)
- Largest diameter of the element or group of elements
- magnification(self)
- mul_beam(self, rightSideBeam)
- Multiplication of a coherent beam with complex radius
of curvature q by a matrix.
- mul_matrix(self, rightSideMatrix)
- Multiplication of two matrices. Total length of the
elements is calculated. Apertures are lost. We compute
the first and last vertices.
- mul_ray(self, rightSideRay)
- Multiplication of a ray by a matrix. New position of
ray is updated by the physical length of the matrix.
If the ray is beyond the aperture diameter it is labelled
as "isBlocked = True" but can still propagate.
- principalPlanePositions(self, z)
- Positions of the input and output principal planes.
Currently, it is assumed the index is n=1 on either side.
- trace(self, ray)
- Returns a list of rays (i.e. a ray trace) for the input ray through the matrix.
Because we want to manage blockage by apertures, we need to perform a two-step process
for elements that have a finite, non-null length: where is the ray blocked exactly?
It can be blocked at the entrance, at the exit, or anywhere in between.
The aperture diameter for a finite-length element is constant across the length
of the element. We therefore check before entering the element and after having
propagated through the element. For now, this will suffice.
If the length is null, the ray is traced in a single step
- traceMany(self, inputRays)
- Trace each ray from a list from front edge of element to
the back edge.
Returns a list of ray traces for each input ray.
See trace().
- transferMatrices(self)
- The list of Matrix() that corresponds to the propagation through
this element (or group). For a Matrix(), it simply returns a list
with a single element [self].
For a MatrixGroup(), it returns the transferMatrices for
each individual element and appends each element to a list for this group.
- transferMatrix(self, upTo=inf)
- The Matrix() that corresponds to propagation from the edge
of the element (z=0) up to distance "upTo" (z=upTo). If no parameter is
provided, the transfer matrix will be from the front edge to the back edge.
If the element has a null thickness, the matrix representing the element
is returned.
Data descriptors inherited from Matrix:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
- determinant
- hasPower
- isImaging
- If B=0, then the matrix is from a conjugate plane to another
(i.e. object at the front edge and image at the back edge).
In this case, A = transverse magnification, D = angular magnification
As usual, C = -1/f (always).
Data and other attributes inherited from Matrix:
- __epsilon__ = 1e-05
| |


Factory
public struct Factory<Configuration, Interface>
A simple factory based on Swift Callable API. It takes a closure and creates a callable struct that will invoke the closure. This allows you to create inline factories in your Boundaries.
-
Undocumented
Declaration
Swift
public init(construction: @escaping (Configuration) -> Interface)
-
Undocumented
Declaration
Swift
public func callAsFunction(configuration: Configuration) -> Interface


print.cc File Reference
(Revision: 6102)
#include "gecode/set.hh"
Go to the source code of this file.
Function Documentation
| std::ostream& operator<< |
( |
std::ostream & |
os, |
|
|
const SetVarImp & |
x | |
|
) |
| | |
| std::ostream& operator<< |
( |
std::ostream & |
os, |
|
|
const SetView & |
x | |
|
) |
| | [related] |
| std::ostream& operator<< |
( |
std::ostream & |
os, |
|
|
const EmptyView & |
| |
|
) |
| | [related] |
| std::ostream& operator<< |
( |
std::ostream & |
os, |
|
|
const UniverseView & |
| |
|
) |
| | [related] |
| std::ostream& operator<< |
( |
std::ostream & |
os, |
|
|
const ConstantView & |
s | |
|
) |
| | [related] |
| std::ostream& operator<< |
( |
std::ostream & |
os, |
|
|
const SingletonView & |
s | |
|
) |
| | [related] |


authentication_service.models module¶
-
class
authentication_service.models.
CoreUser
(password, last_login, is_superuser, username, first_name, last_name, is_staff, is_active, date_joined, id, email, email_verified, nickname, msisdn, msisdn_verified, gender, birth_date, country, avatar, created_at, updated_at, organisational_unit)[source]¶ Bases:
django.contrib.auth.models.AbstractUser
-
exception
DoesNotExist
¶ Bases:
django.core.exceptions.ObjectDoesNotExist
-
exception
MultipleObjectsReturned
¶ Bases:
django.core.exceptions.MultipleObjectsReturned
-
avatar
¶ Just like the FileDescriptor, but for ImageFields. The only difference is assigning the width/height to the width_field/height_field, if appropriate.
-
birth_date
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
code_set
¶ Accessor to the related objects manager on the reverse side of a many-to-one relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
parent.children
is aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
-
country
¶ Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
child.parent
is aForwardManyToOneDescriptor
instance.
-
country_id
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
created_at
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
email_verified
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
gender
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
get_gender_display
(**morekwargs)¶
-
get_next_by_birth_date
(**morekwargs)¶
-
get_next_by_created_at
(**morekwargs)¶
-
get_next_by_date_joined
(**morekwargs)¶
-
get_next_by_updated_at
(**morekwargs)¶
-
get_previous_by_birth_date
(**morekwargs)¶
-
get_previous_by_created_at
(**morekwargs)¶
-
get_previous_by_date_joined
(**morekwargs)¶
-
get_previous_by_updated_at
(**morekwargs)¶
-
groups
¶ Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.
In the example:
class Pizza(Model): toppings = ManyToManyField(Topping, related_name='pizzas')
pizza.toppings
andtopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
-
has_security_questions
¶
-
id
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
logentry_set
¶ Accessor to the related objects manager on the reverse side of a many-to-one relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
parent.children
is aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
-
msisdn
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
msisdn_verified
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
nickname
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
organisational_unit
¶ Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
child.parent
is aForwardManyToOneDescriptor
instance.
-
organisational_unit_id
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
phonedevice_set
¶ Accessor to the related objects manager on the reverse side of a many-to-one relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
parent.children
is aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
-
save
(*args, **kwargs)[source]¶ Saves the current instance. Override this in a subclass if you want to control the saving process.
The ‘force_insert’ and ‘force_update’ parameters can be used to insist that the “save” must be an SQL insert or update (or equivalent for non-SQL backends), respectively. Normally, they should not be set.
-
staticdevice_set
¶ Accessor to the related objects manager on the reverse side of a many-to-one relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
parent.children
is aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
-
token_set
¶ Accessor to the related objects manager on the reverse side of a many-to-one relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
parent.children
is aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
-
totpdevice_set
¶ Accessor to the related objects manager on the reverse side of a many-to-one relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
parent.children
is aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
-
updated_at
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
user_permissions
¶ Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.
In the example:
class Pizza(Model): toppings = ManyToManyField(Topping, related_name='pizzas')
pizza.toppings
andtopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
-
userconsent_set
¶ Accessor to the related objects manager on the reverse side of a many-to-one relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
parent.children
is aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
-
usersecurityquestion_set
¶ Accessor to the related objects manager on the reverse side of a many-to-one relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
parent.children
is aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
-
exception
-
class
authentication_service.models.
Country
(code, name)[source]¶ Bases:
django.db.models.base.Model
-
exception
DoesNotExist
¶ Bases:
django.core.exceptions.ObjectDoesNotExist
-
exception
MultipleObjectsReturned
¶ Bases:
django.core.exceptions.MultipleObjectsReturned
-
code
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
coreuser_set
¶ Accessor to the related objects manager on the reverse side of a many-to-one relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
parent.children
is aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
-
name
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
objects
= <django.db.models.manager.Manager object>¶
-
exception
-
class
authentication_service.models.
OrganisationalUnit
(id, name, description, created_at, updated_at)[source]¶ Bases:
django.db.models.base.Model
-
exception
DoesNotExist
¶ Bases:
django.core.exceptions.ObjectDoesNotExist
-
exception
MultipleObjectsReturned
¶ Bases:
django.core.exceptions.MultipleObjectsReturned
-
coreuser_set
¶ Accessor to the related objects manager on the reverse side of a many-to-one relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
parent.children
is aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
-
created_at
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
description
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
get_next_by_created_at
(**morekwargs)¶
-
get_next_by_updated_at
(**morekwargs)¶
-
get_previous_by_created_at
(**morekwargs)¶
-
get_previous_by_updated_at
(**morekwargs)¶
-
id
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
name
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
objects
= <django.db.models.manager.Manager object>¶
-
updated_at
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
exception
-
class
authentication_service.models.
QuestionLanguageText
(id, language_code, question, question_text)[source]¶ Bases:
django.db.models.base.Model
-
exception
DoesNotExist
¶ Bases:
django.core.exceptions.ObjectDoesNotExist
-
exception
MultipleObjectsReturned
¶ Bases:
django.core.exceptions.MultipleObjectsReturned
-
get_language_code_display
(**morekwargs)¶
-
id
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
language_code
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
objects
= <django.db.models.manager.Manager object>¶
-
question
¶ Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
child.parent
is aForwardManyToOneDescriptor
instance.
-
question_id
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
question_text
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
exception
-
class
authentication_service.models.
SecurityQuestion
(id, question_text)[source]¶ Bases:
django.db.models.base.Model
-
exception
DoesNotExist
¶ Bases:
django.core.exceptions.ObjectDoesNotExist
-
exception
MultipleObjectsReturned
¶ Bases:
django.core.exceptions.MultipleObjectsReturned
-
id
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
objects
= <django.db.models.manager.Manager object>¶
-
question_text
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
questionlanguagetext_set
¶ Accessor to the related objects manager on the reverse side of a many-to-one relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
parent.children
is aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
-
usersecurityquestion_set
¶ Accessor to the related objects manager on the reverse side of a many-to-one relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
parent.children
is aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
-
exception
-
class
authentication_service.models.
UserSecurityQuestion
(id, user, answer, language_code, question)[source]¶ Bases:
django.db.models.base.Model
-
exception
DoesNotExist
¶ Bases:
django.core.exceptions.ObjectDoesNotExist
-
exception
MultipleObjectsReturned
¶ Bases:
django.core.exceptions.MultipleObjectsReturned
-
answer
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
get_language_code_display
(**morekwargs)¶
-
id
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
language_code
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
objects
= <django.db.models.manager.Manager object>¶
-
question
¶ Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
child.parent
is aForwardManyToOneDescriptor
instance.
-
question_id
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
save
(*args, **kwargs)[source]¶ Saves the current instance. Override this in a subclass if you want to control the saving process.
The ‘force_insert’ and ‘force_update’ parameters can be used to insist that the “save” must be an SQL insert or update (or equivalent for non-SQL backends), respectively. Normally, they should not be set.
-
user
¶ Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
child.parent
is aForwardManyToOneDescriptor
instance.
-
user_id
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
exception


Getting Started
For people who are new to the Fidelix project and are looking for ways to get involved:
-
Join our Discord.
It provides a friendly, informal setting for newcomers. This is also
where the majority of our discussion takes place.
-
Look at our Development Kanban Board and Issue Tracker. Issues that we want help with and good first issues are labelled as such.
-
We are always looking for people to help test the latest development
releases and provide feedback and constructive criticism. Please do
drop us a line if you are into this sort of
stuff.
-
If system level development is not your thing, we are always
looking for people to help improve
the documentation.
Open Positions
We are currently looking for people to fill the following roles. If you are or
might be interested, please let us know.
-
Community Manager - help to actively build a community around Fidelix
and enage that community.
-
Webmaster - maintain the fidelix.us website.
-
pkgsrc Maintainer - take the lead in maintaining the
Fidelix branch of pkgsrc.
-
Developers - we're always looking for more.


Core - Past, current & future ; exit freelance consultancy, enter project & business development
Believe it or not : exit consultancy, enter projects & business development !!
After doing some consultancy I have decided to stop doing freelance consultancy, and start focussing on doing projects and business development again. Here is a little motivation :
The past & current: freelance consultancy
I have enjoyed working for these companies, and met a lot of new collegues and friends while doing freelance consultancy. I also learned a lot during past experiences.
But, from all these experiences, I especially learned that I am more suitable as a project/business developer; i.e. we develop a new product, or you tell me what your problem is, and we will implement a software solution for this.
The future: project and business development
Since I have recieved a few project requests from my business and friends network, and my contracted period finished at the end of this year, I decided not to sign for another year (my apologies to all my collegues @ EBL, I enjoyed working with you all).
My current prospects and customers are all part of my business and personal network, and for all currently planned projects our cooperation is based on past experiences, trust as well as commitment, which was all built up step by step in the past.
If you think we might create some added value together one way or another, do not hesitate to contact me.
I have also met a few people in my consultancy years with whom I would almost certainly like to 'do something' with in the (near) future. Some very early brainstorms allready led to some potentially great ideas, but a great idea is useless if you do not do anything with it. Probably more on this later on.
Also, based on my current workload, I am very interested in meeting people who would like to do some freelance .net software development for potential software projects. Please do note that I work on a task basis, i.e. "this is what I need, and this is what will pay for it". Some people might have problems with this, while others love to work like this.