Ellipsoid¶
giant.ray_tracer.shapes.ellipsoid
:
- class giant.ray_tracer.shapes.ellipsoid.Ellipsoid(self, center, principal_axes=None, orientation=None, ellipsoid_matrix=None, albedo_map=None, _bounding_box=None, _id=None)¶
A shape for modelling spheres and triaxial ellipsoidal bodies.
Most of the large objects in the solar system are generally ellipsoidal in shape. Therefore, when rendering these objects it can be much more efficient to actually model them as a triaxial ellipsoid, which can generally be traced more efficiently than even a KDTree due to having only 1 surface to check. Therefore, when you’re dealing with a shape well modeled by a triaxial ellipsoid it is recommended that you use this class.
This class works like other
Shape
classes in GIANT. It providestrace()
andcompute_intersect()
for calculating the intersect between the object and a ray. It provides methodsfind_limbs()
andcompute_limb_jacobian()
to identify points along the limb of the target and how those points change when the location of the observer is changed. In addition, it provides methodsrotate()
andtranslate()
methods for moving the ellipsoid in the scene and an axis aligned bounding box in attributebounding_box
.In GIANT the triaxial ellipsoid is represented in matrix form, that is:
Where
is the ellipsoid matrix in the current frame , is the rotation matrix from the principal frame of the ellipsoid ( , where the principal axes are aligned with the frame axes) to the current frame, and are the lengths of the principal axes of the ellipsoid. From this class you can retrieve each component of the ellipsoid matrix.ellipsoid_matrix
gives ,principal_axes
gives as a length 3 array, andorientation
gives as a 3x3 rotation matrix. In addition, the center of the ellipsoid in the current frame is in attributecenter
.In addition to being its own object in a scene, the
Ellipsoid
class is also used to represent theSurface.reference_ellipsoid
for a surface (used when doing limb based nav with irregular bodies inlimb_matching
as well as theSceneObject.circumscribing_sphere
attribute of a scene object which is used to determine which pixels need traced for a specific object in the scene.To initialize this class, you can either provide the ellipsoid matrix itself (which will be decomposed into its components), the principal axes themselves (in which case it will be assumed the object is currently in its principle frame), the principal axes and the orientation, or all 3 (though note that if its all 3 we don’t check to be sure they’re consistent). Also, note that any parameters beginning with an _ in the init method are primarily for pickling/unpickling the object and can mostly be ignored by the user.
- Parameters:
center (Optional[ARRAY_LIKE]) – The center of the ellipsoid in the current frame as a length 3 array
principal_axes (Optional[ARRAY_LIKE]) – The length of each principal axis of the ellipsoid as a length 3 array
orientation (Optional[ARRAY_LIKE]) – The rotation matrix from the principal frame for the ellipsoid to the current frame.
ellipsoid_matrix (Optional[ARRAY_LIKE]) – The full 3x3 ellipsoid matrix as defined above
albedo_map (Optional[Callable[[np.ndarray], np.ndarray]]) – The albedo map for the ellipsoid. This should take the form of a callable object which takes in an nx2 array of latitude/longitude in radians and returns a length n array of the albedo values for each point.
_bounding_box (Optional[ARRAY_LIKE]) – The AxisAlignedBoundingBox for the ellipsoid. This is typically just used for pickling/unpickling
_id (int) – The unique id for the ellipsoid object. This is typically only used for pickling/unpickling.
- bounding_box: AxisAlignedBoundingBox¶
The
AxisAlignedBoundingBox
that fully contains this Ellipsoid.
- id: int¶
The unique identifier for this ellipsoid as an integer.
- albedo_map: Callable[[numpy.ndarray], numpy.ndarray] | None¶
The albedo map for the ellipsoid as a callable object which takes in an nx2 array of latitude/longitude in radians and returns a length n array of the albedo values for each point.
Typically this is an instance of
scipy.interpolate.RegularGridInterpolator
or similar.
- center¶
The location of the center of th ellipsoid in the current frame as a length 3 numpy array.
- ellipsoid_matrix¶
The ellipsoid matrix in the current frame for the ellipsoid as a 3x3 numpy array.
Mathematically this is given by:
Where
is the ellipsoid matrix in the current frame , is the rotation matrix from the principal frame of the ellipsoid ( , where the principal axes are aligned with the frame axes) to the current frame, and are the lengths of the principal axes of the ellipsoid.
- orientation¶
The rotation matrix from the principal axis frame to the current frame for the ellipsoid as a 3x3 numpy array.
- principal_axes¶
The lengths of the principal axes of the ellipsoid as a length 3 numpy array
Summary of Methods
This method computes the surface albedo for a location on the surface of the ellipsoid expressed in the principal frame of the ellipsoid. |
|
This method computes the AABB for the ellipsoid. |
|
This method computes the intersect between a single ray and the ellipsoid, returning an |
|
This method computes the linear change in the limb location given a change in the relative position between the ellipsoid and the observer. |
|
This method computes the local surface normal for a location on the surface of the ellipsoid. |
|
The method determines the limb points (visible edge of the ellipsoid) that would be an observed for an observer located at |
|
This method determines where the provides rays strike this tri-axial ellipsoid. |
|
This method rotates the ellipsoid into a new frame. |
|
This method computes the intersect between rays and the ellipsoid, returning an |
|
This method translates the ellipsoid center. |