LSST Applications g063fba187b+cac8b7c890,g0f08755f38+6aee506743,g1653933729+a8ce1bb630,g168dd56ebc+a8ce1bb630,g1a2382251a+b4475c5878,g1dcb35cd9c+8f9bc1652e,g20f6ffc8e0+6aee506743,g217e2c1bcf+73dee94bd0,g28da252d5a+1f19c529b9,g2bbee38e9b+3f2625acfc,g2bc492864f+3f2625acfc,g3156d2b45e+6e55a43351,g32e5bea42b+1bb94961c2,g347aa1857d+3f2625acfc,g35bb328faa+a8ce1bb630,g3a166c0a6a+3f2625acfc,g3e281a1b8c+c5dd892a6c,g3e8969e208+a8ce1bb630,g414038480c+5927e1bc1e,g41af890bb2+8a9e676b2a,g7af13505b9+809c143d88,g80478fca09+6ef8b1810f,g82479be7b0+f568feb641,g858d7b2824+6aee506743,g89c8672015+f4add4ffd5,g9125e01d80+a8ce1bb630,ga5288a1d22+2903d499ea,gb58c049af0+d64f4d3760,gc28159a63d+3f2625acfc,gcab2d0539d+b12535109e,gcf0d15dbbd+46a3f46ba9,gda6a2b7d83+46a3f46ba9,gdaeeff99f8+1711a396fd,ge79ae78c31+3f2625acfc,gef2f8181fd+0a71e47438,gf0baf85859+c1f95f4921,gfa517265be+6aee506743,gfa999e8aa5+17cd334064,w.2024.51
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: