lsst.jointcal
16.0-3-g21cc1d5+6
|
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 BaseStar > | findClosest (const Point &where, const double maxDist, bool(*SkipIt)(const BaseStar &)=nullptr) const |
Find the closest with some rejection capability. More... | |
std::shared_ptr< const BaseStar > | secondClosest (const Point &where, const double maxDist, std::shared_ptr< const BaseStar > &closest, bool(*SkipIt)(const BaseStar &)=nullptr) const |
void | dump () 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 |
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 31 of file FastFinder.h.
lsst::jointcal::FastFinder::FastFinder | ( | const BaseStarList & | list, |
const unsigned | nXSlice = 100 |
||
) |
Constructor.
Definition at line 14 of file FastFinder.cc.
FastFinder::Iterator lsst::jointcal::FastFinder::beginScan | ( | const Point & | where, |
double | maxDist | ||
) | const |
Definition at line 151 of file FastFinder.cc.
void lsst::jointcal::FastFinder::dump | ( | ) | const |
mostly for debugging
Definition at line 54 of file FastFinder.cc.
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 60 of file FastFinder.cc.
void lsst::jointcal::FastFinder::findRangeInSlice | ( | const int | iSlice, |
const double | yStart, | ||
const double | yEnd, | ||
pstar & | start, | ||
pstar & | end | ||
) | const |
Definition at line 145 of file FastFinder.cc.
FastFinder::pstar lsst::jointcal::FastFinder::locateYEnd | ( | pstar | begin, |
pstar | end, | ||
double | yVal | ||
) | const |
Definition at line 129 of file FastFinder.cc.
FastFinder::pstar lsst::jointcal::FastFinder::locateYStart | ( | pstar | begin, |
pstar | end, | ||
double | yVal | ||
) | const |
Definition at line 111 of file FastFinder.cc.
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 78 of file FastFinder.cc.
const BaseStarList lsst::jointcal::FastFinder::baselist |
Definition at line 33 of file FastFinder.h.
unsigned lsst::jointcal::FastFinder::count |
Definition at line 35 of file FastFinder.h.
std::vector<unsigned> lsst::jointcal::FastFinder::index |
Definition at line 43 of file FastFinder.h.
unsigned lsst::jointcal::FastFinder::nslice |
Definition at line 42 of file FastFinder.h.
decltype(stars) typedef ::const_iterator lsst::jointcal::FastFinder::pstar |
Definition at line 47 of file FastFinder.h.
std::vector<std::shared_ptr<const BaseStar> > lsst::jointcal::FastFinder::stars |
Definition at line 41 of file FastFinder.h.
decltype(stars) typedef ::value_type lsst::jointcal::FastFinder::stars_element |
Definition at line 46 of file FastFinder.h.
double lsst::jointcal::FastFinder::xmax |
Definition at line 44 of file FastFinder.h.
double lsst::jointcal::FastFinder::xmin |
Definition at line 44 of file FastFinder.h.
double lsst::jointcal::FastFinder::xstep |
Definition at line 44 of file FastFinder.h.