LSST Applications 28.0.2,g0fba68d861+5b923b673a,g1fd858c14a+7a7b9dd5ed,g2c84ff76c0+5548bfee71,g30358e5240+f0e04ebe90,g35bb328faa+fcb1d3bbc8,g436fd98eb5+bdc6fcdd04,g4af146b050+742274f7cd,g4d2262a081+3efd3f8190,g4e0f332c67+cb09b8a5b6,g53246c7159+fcb1d3bbc8,g5a012ec0e7+477f9c599b,g5edb6fd927+826dfcb47f,g60b5630c4e+bdc6fcdd04,g67b6fd64d1+2218407a0c,g78460c75b0+2f9a1b4bcd,g786e29fd12+cf7ec2a62a,g7b71ed6315+fcb1d3bbc8,g87b7deb4dc+f9ac2ab1bd,g8852436030+ebf28f0d95,g89139ef638+2218407a0c,g9125e01d80+fcb1d3bbc8,g989de1cb63+2218407a0c,g9f33ca652e+42fb53f4c8,g9f7030ddb1+11b9b6f027,ga2b97cdc51+bdc6fcdd04,gab72ac2889+bdc6fcdd04,gabe3b4be73+1e0a283bba,gabf8522325+3210f02652,gb1101e3267+9c79701da9,gb58c049af0+f03b321e39,gb89ab40317+2218407a0c,gcf25f946ba+ebf28f0d95,gd6cbbdb0b4+e8f9c9c900,gd9a9a58781+fcb1d3bbc8,gde0f65d7ad+a08f294619,ge278dab8ac+3ef3db156b,ge410e46f29+2218407a0c,gf67bdafdda+2218407a0c
LSST Data Management Base Package
Loading...
Searching...
No Matches
lsst::afw::detection::FootprintMerge Class Reference

Public Types

using KeyTuple = FootprintMergeList::KeyTuple
 
using FilterMap = FootprintMergeList::FilterMap
 

Public Member Functions

 FootprintMerge (std::shared_ptr< Footprint > footprint, std::shared_ptr< afw::table::SourceTable > sourceTable, std::shared_ptr< PeakTable > peakTable, afw::table::SchemaMapper const &peakSchemaMapper, KeyTuple const &keys)
 
 ~FootprintMerge ()=default
 
 FootprintMerge (FootprintMerge const &)=default
 
 FootprintMerge (FootprintMerge &&)=default
 
FootprintMergeoperator= (FootprintMerge const &)=default
 
FootprintMergeoperator= (FootprintMerge &&)=default
 
bool overlaps (Footprint const &rhs) const
 
void add (std::shared_ptr< Footprint > footprint, afw::table::SchemaMapper const &peakSchemaMapper, KeyTuple const &keys, float minNewPeakDist=-1., float maxSamePeakDist=-1.)
 
void add (FootprintMerge const &other, FilterMap const &keys, float minNewPeakDist=-1., float maxSamePeakDist=-1.)
 
lsst::geom::Box2I getBBox () const
 
std::shared_ptr< FootprintgetMergedFootprint () const
 
std::shared_ptr< afw::table::SourceRecordgetSource () const
 
bool addSpans (std::shared_ptr< Footprint > footprint)
 

Detailed Description

Definition at line 31 of file FootprintMerge.cc.

Member Typedef Documentation

◆ FilterMap

◆ KeyTuple

using lsst::afw::detection::FootprintMerge::KeyTuple = FootprintMergeList::KeyTuple

Definition at line 33 of file FootprintMerge.cc.

Constructor & Destructor Documentation

◆ FootprintMerge() [1/3]

lsst::afw::detection::FootprintMerge::FootprintMerge ( std::shared_ptr< Footprint > footprint,
std::shared_ptr< afw::table::SourceTable > sourceTable,
std::shared_ptr< PeakTable > peakTable,
afw::table::SchemaMapper const & peakSchemaMapper,
KeyTuple const & keys )
inlineexplicit

Definition at line 36 of file FootprintMerge.cc.

40 : _footprints(1, footprint), _source(sourceTable->makeRecord()) {
41 std::shared_ptr<Footprint> newFootprint = std::make_shared<Footprint>(*footprint);
42
43 _source->set(keys.footprint, true);
44 // Replace all the Peaks in the merged Footprint with new ones that include the origin flags
45 newFootprint->getPeaks() = PeakCatalog(peakTable);
46 for (PeakCatalog::iterator iter = footprint->getPeaks().begin(); iter != footprint->getPeaks().end();
47 ++iter) {
48 std::shared_ptr<PeakRecord> newPeak = peakTable->copyRecord(*iter, peakSchemaMapper);
49 newPeak->set(keys.peak, true);
50 newPeak->setId((*newFootprint->getPeaks().getTable()->getIdFactory())());
51 newFootprint->getPeaks().push_back(newPeak);
52 }
53 _source->setFootprint(newFootprint);
54 }
CatalogIterator< typename Internal::iterator > iterator
Definition Catalog.h:110
T make_shared(T... args)
afw::table::CatalogT< PeakRecord > PeakCatalog
Definition Peak.h:244

◆ ~FootprintMerge()

lsst::afw::detection::FootprintMerge::~FootprintMerge ( )
default

◆ FootprintMerge() [2/3]

lsst::afw::detection::FootprintMerge::FootprintMerge ( FootprintMerge const & )
default

◆ FootprintMerge() [3/3]

lsst::afw::detection::FootprintMerge::FootprintMerge ( FootprintMerge && )
default

Member Function Documentation

◆ add() [1/2]

void lsst::afw::detection::FootprintMerge::add ( FootprintMerge const & other,
FilterMap const & keys,
float minNewPeakDist = -1.,
float maxSamePeakDist = -1. )
inline

Definition at line 108 of file FootprintMerge.cc.

109 {
110 if (addSpans(other.getMergedFootprint())) {
111 _footprints.insert(_footprints.end(), other._footprints.begin(), other._footprints.end());
112 // Set source flags to the OR of the flags of the two inputs
113 for (auto const &key : keys) {
114 afw::table::Key<afw::table::Flag> const &flagKey = key.second.footprint;
115 _source->set(flagKey, _source->get(flagKey) || other._source->get(flagKey));
116 }
117 _addPeaks(other.getMergedFootprint()->getPeaks(), nullptr, nullptr, minNewPeakDist, maxSamePeakDist,
118 &keys);
119 }
120 }
bool addSpans(std::shared_ptr< Footprint > footprint)

◆ add() [2/2]

void lsst::afw::detection::FootprintMerge::add ( std::shared_ptr< Footprint > footprint,
afw::table::SchemaMapper const & peakSchemaMapper,
KeyTuple const & keys,
float minNewPeakDist = -1.,
float maxSamePeakDist = -1. )
inline

Definition at line 86 of file FootprintMerge.cc.

87 {
88 if (addSpans(footprint)) {
89 _footprints.push_back(footprint);
90 _source->set(keys.footprint, true);
91 _addPeaks(footprint->getPeaks(), &peakSchemaMapper, &keys, minNewPeakDist, maxSamePeakDist, nullptr);
92 }
93 }

◆ addSpans()

bool lsst::afw::detection::FootprintMerge::addSpans ( std::shared_ptr< Footprint > footprint)
inline

Definition at line 131 of file FootprintMerge.cc.

131 {
132 if (!getMergedFootprint()->getSpans()->overlaps(*(footprint->getSpans()))) return false;
133 getMergedFootprint()->setSpans(getMergedFootprint()->getSpans()->union_(*(footprint->getSpans())));
134 return true;
135 }
bool overlaps(Footprint const &rhs) const
std::shared_ptr< Footprint > getMergedFootprint() const

◆ getBBox()

lsst::geom::Box2I lsst::afw::detection::FootprintMerge::getBBox ( ) const
inline

Definition at line 123 of file FootprintMerge.cc.

123{ return getMergedFootprint()->getBBox(); }

◆ getMergedFootprint()

std::shared_ptr< Footprint > lsst::afw::detection::FootprintMerge::getMergedFootprint ( ) const
inline

Definition at line 125 of file FootprintMerge.cc.

125{ return _source->getFootprint(); }

◆ getSource()

std::shared_ptr< afw::table::SourceRecord > lsst::afw::detection::FootprintMerge::getSource ( ) const
inline

Definition at line 127 of file FootprintMerge.cc.

127{ return _source; }

◆ operator=() [1/2]

FootprintMerge & lsst::afw::detection::FootprintMerge::operator= ( FootprintMerge && )
default

◆ operator=() [2/2]

FootprintMerge & lsst::afw::detection::FootprintMerge::operator= ( FootprintMerge const & )
default

◆ overlaps()

bool lsst::afw::detection::FootprintMerge::overlaps ( Footprint const & rhs) const
inline

Definition at line 69 of file FootprintMerge.cc.

69 {
70 return getMergedFootprint()->getSpans()->overlaps(*(rhs.getSpans()));
71 }

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