LSST Applications g0265f82a02+0e5473021a,g02d81e74bb+0dd8ce4237,g1470d8bcf6+3ea6592b6f,g2079a07aa2+86d27d4dc4,g2305ad1205+5ca4c0b359,g295015adf3+d10818ec9d,g2a9a014e59+6f9be1b9cd,g2bbee38e9b+0e5473021a,g337abbeb29+0e5473021a,g3ddfee87b4+703ba97ebf,g487adcacf7+4fa16da234,g50ff169b8f+96c6868917,g52b1c1532d+585e252eca,g591dd9f2cf+ffa42b374e,g5a732f18d5+53520f316c,g64a986408d+0dd8ce4237,g858d7b2824+0dd8ce4237,g8a8a8dda67+585e252eca,g99cad8db69+d39438377f,g9ddcbc5298+9a081db1e4,ga1e77700b3+15fc3df1f7,ga8c6da7877+f1d96605c8,gb0e22166c9+60f28cb32d,gb6a65358fc+0e5473021a,gba4ed39666+c2a2e4ac27,gbb8dafda3b+e5339d463f,gc120e1dc64+da31e9920e,gc28159a63d+0e5473021a,gcf0d15dbbd+703ba97ebf,gdaeeff99f8+f9a426f77a,ge6526c86ff+889fc9d533,ge79ae78c31+0e5473021a,gee10cc3b42+585e252eca,gf18bd8381d+7268b93478,gff1a9f87cc+0dd8ce4237,w.2024.16
LSST Data Management Base Package
Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
lsst::meas::astrom::sip::MatchSrcToCatalogue Class Reference

Match a SourceSet of objects with known ra/dec with a SourceSet of objects with known xy positions Take a catalogue of objects with known positions, a catalogue of objects with known xy, and a wcs to convert one xy <--> ra/dec. More...

#include <MatchSrcToCatalogue.h>

Public Types

typedef std::shared_ptr< MatchSrcToCataloguePtr
 
typedef std::shared_ptr< MatchSrcToCatalogue const > ConstPtr
 

Public Member Functions

 MatchSrcToCatalogue (afw::table::SimpleCatalog const &catSet, afw::table::SourceCatalog const &imgSet, std::shared_ptr< afw::geom::SkyWcs const > wcs, geom::Angle dist)
 Create a list of common objects from a catalogue and an image.
 
void setDist (geom::Angle dist)
 Set a new value for the maximum allowed distance between two matching objects (in ra/dec space)
 
void setWcs (std::shared_ptr< afw::geom::SkyWcs 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.
 
void findMatches ()
 
afw::table::ReferenceMatchVector getMatches ()
 

Detailed Description

Match a SourceSet of objects with known ra/dec with a SourceSet of objects with known xy positions Take a catalogue of objects with known positions, a catalogue of objects with known xy, and a wcs to convert one xy <--> ra/dec.

This class then finds the set of objects with common ra/dec.

The simplest usage is to create an object of this class, then access the corresponence sets with getMatchedImgSet() and getMatchedCatSet(). Creating the object automatically calculates the sets of corresponences for you. If you are unhappy with these matches, you can change one or more of your input arguments and redo the match with findMatches()

Using this class has the side effect of updating the coord field of the input SourceCatalog (which may be desirable).

Definition at line 57 of file MatchSrcToCatalogue.h.

Member Typedef Documentation

◆ ConstPtr

Definition at line 60 of file MatchSrcToCatalogue.h.

◆ Ptr

Definition at line 59 of file MatchSrcToCatalogue.h.

Constructor & Destructor Documentation

◆ MatchSrcToCatalogue()

lsst::meas::astrom::sip::MatchSrcToCatalogue::MatchSrcToCatalogue ( afw::table::SimpleCatalog const & catSet,
afw::table::SourceCatalog const & imgSet,
std::shared_ptr< afw::geom::SkyWcs const > wcs,
geom::Angle dist )

Create a list of common objects from a catalogue and an image.

Take a catSet, i.e a SimpleCatalog giving the true positions of objects in ra/dec space, and an imageSet, i.e. a SourceCatalog of the pixel positions of sources detected on a CCD image. Use the Wcs to calculate the ra/dec of the image source, and then find the subset of objects withcommon positions in the two sets. The returned list of matches is one-to-one, i.e no object in the catalogue is matched twice, and no object in the imageSet is matched twice.

Parameters
catSetList of catalogue positions with known ra and dec
imgSetList of image positions with known x and y
wcsA Wcs object to convert from xy to radec
distHow close to objects need to be in order to be considered the same

Definition at line 49 of file MatchSrcToCatalogue.cc.

51 {
52 setImgSrcSet(imgSet);
53 setCatSrcSet(catSet);
54 setDist(dist);
55 setWcs(wcs);
56}
void setWcs(std::shared_ptr< afw::geom::SkyWcs const > wcs)
Set a different Wcs solution.
void setDist(geom::Angle dist)
Set a new value for the maximum allowed distance between two matching objects (in ra/dec space)
void setCatSrcSet(afw::table::SimpleCatalog const &catSet)
void setImgSrcSet(afw::table::SourceCatalog const &srcSet)
sourceSet is a vector of pointers to Sources.

Member Function Documentation

◆ findMatches()

void lsst::meas::astrom::sip::MatchSrcToCatalogue::findMatches ( )

Definition at line 74 of file MatchSrcToCatalogue.cc.

74 {
75 if (!_imgSet.getTable()->getCentroidSlot().isValid()) {
76 throw LSST_EXCEPT(pex::exceptions::LogicError,
77 "SourceTable passed to MatchSrcToCatalogue does not have its centroid slot set.");
78 }
79
80 for (afw::table::SourceCatalog::const_iterator i = _imgSet.begin(); i != _imgSet.end(); ++i) {
81 i->updateCoord(*_wcs);
82 }
83
84 _match = afw::table::matchRaDec(_catSet, _imgSet, _dist);
85
86 _removeOneToMany();
87 _removeManyToOne();
88}
#define LSST_EXCEPT(type,...)
Create an exception with a given type.
Definition Exception.h:48
typename Base::const_iterator const_iterator
std::vector< Match< typename Cat1::Record, typename Cat2::Record > > matchRaDec(Cat1 const &cat1, Cat2 const &cat2, lsst::geom::Angle radius, MatchControl const &mc=MatchControl())
Compute all tuples (s1,s2,d) where s1 belings to cat1, s2 belongs to cat2 and d, the distance between...
Definition Match.cc:158

◆ getMatches()

afw::table::ReferenceMatchVector lsst::meas::astrom::sip::MatchSrcToCatalogue::getMatches ( )

Definition at line 139 of file MatchSrcToCatalogue.cc.

139 {
140 findMatches();
141 return _match;
142}

◆ setCatSrcSet()

void lsst::meas::astrom::sip::MatchSrcToCatalogue::setCatSrcSet ( afw::table::SimpleCatalog const & catSet)

Definition at line 72 of file MatchSrcToCatalogue.cc.

72{ _catSet = srcSet; }

◆ setDist()

void lsst::meas::astrom::sip::MatchSrcToCatalogue::setDist ( geom::Angle dist)

Set a new value for the maximum allowed distance between two matching objects (in ra/dec space)

Definition at line 59 of file MatchSrcToCatalogue.cc.

59 {
60 if (dist <= 0) {
61 throw LSST_EXCEPT(pex::exceptions::InvalidParameterError, "Distance must be > 0");
62 }
63 _dist = dist;
64}

◆ setImgSrcSet()

void lsst::meas::astrom::sip::MatchSrcToCatalogue::setImgSrcSet ( afw::table::SourceCatalog const & srcSet)

sourceSet is a vector of pointers to Sources.

Definition at line 70 of file MatchSrcToCatalogue.cc.

70{ _imgSet = srcSet; }

◆ setWcs()

void lsst::meas::astrom::sip::MatchSrcToCatalogue::setWcs ( std::shared_ptr< afw::geom::SkyWcs const > wcs)

Set a different Wcs solution.

Definition at line 67 of file MatchSrcToCatalogue.cc.

67{ _wcs = wcs; }
table::Key< table::Array< std::uint8_t > > wcs
Definition SkyWcs.cc:66

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