finesse.knm.matrix.KnmMatrix

Overview

class finesse.knm.matrix.KnmMatrix(const int[:, ::1] modes, comp_name=u'', kdir=u'')

Bases: object

Higher-Order-Mode scattering matrix container. Essentially a wrapper around a 2D NumPy array with methods for conveniently accessing specific couplings and plotting the matrix as a color-mesh.

The underlying numpy.ndarray object can be accessed via the data attribute.

Construction of KnmMatrix objects should, generally, not be performed manually. Objects of this type are the return type of the general scattering matrix computing routines, see make_scatter_matrix(). To make a KnmMatrix object from a pre-existing matrix of complex coupling coefficients, use KnmMatrix.from_buffer().

Parameters
modesarray-like

A 2D array, or memory-view to the array, of the mode indices associated with the scattering matrix.

comp_namestr, optional; default: “”

Name of the component associated with the matrix (if any).

kdirstr, optional; default: “”

A string representing the coupling direction of the matrix, e.g. “11” for a reflection at the first surface of a mirror-like optic.

Methods

KnmMatrix.__init__(*args, **kwargs)

KnmMatrix.from_buffer(ndarray buffer, ...)

Construct a KnmMatrix object from a pre-existing 2D array buffer.

KnmMatrix.get(self, key[, default])

Retrieves the coupling coefficient corresponding to the key, returning default if this key is invalid.

KnmMatrix.of_zeros(const int[, , **kwargs)

Constuct a KnmMatrix where each element is (complex) zero.

KnmMatrix.plot(self[, mode, log, cmap, ...])

Plots the coupling coefficient matrix as a color-mesh.