26 #include "lsst/afw/image/Wcs.h" 28 namespace lsst {
namespace meas {
namespace astrom {
namespace sip {
46 afw::table::SourceCatalog
const& imgSet,
47 CONST_PTR(lsst::afw::image::Wcs) wcs,
48 afw::geom::Angle dist)
59 throw LSST_EXCEPT(pex::exceptions::InvalidParameterError,
"Distance must be > 0");
79 if (!_imgSet.getTable()->hasCentroidSlot()) {
81 pex::exceptions::LogicError,
82 "SourceTable passed to MatchSrcToCatalogue does not have its centroid slot set." 86 for (afw::table::SourceCatalog::const_iterator i = _imgSet.begin(); i != _imgSet.end(); ++i) {
87 i->updateCoord(*_wcs);
90 _match = afw::table::matchRaDec(_catSet, _imgSet, _dist);
100 void MatchSrcToCatalogue::_removeOneToMany() {
101 std::size_t size = _match.size();
102 for (std::size_t i=0; i<size; ++i) {
103 for (std::size_t j=i+1; j<size; ++j) {
105 if ( _match[i].first == _match[j].first ) {
107 if (_match[i].distance < _match[j].distance) {
108 _match.erase(_match.begin() + j);
112 _match.erase(_match.begin() + i);
125 void MatchSrcToCatalogue::_removeManyToOne() {
126 std::size_t size = _match.size();
127 for (std::size_t i=0; i<size; ++i) {
128 for (std::size_t j=i+1; j<size; ++j) {
130 if (_match[i].second == _match[j].second) {
132 if (_match[i].distance < _match[j].distance) {
133 _match.erase(_match.begin() + j);
137 _match.erase(_match.begin() + i);
void setWcs(boost::shared_ptr< afw::image::Wcs const > wcs)
Set a different Wcs solution.
void setCatSrcSet(afw::table::SimpleCatalog const &catSet)
void setImgSrcSet(afw::table::SourceCatalog const &srcSet)
sourceSet is a vector of pointers to Sources.
afw::table::ReferenceMatchVector getMatches()
MatchSrcToCatalogue(afw::table::SimpleCatalog const &catSet, afw::table::SourceCatalog const &imgSet, boost::shared_ptr< afw::image::Wcs const > wcs, afw::geom::Angle dist)
Create a list of common objects from a catalogue and an image.
void setDist(afw::geom::Angle dist)
Set a new value for the maximum allowed distance between two matching objects (in ra/dec space) ...