IdentityTransform

class bapsf_motion.transform.identity.IdentityTransform(drive: Drive, **kwargs)

Bases: BaseTransform

Class that defines an Identity coordinate transform, i.e. the motion space and probe drive coordinates are the same.

transform type: 'identity'

Parameters:
  • drive (Drive) – The instance of Drive the coordinate transformer will be working with.

  • kwargs (Dict[str, Any]) – No extra Keywords are required to define this class, however, any supplied keywords will be included in the config dictionary.

Examples

The identity transform is super simple to instantiate/configure, since there are no defining keywords.

tr = IdentityTransform(drive)

Attributes Summary

axes

A list of axis identifiers.

config

A dictionary containing the coordinate transformation configuration.

dimensionality

The designed dimensionality of the transform.

naxes

The number of axes of the probe drive.

transform_type

String naming the coordinate transformation type.

Methods Summary

__call__(points[,Β to_coords])

Perform a coordinate transformation on the supplied points.

matrix(points[,Β to_coords])

The transformation matrix used to transform from probe drive coordinates to motion space coordinates, and vice versa.

Attributes Documentation

axes

A list of axis identifiers.

config

A dictionary containing the coordinate transformation configuration.

dimensionality

The designed dimensionality of the transform. If -1, then the transform does not have a fixed dimensionality, and it can morph to the associated Drive.

naxes

The number of axes of the probe drive.

This is the same as the motion space dimensionality.

transform_type

String naming the coordinate transformation type. This is unique among all subclasses of BaseTransform.

Methods Documentation

__call__(points, to_coords='drive') ndarray

Perform a coordinate transformation on the supplied points.

Parameters:
  • points (array_like) – A single point or array of points for which the transformation will be generated. The array of points needs to be of size \(M\) or \(N \times M\) where \(M\) is the dimensionality of the motion space and \(N\) is the number of points to be transformed.

  • to_coords (str) – If "drive", then generate a transformation matrix that converts motion space coordinates to probe drive coordinates. If "motion space", then generate a transformation matrix that converts probe drive coordinates to motion space coordinates. (DEFAULT: "drive")

Returns:

tr_points – The points calculated from the coordinate transformation of points. The returned array has the same dimensionality as points.

Return type:

array_like

matrix(points, to_coords='drive') ndarray

The transformation matrix used to transform from probe drive coordinates to motion space coordinates, and vice versa.

Parameters:
  • points (array_like) – A single point or array of points for which the transformation matrix will be generated. The array of points needs to be of size \(M\) or \(N \times M\) where \(M\) is the dimensionality of the motion space and \(N\) is the number of points to be transformed.

  • to_coords (str) – If "drive", then generate a transformation matrix that converts motion space coordinates to probe drive coordinates. If "motion space", then generate a transformation matrix that converts probe drive coordinates to motion space coordinates. (DEFAULT: "drive")

Returns:

matrix – A transformation matrix of size \(N \times M+1 \times M+1\). The \(M+1\) dimensionality allows for the inclusion of a dimension for coordinate translations.

Return type:

array_like

Notes

The generated matrix must have a dimensionality of \(N \times M+1 \times M+1\) where \(M\) is the dimensionality of the motion space and \(N\) is the number of points passed in. The +1 in the transformation matrix dimensionality corresponds to a dimension that allows for translational shifts in the coordinate transformation. For example, if a 2D probe drive is being used then the generated matrix for a single point would have a size of \(1 \times 3 \times 3\).

The matrix generation takes a points argument because not all transformations are agnostic of the starting location, for example, the XY LaPD probe drive.