IdentityTransformο
- class bapsf_motion.transform.identity.IdentityTransform(drive: Drive, **kwargs)ο
Bases:
BaseTransformClass that defines an Identity coordinate transform, i.e. the motion space and probe drive coordinates are the same.
transform type:
'identity'- Parameters:
Examples
The identity transform is super simple to instantiate/configure, since there are no defining keywords.
tr = IdentityTransform(drive)
tr = transform_factory(drive, tr_type = "identity")
[...transform] type = "identity"
config["transform"] = {"type": "identity"}
Attributes Summary
A list of axis identifiers.
A dictionary containing the coordinate transformation configuration.
The designed dimensionality of the transform.
The number of axes of the probe drive.
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 associatedDrive.
- 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 aspoints.- Return type:
- 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:
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
pointsargument because not all transformations are agnostic of the starting location, for example, the XY LaPD probe drive.