LSST Applications  21.0.0-172-gfb10e10a+18fedfabac,22.0.0+297cba6710,22.0.0+80564b0ff1,22.0.0+8d77f4f51a,22.0.0+a28f4c53b1,22.0.0+dcf3732eb2,22.0.1-1-g7d6de66+2a20fdde0d,22.0.1-1-g8e32f31+297cba6710,22.0.1-1-geca5380+7fa3b7d9b6,22.0.1-12-g44dc1dc+2a20fdde0d,22.0.1-15-g6a90155+515f58c32b,22.0.1-16-g9282f48+790f5f2caa,22.0.1-2-g92698f7+dcf3732eb2,22.0.1-2-ga9b0f51+7fa3b7d9b6,22.0.1-2-gd1925c9+bf4f0e694f,22.0.1-24-g1ad7a390+a9625a72a8,22.0.1-25-g5bf6245+3ad8ecd50b,22.0.1-25-gb120d7b+8b5510f75f,22.0.1-27-g97737f7+2a20fdde0d,22.0.1-32-gf62ce7b1+aa4237961e,22.0.1-4-g0b3f228+2a20fdde0d,22.0.1-4-g243d05b+871c1b8305,22.0.1-4-g3a563be+32dcf1063f,22.0.1-4-g44f2e3d+9e4ab0f4fa,22.0.1-42-gca6935d93+ba5e5ca3eb,22.0.1-5-g15c806e+85460ae5f3,22.0.1-5-g58711c4+611d128589,22.0.1-5-g75bb458+99c117b92f,22.0.1-6-g1c63a23+7fa3b7d9b6,22.0.1-6-g50866e6+84ff5a128b,22.0.1-6-g8d3140d+720564cf76,22.0.1-6-gd805d02+cc5644f571,22.0.1-8-ge5750ce+85460ae5f3,master-g6e05de7fdc+babf819c66,master-g99da0e417a+8d77f4f51a,w.2021.48
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: