lsst.jointcal  22.0.1-9-geb3bca9+0e4b923fe9
Classes | Public Member Functions | Public Attributes | List of all members
lsst::jointcal::FastFinder Class Reference

This is an auxillary class for matching objects from starlists. More...

#include <FastFinder.h>

Classes

class  Iterator
 Iterator meant to traverse objects within some limiting distance. More...
 

Public Member Functions

 FastFinder (const BaseStarList &list, const unsigned nXSlice=100)
 Constructor. More...
 
std::shared_ptr< const BaseStarfindClosest (const Point &where, const double maxDist, bool(*SkipIt)(const BaseStar &)=nullptr) const
 Find the closest with some rejection capability. More...
 
std::shared_ptr< const BaseStarsecondClosest (const Point &where, const double maxDist, std::shared_ptr< const BaseStar > &closest, bool(*SkipIt)(const BaseStar &)=nullptr) const
 
void print (std::ostream &out) const
 mostly for debugging More...
 
Iterator beginScan (const Point &where, double maxDist) const
 
void findRangeInSlice (const int iSlice, const double yStart, const double yEnd, pstar &start, pstar &end) const
 
pstar locateYStart (pstar begin, pstar end, double yVal) const
 
pstar locateYEnd (pstar begin, pstar end, double yVal) const
 

Public Attributes

decltype(stars) typedef ::value_type stars_element
 
decltype(stars) typedef ::const_iterator pstar
 
const BaseStarList baselist
 
unsigned count
 
std::vector< std::shared_ptr< const BaseStar > > stars
 
unsigned nslice
 
std::vector< unsigned > index
 
double xmin
 
double xmax
 
double xstep
 

Detailed Description

This is an auxillary class for matching objects from starlists.

It allows to locate rapidly the closest objects from a given position. The very simple strategy is to sort objects according to 1 coordinate x, and to build an index that allows to select the objects with the x coordinate inside an interval. Then every slice in x is sorted according to y, which enables a fast scan inside a x slice. listMatchCollect takes about 10ms (PC 450 MHz, optimized "-O4") for a match between lists of about 2000 objects each, which is fast enough for our needs. The same "locator" is used in listMatchupShift, to avoid scanning the whole input lists. Timing on listMatchCollect and listMatchupShift indicates a gain in speed by more than one order of magnitude after implementation of this FastFinder. Fast locator in starlists.

Definition at line 54 of file FastFinder.h.

Constructor & Destructor Documentation

◆ FastFinder()

lsst::jointcal::FastFinder::FastFinder ( const BaseStarList list,
const unsigned  nXSlice = 100 
)

Constructor.

Definition at line 38 of file FastFinder.cc.

Member Function Documentation

◆ beginScan()

FastFinder::Iterator lsst::jointcal::FastFinder::beginScan ( const Point where,
double  maxDist 
) const

Definition at line 174 of file FastFinder.cc.

◆ findClosest()

std::shared_ptr< const BaseStar > lsst::jointcal::FastFinder::findClosest ( const Point where,
const double  maxDist,
bool(*)(const BaseStar &)  SkipIt = nullptr 
) const

Find the closest with some rejection capability.

Definition at line 83 of file FastFinder.cc.

◆ findRangeInSlice()

void lsst::jointcal::FastFinder::findRangeInSlice ( const int  iSlice,
const double  yStart,
const double  yEnd,
pstar start,
pstar end 
) const

Definition at line 168 of file FastFinder.cc.

◆ locateYEnd()

FastFinder::pstar lsst::jointcal::FastFinder::locateYEnd ( pstar  begin,
pstar  end,
double  yVal 
) const

Definition at line 152 of file FastFinder.cc.

◆ locateYStart()

FastFinder::pstar lsst::jointcal::FastFinder::locateYStart ( pstar  begin,
pstar  end,
double  yVal 
) const

Definition at line 134 of file FastFinder.cc.

◆ print()

void lsst::jointcal::FastFinder::print ( std::ostream out) const

mostly for debugging

Definition at line 77 of file FastFinder.cc.

◆ secondClosest()

std::shared_ptr< const BaseStar > lsst::jointcal::FastFinder::secondClosest ( const Point where,
const double  maxDist,
std::shared_ptr< const BaseStar > &  closest,
bool(*)(const BaseStar &)  SkipIt = nullptr 
) const

Definition at line 101 of file FastFinder.cc.

Member Data Documentation

◆ baselist

const BaseStarList lsst::jointcal::FastFinder::baselist

Definition at line 56 of file FastFinder.h.

◆ count

unsigned lsst::jointcal::FastFinder::count

Definition at line 58 of file FastFinder.h.

◆ index

std::vector<unsigned> lsst::jointcal::FastFinder::index

Definition at line 66 of file FastFinder.h.

◆ nslice

unsigned lsst::jointcal::FastFinder::nslice

Definition at line 65 of file FastFinder.h.

◆ pstar

decltype(stars) typedef ::const_iterator lsst::jointcal::FastFinder::pstar

Definition at line 70 of file FastFinder.h.

◆ stars

std::vector<std::shared_ptr<const BaseStar> > lsst::jointcal::FastFinder::stars

Definition at line 64 of file FastFinder.h.

◆ stars_element

decltype(stars) typedef ::value_type lsst::jointcal::FastFinder::stars_element

Definition at line 69 of file FastFinder.h.

◆ xmax

double lsst::jointcal::FastFinder::xmax

Definition at line 67 of file FastFinder.h.

◆ xmin

double lsst::jointcal::FastFinder::xmin

Definition at line 67 of file FastFinder.h.

◆ xstep

double lsst::jointcal::FastFinder::xstep

Definition at line 67 of file FastFinder.h.


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