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

Star catalog. More...

#include <sc_star_catalog.h>

Public Member Functions

 star_catalog (ml_matrix starData, double date=2448347.75)
 Initialize a catalog from star data. The default date is 2448347.75. More...
 
 star_catalog (const char *fileName, double date=2448347.75)
 Initialize a catalog from a text file. The default date is 2448347.75. More...
 
void set_date (double newDate)
 Set the catalog reference date. More...
 
void set_name (string newName)
 Set the catalog string name. More...
 
starget_star (int id)
 Look up a star using its ID. More...
 
const double get_date ()
 Get the catalog reference date. More...
 
const string get_name ()
 Get the catalog name. More...
 
const int size ()
 Return the number of stars in the catalog. More...
 
const ml_matrix unit_vectors (double jd_now)
 Get the unit vectors for the full catalog. More...
 
const ml_matrix visual_magnitude ()
 Get the magnitudes for the full catalog. More...
 
const ml_int_array hipparcos_ids ()
 Get the Hipparcos IDs. More...
 
int remove_stars (double angleTol)
 Remove stars that are too close together to resolve. More...
 
bool is_valid ()
 Check the catalog status.
 

Friends

class near_matrix
 

Detailed Description

Star catalog.

The catalog is a map using the Hipparcos ID as a key. The near_matrix class is a friend which allows the access to the underlying map of stars when building the near matrix for a given field of view.

Constructor & Destructor Documentation

◆ star_catalog() [1/2]

star_catalog::star_catalog ( ml_matrix  starData,
double  date = 2448347.75 
)

Initialize a catalog from star data. The default date is 2448347.75.

Load a star catalog from a Nx8 matrix.

The matrix has the following format:

  • Column 1: Hipparcos ID
  • Column 2: Visual magnitude
  • Column 3: Right ascension (rad)
  • Column 4: Declination (rad)
  • Column 5: Parallax
  • Column 6: Radial velocity
  • Column 7: Proper motion term, right ascension
  • Column 8: Proper motion term, declination

The matrix may also contain only the first four rows in which case the motion terms will be zero.

◆ star_catalog() [2/2]

star_catalog::star_catalog ( const char *  fileName,
double  date = 2448347.75 
)

Initialize a catalog from a text file. The default date is 2448347.75.

Load a catalog from a file.

Creates a matrix from the file which is then passed to the matrix catalog constructor.

Member Function Documentation

◆ set_date()

void star_catalog::set_date ( double  newDate)

Set the catalog reference date.

Specify a reference Julian date for the catalog.

◆ set_name()

void star_catalog::set_name ( string  newName)

Set the catalog string name.

Specify a name for the catalog.

◆ get_star()

star * star_catalog::get_star ( int  id)

Look up a star using its ID.

Get a star.

Parameters
idHipparcos ID of star

◆ get_date()

const double star_catalog::get_date ( )

Get the catalog reference date.

Get the reference date.

Returns
Reference Julian date of catalog

◆ get_name()

const string star_catalog::get_name ( )

Get the catalog name.

Get the name of the catalog.

Returns
String name of catalog

◆ size()

const int star_catalog::size ( )

Return the number of stars in the catalog.

Number of stars in the catalog.

◆ unit_vectors()

const ml_matrix star_catalog::unit_vectors ( double  jd_now)

Get the unit vectors for the full catalog.

Unit vector for the full catalog accounting for star motion.

Parameters
jd_nowCurrent Julian date
Returns
Star unit vectors, 3xN matrix.

Referenced by remove_stars().

◆ visual_magnitude()

const ml_matrix star_catalog::visual_magnitude ( )

Get the magnitudes for the full catalog.

Magnitudes for the full catalog.

Returns
Star magnitudes, 1xN matrix.

◆ hipparcos_ids()

const ml_int_array star_catalog::hipparcos_ids ( )

Get the Hipparcos IDs.

Get the star IDs from the map.

Returns
Star IDs, 1xN int array.

◆ remove_stars()

int star_catalog::remove_stars ( double  angleTol)

Remove stars that are too close together to resolve.

Remove stars that are closer together than the input tolerance.

Parameters
angleTolTolerance angle (radians)
Returns
Number of stars removed

References unit_vectors().