finesse.detectors.camera module

Detectors for capturing images, slices and single pixels of a beam.

The camera types are split into two categories (CCDs and ComplexCameras) based on the mathematical implementation shown in finesse.detectors.compute.camera.

class finesse.detectors.camera.CCD(*args, **kwargs)[source]

Bases: CCDCamera, Image

Camera for measuring the intensity of a beam, \(I = |E(x,y)|^2\), where the unscaled x and y coordinate arrays used are finesse.detectors.camera.Image.xdata and finesse.detectors.camera.Image.ydata, respectively. Note that this is just the intensity at the points (x,y), not an integrated power over some finite pixel size.

Parameters

namestr

Unique name of the camera.

nodeOpticalNode

Node at which to detect.

xlimsequence or scalar

Limits of the x-dimension of the image. If a single number is given then this will be computed as \(x_{\mathrm{lim}} = [-|x|, +|x|]\).

ylimsequence or scalar

Limits of the y-dimension of the image. If a single number is given then this will be computed as \(y_{\mathrm{lim}} = [-|y|, +|y|]\).

nptsint

Number of points in both axes.

w0_scaledbool, optional; default: True

Flag indicating whether the \(x\), \(y\) axes should be scaled to the waist-size of the beam parameter at node.

property npts[source]

Number of pixels in each axis.

Getter:

Returns the number of pixels in each axis.

Setter:

Sets the number of pixels in each axis.

class finesse.detectors.camera.CCDCamera(*args, **kwargs)[source]

Bases: Camera, ABC

Abstract type for cameras which detect pixel intensity.

Parameters

namestr

Unique name of the camera.

nodeOpticalNode

Node at which to detect.

w0_scaledbool, optional; default: True

Flag indicating whether the \(x\), \(y\) axes should be scaled to the waist-size of the beam parameter at node.

class finesse.detectors.camera.CCDPixel(*args, **kwargs)[source]

Bases: CCDCamera, Pixel

Camera for measuring the intensity of a beam, \(I = |E(x,y)|^2\), at a single point. Where the unscaled x and y coordinate used is finesse.detectors.camera.Pixel.xdata and finesse.detectors.camera.Pixel.ydata, respectively. Note that this is just the intensity at (x,y), not an integrated power over some finite pixel dimension.

Parameters

namestr

Unique name of the camera.

nodeOpticalNode

Node at which to detect.

xscalar, optional; default: 0

The x co-ordinate of the pixel.

yscalar, optional; default: 0

The y co-ordinate of the pixel.

w0_scaledbool, optional; default: True

Flag indicating whether the \(x\), \(y\) axes should be scaled to the waist-size of the beam parameter at node.

class finesse.detectors.camera.CCDScanLine(*args, **kwargs)[source]

Bases: CCDCamera, ScanLine

Camera for measuring the intensity of a beam, \(I = |E(x,y)|^2\), along a 1D slice. Where the unscaled x and y coordinate arrays used are finesse.detectors.camera.ScanLine.xdata and finesse.detectors.camera.ScanLine.ydata, respectively. Note that this is just the intensity at the points (x,y), not an integrated power over some finite pixel size.

The ScanLine.direction (i.e. axis of slice) is determined from which of xlim or ylim is specified.

Parameters

namestr

Unique name of the camera.

nodeOpticalNode

Node at which to detect.

nptsint

Number of points in slice axis.

xscalar or None; default: None

The x coordinate of the slice. If ylim is given and this is not specified then defaults to zero. If xlim is given and this is also specified then it is ignored.

yscalar or None; default: None

The y coordinate of the slice. If xlim is given and this is not specified then defaults to zero. If ylim is given and this is also specified then it is ignored.

xlimscalar or size two sequence; default: None

The limits of the x-axis scan lines. A single number gives \(x_{\mathrm{axis}} \in [-|x|, +|x|]\), or a tuple of size two gives \(x_{\mathrm{axis}} \in [x[0], x[1]]\).

ylimscalar or array-like; default: None

The limits of the y-axis scan lines. A single number gives \(y_{\mathrm{axis}} \in [-|y|, +|y|]\), or a tuple of size two gives \(y_{\mathrm{axis}} \in [y[0], y[1]]\).

w0_scaledbool, optional; default: True

Flag indicating whether the \(x\), \(y\) axes should be scaled to the waist-size of the beam parameter at node.

property npts[source]

Number of pixels in the scanning axis.

Getter:

Returns the number of pixels in the slice axis.

Setter:

Sets the number of pixels in the slice axis.

class finesse.detectors.camera.Camera(*args, **kwargs)[source]

Bases: MaskedDetector, ABC

Base camera class.

Parameters

namestr

Unique name of the camera.

nodeOpticalNode

Node at which to detect.

w0_scaledbool

Flag indicating whether the \(x\), \(y\) axes should be scaled to the waist-size of the beam parameter at node.

dtypenumpy.dtype or str

The data-type of the pixels.

shapetuple

Dimensions of the camera image.

property needs_trace[source]

Flag indicating whether the detector requires beam traces.

property scaled_xdata[source]

Coordinate data in the x-axis scaled to metres.

Equivalent to xdata if Camera.w0_scaled is False. Otherwise this is xdata multiplied by the tangential waist size as measured at the node.

property scaled_ydata[source]

Coordinate data in the y-axis scaled to metres.

Equivalent to ydata if Camera.w0_scaled is False. Otherwise this is ydata multiplied by the sagittal waist size as measured at the node.

property w0_scaled[source]

Flag for whether the x and y co-ordinates have been scaled by the waist-size of the beam parameter at the detection node.

Getter:

Returns True if x and y have been scaled by the beam waist, False otherwise.

class finesse.detectors.camera.ComplexCamera(*args, **kwargs)[source]

Bases: Camera, ABC

Abstract type for cameras which detect pixel amplitude and phase.

Parameters

namestr

Unique name of the camera.

nodeOpticalNode

Node at which to detect.

fscalar, optional; default: 0

Field frequency offset from the carrier to detect.

w0_scaledbool, optional; default: True

Flag indicating whether the \(x\), \(y\) axes should be scaled to the waist-size of the beam parameter at node.

property f

f : scalar, optional; default: 0 Field frequency offset from the carrier to detect.

class finesse.detectors.camera.FieldCamera(*args, **kwargs)[source]

Bases: ComplexCamera, Image

Camera for detecting the full image of the beam in terms of amplitude and phase.

Get the unscaled x and y coordinate data via finesse.detectors.camera.Image.xdata and finesse.detectors.camera.Image.ydata, respectively.

Parameters

namestr

Unique name of the camera.

nodeOpticalNode

Node at which to detect.

xlimsequence or scalar

Limits of the x-dimension of the image. If a single number is given then this will be computed as \(x_{\mathrm{lim}} = [-|x|, +|x|]\).

ylimsequence or scalar

Limits of the y-dimension of the image. If a single number is given then this will be computed as \(y_{\mathrm{lim}} = [-|y|, +|y|]\).

nptsint

Number of points in both axes.

fscalar, optional; default: 0

Field frequency offset from the carrier to detect.

w0_scaledbool, optional; default: True

Flag indicating whether the \(x\), \(y\) axes should be scaled to the waist-size of the beam parameter at node.

property f

f : scalar, optional; default: 0 Field frequency offset from the carrier to detect.

property npts[source]

Number of pixels in each axis.

Getter:

Returns the number of pixels in each axis.

Setter:

Sets the number of pixels in each axis.

class finesse.detectors.camera.FieldPixel(*args, **kwargs)[source]

Bases: ComplexCamera, Pixel

Camera for detecting a single pixel of the beam in terms of the amplitude and phase.

Get the unscaled x and y coordinate data via finesse.detectors.camera.Pixel.xdata and finesse.detectors.camera.Pixel.ydata, respectively.

Parameters

namestr

Unique name of the camera.

nodeOpticalNode

Node at which to detect.

xscalar, optional; default: 0

The x co-ordinate of the pixel.

yscalar, optional; default: 0

The y co-ordinate of the pixel.

fscalar, optional; default: 0

Field frequency offset from the carrier to detect.

w0_scaledbool, optional; default: True

Flag indicating whether the \(x\), \(y\) axes should be scaled to the waist-size of the beam parameter at node.

property f

f : scalar, optional; default: 0 Field frequency offset from the carrier to detect.

class finesse.detectors.camera.FieldScanLine(*args, **kwargs)[source]

Bases: ComplexCamera, ScanLine

Camera for detecting a slice of the beam in terms of amplitude and phase.

The ScanLine.direction (i.e. axis of slice) is determined from which of xlim or ylim is specified.

Get the unscaled x and y coordinate data via finesse.detectors.camera.ScanLine.xdata and finesse.detectors.camera.ScanLine.ydata, respectively.

Parameters

namestr

Unique name of the camera.

nodeOpticalNode

Node at which to detect.

nptsint

Number of points in slice axis.

xscalar or None; default: None

The x coordinate of the slice. If ylim is given and this is not specified then defaults to zero. If xlim is given and this is also specified then it is ignored.

yscalar or None; default: None

The y coordinate of the slice. If xlim is given and this is not specified then defaults to zero. If ylim is given and this is also specified then it is ignored.

xlimscalar or size two sequence; default: None

The limits of the x-axis scan lines. A single number gives \(x_{\mathrm{axis}} \in [-|x|, +|x|]\), or a tuple of size two gives \(x_{\mathrm{axis}} \in [x[0], x[1]]\).

ylimscalar or array-like; default: None

The limits of the y-axis scan lines. A single number gives \(y_{\mathrm{axis}} \in [-|y|, +|y|]\), or a tuple of size two gives \(y_{\mathrm{axis}} \in [y[0], y[1]]\).

fscalar, optional; default: 0

Field frequency offset from the carrier to detect.

w0_scaledbool, optional; default: True

Flag indicating whether the \(x\), \(y\) axes should be scaled to the waist-size of the beam parameter at node.

property f

f : scalar, optional; default: 0 Field frequency offset from the carrier to detect.

property npts[source]

Number of pixels in the scanning axis.

Getter:

Returns the number of pixels in the slice axis.

Setter:

Sets the number of pixels in the slice axis.

class finesse.detectors.camera.Image(xlim, ylim, npts, dtype)[source]

Bases: object

Data structure representation of an image.

Parameters

xlimsequence or scalar

Limits of the x-dimension of the image. If a single number is given then this will be computed as \(x_{\mathrm{lim}} = [-|x|, +|x|]\).

ylimsequence or scalar

Limits of the y-dimension of the image. If a single number is given then this will be computed as \(y_{\mathrm{lim}} = [-|y|, +|y|]\).

nptsint

Number of points for both the x and y axes.

dtypestr or dtype

Data type of the image to pass to NumPy for array creation.

at(x=None, y=None)[source]

Retrieves a slice or single pixel of the output image.

Parameters

xscalar, optional

Value indicating where to take a y-slice of the image or, if used in conjunction with y, which pixel to return. Defaults to None.

yscalar, optional

Value indicating where to take a x-slice of the image or, if used in conjunction with x, which pixel to return. Defaults to None.

magnitudebool, optional

Returns the amplitude of the detected field if True. Otherwise returns the full complex description.

Returns

outnumpy.ndarray or float

Either a slice of the image or a single pixel at the specified co-ordinates.

property npts[source]

Number of pixels in each axis.

Getter:

Returns the number of pixels in each axis.

Setter:

Sets the number of pixels in each axis.

property resolution[source]

The resolution of the image.

Currently this is always square (i.e. number of points in both axes always equal).

Getter:

Returns the tuple (xpts, ypts).

property xdata[source]

The array of data points for the x-axis.

Getter:

Returns a copy of the numpy.ndarray containing the x-axis points.

property xlim[source]

The limits of the x coordinate data.

Getter:

Returns a tuple of (xmin, xmax).

Setter:

Sets the x-axis limits.

property ydata[source]

The array of data points for the y-axis.

Getter:

Returns a copy of the numpy.ndarray containing the y-axis points.

property ylim[source]

The limits of the y coordinate data.

Getter:

Returns a tuple of (ymin, ymax).

Setter:

Sets the y-axis limits.

class finesse.detectors.camera.Pixel(x, y, dtype)[source]

Bases: object

Data structure representation of a pixel of an image.

Parameters

xscalar

The x co-ordinate of the pixel.

yscalar

The y co-ordinate of the pixel.

dtypestr or dtype

Data type of the pixel.

property x[source]

The x coordinate of the pixel.

Getter:

Returns the x coordinate of the pixel.

Setter:

Sets the x coordinate of the pixel.

property xdata[source]

Equivalent to Pixel.x.

Getter:

Returns the x coordinate of the pixel. Read-only version.

property y[source]

The y coordinate of the pixel.

Getter:

Returns the y coordinate of the pixel.

Setter:

Sets the y coordinate of the pixel.

property ydata[source]

Equivalent to Pixel.y.

Getter:

Returns the y coordinate of the pixel. Read-only version.

class finesse.detectors.camera.ScanLine(npts, dtype, x=None, y=None, xlim=None, ylim=None)[source]

Bases: object

Data structure representation of a slice of an image.

Parameters

xscalar or None

The x coordinate of the slice.

yscalar or None

The y coordinate of the slice.

xlimscalar or size two sequence

The limits of the x-axis scan lines. A single number gives \(x_{\mathrm{axis}} \in [-|x|, +|x|]\), or a tuple of size two gives \(x_{\mathrm{axis}} \in [x[0], x[1]]\).

ylimscalar or array-like

The limits of the y-axis scan lines. A single number gives \(y_{\mathrm{axis}} \in [-|y|, +|y|]\), or a tuple of size two gives \(y_{\mathrm{axis}} \in [y[0], y[1]]\).

nptsint

Number of points in slice axis.

dtypestr or dtype

Data type of the slice to pass to NumPy for array creation.

property direction[source]

The slice axis - i.e. ‘x’ for x-axis, ‘y’ for y-axis.

Getter:

Returns a string determining the slice axis (read-only).

property npts[source]

Number of pixels in the scanning axis.

Getter:

Returns the number of pixels in the slice axis.

Setter:

Sets the number of pixels in the slice axis.

property x[source]

The x co-ordinate of the slice.

If ScanLine.direction is ‘x’ then this will return None.

Getter:

Returns the x coordinate of the slice.

Setter:

Sets the x coordinate of the slice.

property xdata[source]

The numeric value(s) of the x coordinate.

If ScanLine.direction is ‘x’ then this will be a copy of the array of values, otherwise it is a single value equivalent to ScanLine.x.

Getter:

The x coordinate value(s). Read-only.

property xlim[source]

The limits of the slice in the x-axis.

If ScanLine.direction is ‘y’ then this will return None.

Getter:

Returns a tuple of (xmin, xmax).

Setter:

Sets the x-axis limits.

property y[source]

The y co-ordinate of the slice.

If ScanLine.direction is ‘y’ then this will return None.

Getter:

Returns the y coordinate of the slice.

Setter:

Sets the y coordinate of the slice.

property ydata[source]

The numeric value(s) of the y coordinate.

If ScanLine.direction is ‘y’ then this will be a copy of the array of values, otherwise it is a single value equivalent to ScanLine.y.

Getter:

The y coordinate value(s). Read-only.

property ylim[source]

The limits of the slice in the y-axis.

If ScanLine.direction is ‘x’ then this will return None.

Getter:

Returns a tuple of (ymin, ymax).

Setter:

Sets the y-axis limits.