swiftest.SwiftestDataset.rotate#
- SwiftestDataset.rotate(rotvec=None, pole=None, skip_vars=['space', 'Ip'])[source]#
Rotates the coordinate system such that the z-axis is aligned with an input pole. The new pole is defined by the input vector. This will change all variables in the Dataset that have the “space” dimension, except for those passed to the skip_vars parameter.
- Parameters:
ds (SwiftestDataset) – Dataset containing the vector quantity
rotvec ((N,3) or (3,) float array) – Rotation vector
pole ((3) float array) – New pole vector
skip_vars (list of str, optional) – List of variable names to skip. The default is [‘space’,’Ip’].
- Returns:
ds (SwiftestDataset) – Dataset with the new pole vector applied to all variables with the “space” dimension
Notes
You can pass either rotvec or pole, but not both. If both, or none, are passed, the function will raise an exception.