finesse.utilities.maps module
Collection of tools for computing different maps.
- class finesse.utilities.maps.BinaryReader(fileName)[source]
Bases:
objectMetroPro binary data format reader.
- read(typeName, size=None)[source]
Read a datatype from the binary file.
Parameters
- typenamestr
See BinaryReader.typeNames.
- sizeint
Number of bytes to read
- seek(offset, refPos=0)[source]
Offset in bytes and refPos gives reference position, where 0 means origin of the file, 1 uses current position and 2 uses the end of the file.
- typeNames = {'char': 's', 'double': 'd', 'float': 'f', 'int16': 'h', 'int32': 'i', 'int64': 'q', 'int8': 'b', 'uint16': 'H', 'uint32': 'I', 'uint64': 'Q', 'uint8': 'B'}
- finesse.utilities.maps.circular_aperture(x, y, R_ap, x_offset=0, y_offset=0)[source]
Circular aperture map.
Parameters
- x, yarray
1D arrays describing uniform 2D grid to compute map over in meters
- Rfloat
Radius of aperture in meters
- x_offset, y_offsetfloat, optional
Offset of aperture from origin
- finesse.utilities.maps.make_coordinates(N, a)[source]
Makes the 1D and square 2D grid of coordinates for map calculations.
Parameters
- N_samplesint
Number of samples in each dimension (N x N)
- afloat
Dimension of square grid (a x a) to generate
Returns
- x,yarray_like[float]
1D arrays for the x and y coordinates
- X,Y,Rarray_like[float]
2D Arrays of the X, Y, and radial R coordinates
- finesse.utilities.maps.overlap_1D_curvature_coefficients(x, z, weight_spot: float)[source]
Computes the amount of spot size weighted quadratic x**2 term there is present in some 1D data. This gives the same result as
overlap_curvature_coefficients()when z does not depend on y.Parameters
- xndarray(dtype=float)
Sample points, ideally should be symmetric about 0.
- zndarray(dtype=float)
function at sample points x
- weight_spotfloat
Spot size to use as weighting
Returns
- quadratic_termdouble
Weighted quadratic term of z
Notes
This function is essentially evaluating a weighted Hermite polynomial overlap integral with z(x) to determine the quadratic term.
\[\int_{\min(x)}^{\max(x)} H_{2}(x) z(x)^2 W(x) dx\]Where the weighting function is \(W(x) = e^{-x^2}\).
- finesse.utilities.maps.overlap_1D_piston_coefficient(x, z, weight_spot: float)[source]
Computes the amount of weighted piston term there is in some 1D data like a surface map. This is computed by evaluating a weighted Hermite polynomial overlap integral in an efficient manner.
Parameters
- x, yarray_like
1D Array of x and y describing the 2D plane of z
- zarray_like
2D optical path difference [metres]
- weight_spotfloat
Beam spot size to weight over
Returns
- pistonfloat
amount of piston term
- finesse.utilities.maps.overlap_1D_tilt_coefficients(x, z, weight_spot: float)[source]
Computes the amount of spot size weighted linear x term there is present in some 1D data. This gives the same result as
overlap_tilt_coefficients()when z does not depend on y.Parameters
- xndarray(dtype=float)
Sample points, ideally should be symmetric about 0.
- zndarray(dtype=float)
function at sample points x
- weight_spotfloat
Spot size to use as weighting
Returns
- linear_termdouble
Weighted linear term of z
Notes
This function is essentially evaluating a weighted Hermite polynomial overlap integral with z(x) to determine the linear term.
\[\int_{\min(x)}^{\max(x)} H_{1}(x) z(x) W(x) dx\]Where the weighting function is \(W(x) = e^{-x^2}\).
- finesse.utilities.maps.overlap_curvature_coefficients(x, y, z, weight_spot: float)[source]
Computes the amount of x and y curvature terms present in a map’s displacement data.
This is computed by evaluating a weighted Hermite polynomial overlap integral in an efficient manner.
Parameters
- x, yarray_like
1D Array of x and y describing the 2D plane of z
- zarray_like
2D optical path difference [metres]
- weight_spotfloat
Beam spot size to weight over
Returns
- Bx, Bycomplex
Complex-valued overlap coefficients for the HG20 and HG02 modes
Notes
This function is essentially evaluating a weighted Hermite polynomial overlap integral with z(x).
\[\begin{aligned} B_x &= \left\langle U_{00} | z | U_{20}\right\rangle \\ &= \int z(x,y) U_{00}(x,y) U_{20}^*(x,y) dx dy \\ &= \frac{2}{\pi w^4} \int z(x,y) \left(\frac{8 x^2}{w^2} - 2 \right) \exp\left(-\frac{2(x^2+y^2)}{w^2}\right) dx dy \end{aligned}\]Where the weighting function is \(W(x) = e^{-x^2}\). Likewise for \(B_y\).
- finesse.utilities.maps.overlap_piston_coefficient(x, y, z, weight_spot: float)[source]
Computes the amount of weighted piston term there is in some 2D data like a surface map.
This is computed by evaluating a weighted Hermite polynomial overlap integral in an efficient manner.
Parameters
- x, yarray_like
1D Array of x and y describing the 2D plane of z
- zarray_like
2D optical path difference [metres]
- weight_spotfloat
Beam spot size to weight over
Returns
- pistonfloat
amount of piston term
Notes
\[\begin{aligned} \overline{z} &= \left\langle U_{00} | z | U_{00}\right\rangle \\ &= \int z(x,y) U_{00}(x,y) U_{00}^*(x,y) dx dy \\ &= \frac{2}{\pi w^2} \int z(x,y) \exp\left(-\frac{2(x^2+y^2)}{w^2}\right) dx dy \end{aligned}\]
- finesse.utilities.maps.overlap_tilt_coefficients(x, y, z, weight_spot: float)[source]
Computes the amount of yaw and pitch terms present in a map’s displacement data.
This is computed by evaluating a weighted Hermite polynomial overlap integral in an efficient manner.
Parameters
- x, yarray_like
1D Array of x and y describing the 2D plane of z
- zarray_like
2D optical path difference [metres]
- weight_spotfloat
Beam spot size to weight over
Returns
- alpha_x, alpha_ycomplex
Complex-valued overlap tilt coefficients for the HG10 and HG01 modes
Notes
This function is essentially evaluating a weighted Hermite polynomial overlap integral with z(x).
\[\begin{aligned} \alpha_x &= \left\langle U_{00} | z | U_{10}\right\rangle \\ &= \int z(x,y) U_{00}(x,y) U_{10}^*(x,y) dx dy \\ &= \frac{4}{\pi w^3} \int z(x,y) \frac{2 x}{w} \exp\left(-\frac{2(x^2+y^2)}{w^2}\right) dx dy \end{aligned}\]Where the weighting function is \(W(x) = e^{-x^2}\). Likewise for \(\alpha_y\).
- finesse.utilities.maps.read_metropro_file(filename)[source]
Reading the metroPro binary data files. Translated from Hiro Yamamoto’s ‘LoadMetroProData.m’.
Parameters
- filename
Name of metropro data file.
- finesse.utilities.maps.read_metropro_header(binary)[source]
Reads header of the metroPro binary format files. Translated from the readerHeader() function within the ‘LoadMetroProData.m’ function written by Hiro Yamamoto.
Parameters
- binary
BinaryReader Name of metropro data file.
- binary
- finesse.utilities.maps.rms(x, y, z, weight_spot: float, xo: float = 0, yo: float = 0)[source]
Computes the spot weight RMS over some 2D data, such as optical path depth.
\[\sqrt{\overline{z^2} - \overline{z}^2}\]where
\[\begin{aligned} \overline{z} &= \left\langle U_{00} | z | U_{00}\right\rangle \\ &= \frac{2}{\pi w^2} \int z(x,y) \exp\left(-\frac{2(x^2+y^2)}{w^2}\right) dx dy \end{aligned}\]and likewise for \(\overline{z^2}\)
Parameters
- x, yarray_like
1D Array of x and y describing the 2D plane of z
- zarray_like
2D optical path difference [metres]
- weight_spotfloat
Beam spot size to weight over
- xo, yofloat
Origin of the beam position
Returns
- rmsfloat
Root mean squared in units of whatever z is
Notes
- Based on Equation 4 in:
A. Brooks, et.al Overview of Advanced LIGO adaptive optics Appl. Opt. 55, 8256-8265 (2016)
- finesse.utilities.maps.surface_point_absorber(xs, ys, w, h, power_absorbed, alpha=5.5e-07, kappa=1.38, zero_min=False)[source]
Models the surface deformation from a small point absorber in a coating of a mirror. It calcaultes the thermo-elastic deformation due to excess heat being deposited in the mirror.
Parameters
- xs, ysarray
1D array for the x and y axis to calculate the distortion over
- wdouble
Area of the absorber size
- hdouble
Thickness of mirror
- power_absorbeddouble
Amount of power absorbed over the area w
- alphadouble, optional
Thermo-elastic coefficient of material, default value for fused silica
- kappadouble, optional
Thermal conductivity of the material, default value for fused silica
Returns
Height map in meters
Notes
- Equation from:
Brooks, et.al “Point absorbers in Advanced LIGO,” Appl. Opt. (2021)