LSST Applications  21.0.0-147-g0e635eb1+1acddb5be5,22.0.0+052faf71bd,22.0.0+1ea9a8b2b2,22.0.0+6312710a6c,22.0.0+729191ecac,22.0.0+7589c3a021,22.0.0+9f079a9461,22.0.1-1-g7d6de66+b8044ec9de,22.0.1-1-g87000a6+536b1ee016,22.0.1-1-g8e32f31+6312710a6c,22.0.1-10-gd060f87+016f7cdc03,22.0.1-12-g9c3108e+df145f6f68,22.0.1-16-g314fa6d+c825727ab8,22.0.1-19-g93a5c75+d23f2fb6d8,22.0.1-19-gb93eaa13+aab3ef7709,22.0.1-2-g8ef0a89+b8044ec9de,22.0.1-2-g92698f7+9f079a9461,22.0.1-2-ga9b0f51+052faf71bd,22.0.1-2-gac51dbf+052faf71bd,22.0.1-2-gb66926d+6312710a6c,22.0.1-2-gcb770ba+09e3807989,22.0.1-20-g32debb5+b8044ec9de,22.0.1-23-gc2439a9a+fb0756638e,22.0.1-3-g496fd5d+09117f784f,22.0.1-3-g59f966b+1e6ba2c031,22.0.1-3-g849a1b8+f8b568069f,22.0.1-3-gaaec9c0+c5c846a8b1,22.0.1-32-g5ddfab5d3+60ce4897b0,22.0.1-4-g037fbe1+64e601228d,22.0.1-4-g8623105+b8044ec9de,22.0.1-5-g096abc9+d18c45d440,22.0.1-5-g15c806e+57f5c03693,22.0.1-7-gba73697+57f5c03693,master-g6e05de7fdc+c1283a92b8,master-g72cdda8301+729191ecac,w.2021.39
LSST Data Management Base Package
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  newFootprint->getPeaks().push_back(newPeak);
51  }
52  _source->setFootprint(newFootprint);
53  }
CatalogIterator< typename Internal::iterator > iterator
Definition: Catalog.h:111
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 107 of file FootprintMerge.cc.

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

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

◆ addSpans()

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

Definition at line 130 of file FootprintMerge.cc.

130  {
131  if (!getMergedFootprint()->getSpans()->overlaps(*(footprint->getSpans()))) return false;
132  getMergedFootprint()->setSpans(getMergedFootprint()->getSpans()->union_(*(footprint->getSpans())));
133  return true;
134  }
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 122 of file FootprintMerge.cc.

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

◆ getMergedFootprint()

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

Definition at line 124 of file FootprintMerge.cc.

124 { return _source->getFootprint(); }

◆ getSource()

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

Definition at line 126 of file FootprintMerge.cc.

126 { 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 68 of file FootprintMerge.cc.

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

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