Utility functions¶
This module contains simple utility functions that are used in several of MARXS submodules.
marxs.math Package¶
Convention of variable naming:
prefix |
coordinate system |
object |
---|---|---|
none |
none |
number (e.g. angle, distance) |
e |
Euklid (3d) |
point |
h |
homogeneous (4d) |
point, plane |
p |
Pluecker (6d) |
line (=ray) |
marxs.math.geometry Module¶
Functions¶
|
Generate Eukledian positions for the corners of a square. |
|
Generate Eukledian positions along an ellipse. |
Classes¶
|
|
|
|
|
Base class for geometrically flat optical elements. |
|
|
|
Base class for geometrically flat optical elements. |
|
Base class for geometrically flat optical elements. |
|
A Geometry shaped like a ring or tube. |
Class Inheritance Diagram¶
marxs.math.pluecker Module¶
This module collects routines that deal with lines in Pluecker coordiantes incl. the construction of the Pluecker coordinates from e.g. two points in space or a direction and a point.
Functions¶
|
Compute angle between normal to plane and line |
|
Return a line in Pluecker coordinates connecting two points. |
|
Return a line in Pluecker coordinates connecting two points. |
|
Intersect a line in Pluecker coordinates with a plane in homogeneous coordinates. |
|
Return a plane in homogeneous coordinates |
marxs.math.polarization Module¶
Functions¶
|
Converts polarization angles to vectors in the direction of polarization. |
|
Reflection of a polarization vector on a non-polarizing surface. |
|
Calculate parallel transport ray tracing matrix. |
|
Parallel transport of the polarization vector with no polarization happening. |
marxs.math.random Module¶
Classes¶
|
Take random draw from an arbitrary (and arbitrarily binned) pdf. |
Class Inheritance Diagram¶
marxs.math.rotations Module¶
Functions¶
|
Rotate x-axis to e1, use efix to break rotation ambiguity. |
|
Rotation matrix for rotation angle |
marxs.math.utils Module¶
Functions¶
|
Test if an angle is between two others |
|
Angle range covered by phi, accounting for 2 pi properly |
|
Calculate the Eukledian distance between 2 points |
|
Convert Euclidean coordinates to homogeneous coordinates |
|
Convert homogeneous coordinates to Euclidean coordinates |
|
Transform 3*3 matrix (e.g. rotation) to affine 4*4 matrix. |
|
Normalize euklidean vectors. |
|
Transform 3-d translation vector to affine 4*4 matrix. |
|
Transform zoom to affine 4*4 matrix. |
marxs.utils Module¶
Functions¶
Generate a photon structure for testing. |
|
|
Get a 2d array from an input table. |
Classes¶
Exception for grating efficiency files not matching expected format. |