public class FacetCelestialBody extends UserCelestialBody implements GeometricBodyShape
This class offers an optimal storage under a Binary Space Partition Tree (BSP Tree). Each of the body facet (class
Triangle
) is linked to its neighbors. Each of the body vertex (class Vertex
) is also linked to its
neighboring triangles Triangle
. Hence this class provides very efficient methods (O(log n)) for intersection
computation, neighbors computation, etc.
This class inherits interfaces CelestialBody
and GeometricBodyShape
:
GeometricBodyShape
, this class can be used in conjunction with EclipseDetector
and
SensorModel
.CelestialBody
, this class can be used with any CelestialBody
-related class (attitude laws,
etc.).Constructor and Description |
---|
FacetCelestialBody(String name,
PVCoordinatesProvider pvBody,
double gm,
IAUPole iauPole,
MeshProvider meshLoader)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
double |
distanceTo(Line line,
Frame frame,
AbsoluteDate date)
Computes the distance to a line.
|
Frame |
getBodyFrame()
Get body frame related to body shape.
|
FieldData |
getFieldData(SpacecraftState state,
IFieldOfView fieldOfView,
Vector3D lineOfSight)
Returns the field data as
FieldData for each state in provided list. |
ExtendedOneAxisEllipsoid |
getInnerSphere()
Returns Inner reference sphere which is largest sphere strictly contained in mesh and centered around (0, 0, 0).
|
Intersection |
getIntersection(Line line,
Vector3D close,
Frame frame,
AbsoluteDate date)
Get the intersection point with associated triangle of a line with the surface of the body in the body frame.
|
GeodeticPoint |
getIntersectionPoint(Line line,
Vector3D close,
Frame frame,
AbsoluteDate date)
Get the intersection point of a line with the surface of the body.
|
Vector3D[] |
getIntersectionPoints(Line line,
Frame frame,
AbsoluteDate date)
Compute the intersection points with a line.
|
double |
getLocalAltitude(double latitude,
double longitude)
Returns the altitude of body at point (latitude, longitude).
|
double |
getLocalAltitude(Vector3D direction)
Returns the altitude of body given provided direction in body frame.
|
double |
getLocalRadius(Vector3D position,
Frame frame,
AbsoluteDate date,
PVCoordinatesProvider occultedBody)
Calculate the apparent radius.
|
double |
getMaxNorm()
Returns the distance from center to farthest vertex to center of body.
|
double |
getMinNorm()
Returns the distance from center to closest vertex to center of body.
|
List<Triangle> |
getNeighbors(GeodeticPoint point,
double maxDistance)
Returns the neighbors of provided geodetic point whose center is closer than provided distance.
|
List<Triangle> |
getNeighbors(GeodeticPoint point,
int order)
Returns the neighbor triangles of provided geodetic point which are closer or equal to provided
order of "neighborhood".
|
List<Triangle> |
getNeighbors(Triangle triangle,
double maxDistance)
Returns the neighbors of provided triangle whose center is closer than provided distance of provided triangle
center.
|
List<Triangle> |
getNeighbors(Triangle triangle,
int order)
Returns the neighbors of provided triangle whose distance in terms of triangle is closer or equal to provided
order of "neighborhood".
|
List<Triangle> |
getNeighbors(Vector3D pos,
double maxDistance)
Returns the neighbors of provided cartesian point whose center is closer than provided distance.
|
List<Triangle> |
getNeighbors(Vector3D pos,
int order)
Returns the neighbor triangles of provided cartesian point which are closer or equal to provided
order of "neighborhood".
|
List<Triangle> |
getNeverEnlightenedTriangles(List<AbsoluteDate> dates,
PVCoordinatesProvider sun)
Returns the list of triangles never enlightened by the Sun at provided dates.
|
List<Triangle> |
getNeverVisibleTriangles(List<SpacecraftState> states,
IFieldOfView fieldOfView)
Returns the list of triangles never visible from the satellite field of view during the whole ephemeris.
|
ExtendedOneAxisEllipsoid |
getReferenceEllipsoid()
Returns reference ellipsoid which is ellipsoid (a, f) which minimize distance to all vertices.
|
List<SurfacePointedData> |
getSurfacePointedDataEphemeris(List<SpacecraftState> states,
Vector3D lineOfSight,
PVCoordinatesProvider sun,
double pixelFOV)
Returns the body surface pointed data as
SurfacePointedData for each state in provided list. |
Triangle[] |
getTriangles()
Returns the mesh under a list of triangles.
|
List<Triangle> |
getVisibleAndEnlightenedTriangles(List<SpacecraftState> states,
PVCoordinatesProvider sun,
IFieldOfView fieldOfView)
Returns the list of triangles enlightened (by the Sun) and visible at least once during the whole ephemeris
from the satellite field of view.
|
boolean |
isInEclipse(AbsoluteDate date,
Vector3D position,
Frame frame,
PVCoordinatesProvider sun)
Returns true if provided position in provided frame at provided date in in eclipse or not.
|
Vector3D |
transform(GeodeticPoint point)
Transform a surface-relative point to a cartesian point.
|
GeodeticPoint |
transform(Vector3D point,
Frame frame,
AbsoluteDate date)
Transform a cartesian point to a surface-relative point.
|
getPVCoordinates, toString
getBodyOrientedFrame, getGM, getInertiallyOrientedFrame, getName
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getName
getPVCoordinates
public FacetCelestialBody(String name, PVCoordinatesProvider pvBody, double gm, IAUPole iauPole, MeshProvider meshLoader) throws PatriusException
name
- body namepvBody
- Body PV coordinatesgm
- body gravitational parameteriauPole
- IAU pole modelmeshLoader
- mesh loaderPatriusException
- thrown if loading failedpublic Triangle[] getTriangles()
public final Frame getBodyFrame()
getBodyFrame
in interface BodyShape
public GeodeticPoint getIntersectionPoint(Line line, Vector3D close, Frame frame, AbsoluteDate date) throws PatriusException
A line may have several intersection points with a closed surface (we consider the one point case as a degenerated two points case). The close parameter is used to select which of these points should be returned. The selected point is the one that is closest to the close point.
getIntersectionPoint
in interface BodyShape
line
- test line (may intersect the body or not)close
- point used for intersections selectionframe
- frame in which line is expresseddate
- date of the line in given framePatriusException
- if line cannot be converted to body framepublic Vector3D[] getIntersectionPoints(Line line, Frame frame, AbsoluteDate date) throws PatriusException
getIntersectionPoints
in interface GeometricBodyShape
line
- the lineframe
- in which line is expresseddate
- date of the line in given framePatriusException
- if line cannot be converted to body framepublic Intersection getIntersection(Line line, Vector3D close, Frame frame, AbsoluteDate date) throws PatriusException
A line may have several intersection points with a closed surface (we consider the one point case as a degenerated two points case). The close parameter is used to select which of these points should be returned. The selected point is the one that is closest to the close point.
Warning: does not take into account sight direction. The line is considered to be infinite.
line
- test line (may intersect the body or not)close
- point used for intersections selection in frameframe
- frame in which line is expresseddate
- date of the line in given framePatriusException
- if line cannot be converted to body framepublic GeodeticPoint transform(Vector3D point, Frame frame, AbsoluteDate date) throws PatriusException
Warning: this method considers the body as the inner sphere (which is largest sphere strictly contained in the mesh.
transform
in interface BodyShape
point
- cartesian pointframe
- frame in which cartesian point is expresseddate
- date of the computation (used for frames conversions)PatriusException
- if point cannot be converted to body framepublic Vector3D transform(GeodeticPoint point)
Warning: this method considers the body as the inner sphere (which is largest sphere strictly contained in the mesh.
public double getLocalAltitude(double latitude, double longitude) throws PatriusException
Altitude is relative to the inner sphere to the body (which is the largest sphere strictly inside the mesh).
latitude
- latitudelongitude
- longitudePatriusException
- thrown if failed to compute intersectionpublic double getLocalAltitude(Vector3D direction) throws PatriusException
Altitude is relative to the inner sphere to the body (which is the largest sphere strictly inside the mesh).
direction
- direction in body framePatriusException
- thrown if failed to compute intersectionpublic double distanceTo(Line line, Frame frame, AbsoluteDate date) throws PatriusException
Warning: in case of strongly not convex bodies, this methods may not return exact minimal distance.
distanceTo
in interface GeometricBodyShape
line
- the lineframe
- in which line is expresseddate
- date of the line in given framePatriusException
- if line cannot be converted to body framepublic double getLocalRadius(Vector3D position, Frame frame, AbsoluteDate date, PVCoordinatesProvider occultedBody) throws PatriusException
Warning: this method considers the body as the closest one axis ellipsoid to the body (which is the one minimizing the distance to each vertex).
getLocalRadius
in interface GeometricBodyShape
position
- spacecraft positionframe
- frame in which position is expresseddate
- date of positionoccultedBody
- body occulted by thisPatriusException
- if PVCoordinatesProvider
computation failspublic List<Triangle> getNeighbors(Triangle triangle, double maxDistance)
Provided triangle is included in the list of neighbors.
Beware not to confuse this method with getNeighbors(Triangle, int)
triangle
- a trianglemaxDistance
- max distancepublic List<Triangle> getNeighbors(Triangle triangle, int order)
Beware not to confuse this method with getNeighbors(Triangle, double)
triangle
- a triangleorder
- order of "neighborhood"public List<Triangle> getNeighbors(GeodeticPoint point, double maxDistance) throws PatriusException
point
- a geodetic pointmaxDistance
- max distancePatriusException
- thrown if computation failed (should not happen)public List<Triangle> getNeighbors(GeodeticPoint point, int order) throws PatriusException
Beware not to confuse this method with getNeighbors(GeodeticPoint, double)
point
- a geodetic pointorder
- order of "neighborhood"PatriusException
- thrown if computation failed (should not happen)public List<Triangle> getNeighbors(Vector3D pos, double maxDistance) throws PatriusException
pos
- a point in body framemaxDistance
- max distancePatriusException
- thrown if computation failed (should not happen)public List<Triangle> getNeighbors(Vector3D pos, int order) throws PatriusException
Beware not to confuse this method with getNeighbors(Vector3D, double)
pos
- a point in body frameorder
- order of "neighborhood"PatriusException
- thrown if computation failed (should not happen)public List<SurfacePointedData> getSurfacePointedDataEphemeris(List<SpacecraftState> states, Vector3D lineOfSight, PVCoordinatesProvider sun, double pixelFOV) throws PatriusException
SurfacePointedData
for each state in provided list.states
- list of spacecraft stateslineOfSight
- line of sight in spacecraft framesun
- Sun bodypixelFOV
- aperture of field of view for one pixelSurfacePointedData
, one per provided datePatriusException
- thrown if state position could not be retrieved in body frame or if intersection is null
or Sun frame conversion failedpublic FieldData getFieldData(SpacecraftState state, IFieldOfView fieldOfView, Vector3D lineOfSight) throws PatriusException
FieldData
for each state in provided list.state
- spacecraft statefieldOfView
- sensor field of viewlineOfSight
- optional parameter in order to indicate field of view main line of sight in spacecraft frame.
If provided, this parameter may fasten algorithm by several order of magnitudes (O(log n) vs O(n)).
Be careful, in this case, strongly not convex bodies may lead to missing some triangles.FieldData
for corresponding statePatriusException
- thrown if state position could not be retrieved in body framepublic boolean isInEclipse(AbsoluteDate date, Vector3D position, Frame frame, PVCoordinatesProvider sun) throws PatriusException
Computed eclipse status is exact and takes into account full body shape. This methods cannot however be used in
conjunction with EclipseDetector
since they use a different framework.
date
- dateposition
- positionframe
- frame in which position is expressedsun
- Sun bodyPatriusException
- thrown if failed to retrieve Sun position of intersection points with bodypublic List<Triangle> getNeverVisibleTriangles(List<SpacecraftState> states, IFieldOfView fieldOfView) throws PatriusException
states
- list of spacecraft statesfieldOfView
- field of viewTriangle
never visible from the satellite field of view during the whole ephemerisPatriusException
- thrown if state position could not be retrieved in body framepublic List<Triangle> getNeverEnlightenedTriangles(List<AbsoluteDate> dates, PVCoordinatesProvider sun) throws PatriusException
dates
- list of datessun
- Sun bodyTriangle
never enlightened by the SunPatriusException
- thrown if state position could not be retrieved in body framepublic List<Triangle> getVisibleAndEnlightenedTriangles(List<SpacecraftState> states, PVCoordinatesProvider sun, IFieldOfView fieldOfView) throws PatriusException
states
- list of spacecraft statessun
- sunfieldOfView
- field of viewTriangle
enlightened and visible at least once from the satellite field of viewPatriusException
- thrown if state position could not be retrieved in body framepublic ExtendedOneAxisEllipsoid getReferenceEllipsoid()
public ExtendedOneAxisEllipsoid getInnerSphere()
public double getMinNorm()
public double getMaxNorm()
Copyright © 2021 CNES. All rights reserved.