Spacecraft Control Framework 1.0
Spacecraft Control Library
Public Member Functions | List of all members
near_matrix Class Reference

Near matrix class. More...

#include <sc_star_catalog.h>

Public Member Functions

 near_matrix ()
 Default constructor. More...
 
 near_matrix (star_catalog catalog, double field_of_view)
 Create a near matrix from the star catalog. More...
 
 near_matrix (ml_int_array ids, ml_matrix u_star, double field_of_view)
 Create a near matrix from the star unit vectors. More...
 
vector< StarDotget_angle_range (double angle, double tol)
 Use the k-vector to extract a subset of the stored dot products. More...
 
vector< StarDotget_nearby_stars (int star_id)
 Retrieve dot products stored for a specific star. More...
 
int size ()
 

Detailed Description

Near matrix class.

This is a collection of star dot products defined for a given star catalog and camera field of view. This implementation stores a k-vector which allows lookup of dot products within a range of angles without performing a search.

Constructor & Destructor Documentation

◆ near_matrix() [1/3]

near_matrix::near_matrix ( )

Default constructor.

Clear the list of dot products.

◆ near_matrix() [2/3]

near_matrix::near_matrix ( star_catalog  catalog,
double  field_of_view 
)

Create a near matrix from the star catalog.

Parameters
catalogA star catalog
field_of_viewThe field of view of the camera, in radians. This is the total field of view, not the half-angle.

References star::UnitVector().

◆ near_matrix() [3/3]

near_matrix::near_matrix ( ml_int_array  ids,
ml_matrix  u_star,
double  field_of_view 
)

Create a near matrix from the star unit vectors.

This stored a vector of StarDot objects sorted by star angle.

Parameters
idsArray of star IDs, to be stored with the angles
u_starStar unit vectors from the catalog
field_of_viewThe field of view of the camera, in radians. This is the total field of view, not the half-angle. If the field of view is square or rectangular this should be the length of the diagonal.

Member Function Documentation

◆ get_angle_range()

vector< StarDot > near_matrix::get_angle_range ( double  angle,
double  tol 
)

Use the k-vector to extract a subset of the stored dot products.

Parameters
angleThe star angle of interest
tolA tolerance for specifying a range around the angle, +/- tol
Returns
A vector of StarDot objects within the range

Referenced by star_meas::Pyramid().

◆ get_nearby_stars()

vector< StarDot > near_matrix::get_nearby_stars ( int  star_id)

Retrieve dot products stored for a specific star.

Parameters
star_idID of star
Returns
Vector of dot products in the near matrix with star_id