LSST Applications g180d380827+46ec7ae9a6,g2079a07aa2+86d27d4dc4,g2305ad1205+561f0b4c6e,g2bbee38e9b+c6a8a0fb72,g337abbeb29+c6a8a0fb72,g33d1c0ed96+c6a8a0fb72,g3a166c0a6a+c6a8a0fb72,g3d1719c13e+4b175340dc,g3ddfee87b4+e72d28e2d1,g487adcacf7+2f6f39ce3c,g50ff169b8f+96c6868917,g52b1c1532d+585e252eca,g591dd9f2cf+a10213cc50,g62aa8f1a4b+bf10eb883e,g858d7b2824+4b175340dc,g991b906543+4b175340dc,g99cad8db69+af57a9dece,g9c22b2923f+e2510deafe,g9ddcbc5298+9a081db1e4,g9fbc5161f1+30b2b595e6,ga1e77700b3+03d07e1c1f,gb0e22166c9+60f28cb32d,gb23b769143+4b175340dc,gba4ed39666+c2a2e4ac27,gbb8dafda3b+6155d6700f,gbd998247f1+585e252eca,gbeadb96d05+67a36bdf6a,gc120e1dc64+7a34493dbd,gc28159a63d+c6a8a0fb72,gc3e9b769f7+95821ff628,gcf0d15dbbd+e72d28e2d1,gdaeeff99f8+f9a426f77a,ge6526c86ff+3d1b9a9f4a,ge79ae78c31+c6a8a0fb72,gee10cc3b42+585e252eca,w.2024.18
LSST Data Management Base Package
Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
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

Definition at line 34 of file FootprintMerge.cc.

◆ 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
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)
T get(T... args)

◆ 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: