attitude.geom package¶
Submodules¶
attitude.geom.conics module¶
-
class
attitude.geom.conics.
Conic
[source]¶ Bases:
numpy.ndarray
-
angle_subtended
(**kwargs)¶ Compute the half angle subtended (or min and max angles) for an offset elliptical conic from the origin or an arbitrary viewpoint.
- kwargs:
- tangent Return tangent instead of angle (default false) viewpoint Defaults to origin
-
contains
(p, shell_only=False)[source]¶ Check to see whether point is inside conic.
Parameters: exact – Only solutions exactly on conic are considered (default: False).
-
dual
()[source]¶ The inverse conic that represents the bundle of lines tangent to this conic.
Conics and their duals, p 159
-
classmethod
from_axes
(axes)[source]¶ Get axis-aligned elliptical conic from axis lenths This can be converted into a hyperbola by getting the dual conic
-
classmethod
from_semiaxes
(axes)[source]¶ Get axis-aligned elliptical conic from axis lenths This can be converted into a hyperbola by getting the dual conic
-
polar_plane
(vector)[source]¶ Calculates the polar plane to a vector (a ‘pole’) for a given conic section. For poles outside the conic, the polar plane contains all vectors of tangency to the pole.
-
projection
(**kwargs)[source]¶ The elliptical cut of an ellipsoidal conic describing all points of tangency to the conic as viewed from the origin.
-
semiaxes
()[source]¶ Semiaxial lengths for ellipsoid and hyperboloid (need to be aligned with coordinate system for now, could integrate with major_axes method below for added clarity.
-
attitude.geom.symbolic_math module¶
attitude.geom.test_conics module¶
-
attitude.geom.test_conics.
get_offset_center
(a, b)[source]¶ Get the center of an offset ellipse corresponding to the lengths of the hyperbolic axes
-
attitude.geom.test_conics.
test_angular_shadow
()[source]¶ Check that we can compute the angular shadow of an offset error ellipse.
attitude.geom.test_hyperbolic_errors module¶
Test module to make sure that simple representations of hyperbolic errors are equivalent to more generalized expressions.
-
attitude.geom.test_hyperbolic_errors.
simple_hyperbola
(cov, xvals, n=1, level=1)[source]¶ Simple hyperbolic error bounds for 2d errors using quadratic formulation.
- Returns tuple of
- ( distance from center of distribution,
- width of error bar)
in unrotated coordinate space
-
attitude.geom.test_hyperbolic_errors.
test_error_projection
()[source]¶ Test projection of errors into error ellipsoid and hyperboloid, and recovery of angular errors
-
attitude.geom.test_hyperbolic_errors.
test_hyperbolic_projection
()[source]¶ Fully projective mechanism to get hyperbolic error bounds in a generalized way along any axes associated with the plane.
attitude.geom.test_offset_ellipse module¶
This test module is designed to show the exact relationship between the PCA error lengths defined from covariance matrices and the hyperbolic and ellipsoidal error bounds
-
attitude.geom.test_offset_ellipse.
test_angular_shadow
()[source]¶ Make sure we can successfully recover an angular shadow from an ellipse offset from the origin, a simple two dimensional case of the more general 3d solution.
BASIS: an ellipse with semiaxes [1,1] centered at [0,2] will have a half angular shadow of 30º
attitude.geom.transform module¶
attitude.geom.util module¶
-
class
attitude.geom.util.
Plane
[source]¶ Bases:
numpy.ndarray
-
attitude.geom.util.
angle
(v1, v2, cos=False)[source]¶ Find the angle between two vectors.
Parameters: cos – If True, the cosine of the angle will be returned. False by default.
-
attitude.geom.util.
augment
(vec)[source]¶ Augment a vector in any orthonormal basis with a trailing 1 to form a homogeneous coordinate vector in that coordinate system.
-
attitude.geom.util.
augment_tensor
(matrix, ndim=None)[source]¶ Increase the dimensionality of a tensor, splicing it into an identity matrix of a higher dimension. Useful for generalizing transformation matrices.
-
attitude.geom.util.
column
(vec)[source]¶ Return a vector with a new trailing axis (of singular dimension) added.
Module contents¶
-
attitude.geom.
aligned_covariance
(fit, type='noise')[source]¶ Covariance rescaled so that eigenvectors sum to 1 and rotated into data coordinates from PCA space
-
attitude.geom.
axis_aligned_transforms
()[source]¶ Generates three transformation matrices to map three-dimensional data down to slices on the xy, xz and yz planes, respectively. The typical use case for this is to iterate over the results of this method to provide arguments to e.g. the HyperbolicErrors function.