finesse.knm.maps.Map

Overview

class finesse.knm.maps.Map(ndarray x, ndarray y, opd=None, amplitude=None, auto_remove_tilts=False, auto_remove_curvatures=False, auto_remove_astigmatism=False, is_focusing_element=False, put_focal_length=None)

Bases: object

A Map is an object that stores an optical path difference (OPD) and amplitude variations over some 2D surface. This represents a spatial distortion to an optical field and is used to model features such as surface defects, thermal lenses, and apertures.

The complex value of the map is described:

z(x,y) = amplitude(x,y) * exp[-1j * k * factor * opd(x,y)]

Where k is the wavenumber for the wavelength being used, and factor is some arbitrary scaling factor. This scaling is 2 for reflections, and for transmission will be some difference in refractive index between the two surfaces. Multiple z arrays can be generated from the same maps. z arrays are generated using the get_z method.

Multiple options exist for automatic removal of tilts, curvatures, and astigmatisms in maps too. When these options are defined and new map data is generated by calling get_z these terms will be removed from the OPD data. This allows changing maps defined with functions to constantly have these terms being removed during a simulation, simplifying their use. When automatic removal is used the terms are weighted with the current complex beam parameter spot size as a weight.

Parameters
xdouble[::1]

1D uniformally sample horizontal x array of size Nx

ydouble[::1]

1D uniformally sample vertical y array of size Ny

opd[double[:, ::1] | callable], optional

2D array of size [Ny, Nx] which describes the optical path difference over the grid defined by x and y. Units of meters. If a callable is provided it should be of the form f(smap, Model) argument and return a OPD array when called. smap is the current map object and model is the current model this Map’s element is a part of. This allows you to access other elements and information if needed.

amplitude[double[:, ::1] | callable], optional

2D array of size [Ny, Nx] which describes a amplitude over the grid defined by x and y. Units of meters. If a callable is provided it should be of the form f(smap, Model) argument and return an amplitude array when called. smap is the current map object and model is the current model this Map’s element is a part of. This allows you to access other elements and information if needed.

auto_remove_tiltsbool

When True any tilts present in the map will be removed when used during simulations. Can only be used if a callable is specified for opd then the tilts will be removed after each call to get new map data from the function.

auto_remove_curvaturesbool

When True any curvatures present in the map will be removed when used during simulations. Can only be used if callable is specified for opd then the tilts will be removed after each call to get new map data from the function. This will remove the average of the x and y curvatures, so will still leave astigmatisms present.

auto_remove_astigmatismbool

When True any astigmatism present in the map will be removed when used during simulations. Can only be used if a callable is specified for opd then the tilts will be removed after each call to get new map data from the function. This will remove astigmatic curvatures in both x and y, so is similar to using auto_remove_curvatures.

is_focusing_elementbool

When True this map is representing a focusing element like a curved mirror or lens. In such cases the large scale curvature has not been removed from the map. When set to True the mode projection will be done using the map integration and q_in != q_out. Therefore this map must include the focusing OPD to correctly project q_in -> q_out to be mode matched.

If False, the input and output q value is the same, and the mode projection is done using the analytic Bayer-Helms solution to the overlap integrals.

put_focal_lengthParameter

A lens element added to the model to put any removed focal length in the map OPD into to. This is only updated when the remove_curvatures() is called. This can happen at the user request or automatically if auto_remove_curvatures or auto_remove_astigmatism are True.

Properties

Map.OPD_function

Returns the function that defines the OPD of this map, if there is one.

Map.amplitude_function

Returns the function that defines the amplitude of this map, if there is one.

Map.dx

Map.dy

Methods

Map.__init__(*args, **kwargs)

Map.get_linear_terms(self, double spot_size)

Returns the spot weighted x and y linear terms from the OPD map data.

Map.get_quadratic_terms(self, double spot_size)

Returns the spot weighted x and y quadratic terms from the OPD map data.

Map.get_radius_of_curvature_reflection(self, ...)

Assuming this map's OPD array describes a surface, this function will compute the equivalent radius of curvature from it.

Map.get_thin_lens_f(self, double spot_size, *)

Computes the equivalent thin lens focal length from the optical path depth (OPD) in this map.

Map.get_z(self, double k, double phase_factor)

Calculates the 2D complex-valued array combining both the amplitude and OPD data stored in this map.

Map.remove_curvatures(self, ...[, model])

Removes average weighted quadratic terms from the OPD map data.

Map.remove_piston(self, float spot_size)

Removes any piston term from the optical path difference data.

Map.remove_tilts(self, double spot_size)

Removes any tilts from the optical path difference data.

Map.rms(self, double spot_size)

Computes the spot size weighted RMS of this maps OPD.

Map.scatter_matrix(self, q, k0, phase_scale, ...)

Computes a modal scattering matrix for this map.

Map.update(self[, model])

If the optical path difference or ampltiude data for this map is defined by some callable function you will need to call this update method before accessing its data.