fieldtransform

This module contains a set of functions for transforming vector and tensor fields based on an input transformation matrix.

pyvale.fieldtransform.transform_tensor_2d(trans_mat: ndarray, tensor: ndarray) ndarray[source]

Transforms a 2D tensor field assuming the shear terms are symmetric.

Parameters:
  • trans_mat (np.ndarray) -- Transformation matrix with shape=(2,2)

  • tensor (np.ndarray) -- Tensor field with shape=(3,num_points) where the rows are the XX, YY and XY components of the tensor field

Returns:

np.ndarray -- Transformed tensor field with shape=(3,num_points) where the rows are the XX, YY and XY components of the tensor field.

pyvale.fieldtransform.transform_tensor_2d_batch(trans_mat: ndarray, tensor: ndarray) ndarray[source]

Performs a batched transformation of a 2D tensor field assuming the shear terms are symmetric. Assumes the same transformation is applied to all sensors in the array so they can be processed together for speed.

Parameters:
  • trans_mat (np.ndarray) -- Transformation matrix with shape=(2,2)

  • tensor (np.ndarray) -- Tensor field with shape=(num_sensors,3,num_points) where the rows are the XX, YY and XY components of the tensor field

Returns:

np.ndarray -- Transformed tensor field with shape=(num_sensors,3,num_time_steps) where the rows are the XX, YY and XY components of the tensor field.

pyvale.fieldtransform.transform_tensor_3d(trans_mat: ndarray, tensor: ndarray) ndarray[source]

Transforms a 3D tensor field assuming all the shear terms are symmetric.

Parameters:
  • trans_mat (np.ndarray) -- Transformation matrix with shape=(3,3).

  • tensor (np.ndarray) -- Tensor field with shape=(6,num_points), where the rows are the XX, YY, ZZ, XY, XZ and YZ components of the field.

Returns:

np.ndarray -- Transformed tensor field with shape=(6,num_points), where the rows are the XX, YY, ZZ, XY, XZ and YZ components of the field.

pyvale.fieldtransform.transform_tensor_3d_batch(trans_mat: ndarray, tensor: ndarray) ndarray[source]

Performs a batched transformation a 3D tensor field assuming all the shear terms are symmetric. Assumes all sensors have the same transformation applied so they can be processed together for speed.

Parameters:
  • trans_mat (np.ndarray) -- Transformation matrix with shape=(3,3).

  • tensor (np.ndarray) -- Tensor field with shape=(num_sensors,6,num_points), where the rows are the XX, YY, ZZ, XY, XZ and YZ components of the field.

Returns:

np.ndarray -- Transformed tensor field with shape=(num_sensors,6,num_points), where the rows are the XX, YY, ZZ, XY, XZ and YZ components of the field.

pyvale.fieldtransform.transform_vector_2d(trans_mat: ndarray, vector: ndarray) ndarray[source]

Transforms a 2D vector field based on the input transformation matrix.

Parameters:
  • trans_mat (np.ndarray) -- Transformation matrix with shape=(2,2)

  • vector (np.ndarray) -- Vector field with shape = (2,num_points), where the first row are the X components of the field and the second row are the Y components.

Returns:

np.ndarray -- Transformed vector field with shape (2,num_points).

pyvale.fieldtransform.transform_vector_2d_batch(trans_mat: ndarray, vector: ndarray) ndarray[source]

Performs a batched 2D vector transformation for a series of sensors assuming all sensors have the same transformation matrix.

Parameters:
  • trans_mat (np.ndarray) -- Transformation matrix with shape=(2,2).

  • vector (np.ndarray) -- Input vector field to transform with shape=(num_sensors,2,num_time_steps ) where the second dimension is the X and Y components of the vector field.

Returns:

np.ndarray -- Transformed vector field with shape=(num_sensors,2,num_time_steps), where the second dimension is the X and Y components of the transformed vector field.

pyvale.fieldtransform.transform_vector_3d(trans_mat: ndarray, vector: ndarray) ndarray[source]

Transforms a 3D vector field based on the input transformation matrix.

Parameters:
  • trans_mat (np.ndarray) -- Transformation matrix with shape=(3,3).

  • vector (np.ndarray) -- Vector field with shape = (3,num_points), where the rows are the X, Y and Z components of the vector field.

Returns:

np.ndarray -- Transformed vector field with shape=(3,num_points).

pyvale.fieldtransform.transform_vector_3d_batch(trans_mat: ndarray, vector: ndarray) ndarray[source]

Performs a batched 3D vector transformation for a series of sensors assuming all sensors have the same transformation matrix.

Parameters:
  • trans_mat (np.ndarray) -- Transformation matrix with shape=(3,3).

  • vector (np.ndarray) -- Input vector field to transform with shape=(num_sensors,3,num_time_steps ) where the second dimension is the X, Y and Z components of the vector field.

Returns:

np.ndarray -- Transformed vector field with shape=(num_sensors,2,num_time_steps), where the second dimension is the X, Y and Z components of the transformed vector field.