LOST  0.0.1
LOST: Open-source Star Tracker
lost::PairDistanceKVectorDatabase Class Reference

A database storing distances between pairs of stars. More...

#include <databases.hpp>

Public Member Functions

 PairDistanceKVectorDatabase (DeserializeContext *des)
 Create the database from a serialized buffer. More...
 
const int16_t * FindPairsLiberal (decimal min, decimal max, const int16_t **end) const
 Return at least all the star pairs whose inter-star distance is between min and max. More...
 
const int16_t * FindPairsExact (const Catalog &, decimal min, decimal max, const int16_t **end) const
 
std::vector< decimalStarDistances (int16_t star, const Catalog &) const
 Return the distances from the given star to each star it's paired with in the database (for debugging). More...
 
decimal MaxDistance () const
 Upper bound on stored star pair distances. More...
 
decimal MinDistance () const
 Lower bound on stored star pair distances. More...
 
long NumPairs () const
 Exact number of stored pairs. More...
 

Static Public Attributes

static const int32_t kMagicValue = 0x2536f009
 Magic value to use when storing inside a MultiDatabase. More...
 

Detailed Description

A database storing distances between pairs of stars.

Supports fast range queries to find all pairs of stars separated by approximately a certain distance.

Warning
Sensitive to uncalibrated camera parameters

Definition at line 54 of file databases.hpp.

Constructor & Destructor Documentation

◆ PairDistanceKVectorDatabase()

lost::PairDistanceKVectorDatabase::PairDistanceKVectorDatabase ( DeserializeContext des)
explicit

Create the database from a serialized buffer.

Definition at line 221 of file databases.cpp.

Here is the call graph for this function:

Member Function Documentation

◆ FindPairsExact()

const int16_t * lost::PairDistanceKVectorDatabase::FindPairsExact ( const Catalog catalog,
decimal  min,
decimal  max,
const int16_t **  end 
) const

Definition at line 248 of file databases.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ FindPairsLiberal()

const int16_t * lost::PairDistanceKVectorDatabase::FindPairsLiberal ( decimal  minQueryDistance,
decimal  maxQueryDistance,
const int16_t **  end 
) const

Return at least all the star pairs whose inter-star distance is between min and max.

Parameters
end[out]Is set to an "off-the-end" pointer, one past the last pair being returned by the query.
Returns
A pointer to the start of the matched pairs. Each pair is stored as simply two 16-bit integers, each of which is a catalog index. (you must increment the pointer twice to get to the next pair).

Definition at line 237 of file databases.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ MaxDistance()

decimal lost::PairDistanceKVectorDatabase::MaxDistance ( ) const
inline

Upper bound on stored star pair distances.

Definition at line 63 of file databases.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ MinDistance()

decimal lost::PairDistanceKVectorDatabase::MinDistance ( ) const
inline

Lower bound on stored star pair distances.

Definition at line 65 of file databases.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ NumPairs()

long lost::PairDistanceKVectorDatabase::NumPairs ( ) const

Exact number of stored pairs.

Number of star pairs stored in the database.

Definition at line 282 of file databases.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ StarDistances()

std::vector< decimal > lost::PairDistanceKVectorDatabase::StarDistances ( int16_t  star,
const Catalog catalog 
) const

Return the distances from the given star to each star it's paired with in the database (for debugging).

Definition at line 287 of file databases.cpp.

Here is the call graph for this function:

Member Data Documentation

◆ kMagicValue

const int32_t lost::PairDistanceKVectorDatabase::kMagicValue = 0x2536f009
static

Magic value to use when storing inside a MultiDatabase.

Definition at line 70 of file databases.hpp.


The documentation for this class was generated from the following files: