LSST Applications g04c3c9f7ca+2075667efa,g1e125bf412+5f448d5fcf,g2079a07aa2+3e9fd84d81,g2305ad1205+b635cf1488,g2bbee38e9b+6c6beb4891,g337abbeb29+6c6beb4891,g33d1c0ed96+6c6beb4891,g3a166c0a6a+6c6beb4891,g50ff169b8f+96c6868917,g52b1c1532d+585e252eca,g591dd9f2cf+42f171e1e6,g5c3423f6d4+d536b04327,g607f77f49a+d536b04327,g6f43f06aed+ca1339dc19,g858d7b2824+d536b04327,g8ee334c5b4+d7f9608c2f,g9963eaa53e+b3dc1655d3,g998f4353bf+d536b04327,g99cad8db69+8ef2408349,g9ddcbc5298+9a081db1e4,ga1e77700b3+2cbb763275,gadfd92a7e4+aec2f3b930,gae0086650b+585e252eca,gb0e22166c9+0e73c8378f,gb3b7280ab2+cb5fdb229e,gbb8dafda3b+a327199e22,gc120e1dc64+88074880ea,gc28159a63d+6c6beb4891,gcdd4ae20e8+bd241b2308,gcde1bda545+903e937d91,gcf0d15dbbd+bd241b2308,gdaeeff99f8+f9a426f77a,gddc38dedce+585e252eca,ge79ae78c31+6c6beb4891,gfbcc870c63+b310236976,w.2024.23
LSST Data Management Base Package
Loading...
Searching...
No Matches
Footprint.cc
Go to the documentation of this file.
1
2/*
3 * LSST Data Management System
4 * Copyright 2008-2016 AURA/LSST.
5 *
6 * This product includes software developed by the
7 * LSST Project (http://www.lsst.org/).
8 *
9 * This program is free software: you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation, either version 3 of the License, or
12 * (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the LSST License Statement and
20 * the GNU General Public License along with this program. If not,
21 * see <https://www.lsstcorp.org/LegalNotices/>.
22 */
23
29
30namespace lsst {
31namespace afw {
32
33template std::shared_ptr<detection::Footprint> table::io::PersistableFacade<
34 detection::Footprint>::dynamicCast(std::shared_ptr<table::io::Persistable> const&);
35
36namespace detection {
37
39 : _spans(inputSpans), _peaks(PeakTable::makeMinimalSchema()), _region(region) {}
40
42 lsst::geom::Box2I const& region)
43 : _spans(inputSpans), _peaks(peakSchema), _region(region) {}
44
45void Footprint::setSpans(std::shared_ptr<geom::SpanSet> otherSpanSet) { _spans = otherSpanSet; }
46
47std::shared_ptr<PeakRecord> Footprint::addPeak(float fx, float fy, float height) {
49 p->setIx(fx);
50 p->setIy(fy);
51 p->setFx(fx);
52 p->setFy(fy);
53 p->setPeakValue(height);
54 return p;
55}
56
58 auto validatedKey = key.isValid() ? key : PeakTable::getPeakValueKey();
59 getPeaks().sort([&validatedKey](detection::PeakRecord const& a, detection::PeakRecord const& b) {
60 return a.get(validatedKey) > b.get(validatedKey);
61 });
62}
63
64void Footprint::shift(int dx, int dy) {
65 setSpans(getSpans()->shiftedBy(dx, dy));
66 for (auto& peak : getPeaks()) {
67 peak.setIx(peak.getIx() + dx);
68 peak.setIy(peak.getIy() + dy);
69 peak.setFx(peak.getFx() + dx);
70 peak.setFy(peak.getFy() + dy);
71 }
72}
73
75 setSpans(getSpans()->clippedTo(box));
77}
78
79bool Footprint::contains(lsst::geom::Point2I const& pix) const { return getSpans()->contains(pix); }
80
83 lsst::geom::Box2I const& region, bool doClip) const {
84 auto srcToTarget = geom::makeWcsPairTransform(*source, *target);
85 return transform(*srcToTarget, region, doClip);
86}
87
89 lsst::geom::Box2I const& region, bool doClip) const {
90 return transform(lsst::geom::AffineTransform(t), region, doClip);
91}
92
94 lsst::geom::Box2I const& region, bool doClip) const {
95 return transform(*geom::makeTransform(t), region, doClip);
96}
97
98std::shared_ptr<Footprint> Footprint::transform(geom::TransformPoint2ToPoint2 const& t,
99 lsst::geom::Box2I const& region, bool doClip) const {
100 // Transfrom the SpanSet first
101 auto transformedSpan = getSpans()->transformedBy(t);
102 // Use this new SpanSet and the peakSchema to create a new Footprint
103 auto newFootprint = std::make_shared<Footprint>(transformedSpan, getPeaks().getSchema(), region);
104 // now populate the new Footprint with transformed Peaks
106 peakPosList.reserve(_peaks.size());
107 for (auto const& peak : getPeaks()) {
108 peakPosList.emplace_back(peak.getF());
109 }
110 auto newPeakPosList = t.applyForward(peakPosList);
111 auto newPeakPos = newPeakPosList.cbegin();
112 for (auto peak = getPeaks().cbegin(), endPeak = getPeaks().cend(); peak != endPeak;
113 ++peak, ++newPeakPos) {
114 newFootprint->addPeak(newPeakPos->getX(), newPeakPos->getY(), peak->getPeakValue());
115 }
116 if (doClip) {
117 newFootprint->clipTo(region);
118 }
119 return newFootprint;
120}
121
122void Footprint::dilate(int r, geom::Stencil s) { setSpans(getSpans()->dilated(r, s)); }
123
124void Footprint::dilate(geom::SpanSet const& other) { setSpans(getSpans()->dilated(other)); }
125
126void Footprint::erode(int r, geom::Stencil s) {
127 setSpans(getSpans()->eroded(r, s));
129}
130
131void Footprint::erode(geom::SpanSet const& other) {
132 setSpans(getSpans()->eroded(other));
134}
135
137 for (auto iter = getPeaks().begin(); iter != getPeaks().end(); ++iter) {
138 if (!getSpans()->contains(lsst::geom::Point2I(iter->getIx(), iter->getIy()))) {
139 iter = getPeaks().erase(iter);
140 --iter;
141 }
142 }
143}
144
146 auto key = _peaks.getSchema().find<double>("significance").key;
147 for (auto& peak : _peaks) {
148 peak.set(key, peak.getPeakValue() / sigma);
149 }
150}
151
153 auto key = _peaks.getSchema().find<double>("significance").key;
154 for (auto& peak : _peaks) {
155 peak.set(key, polarity * peak.getPeakValue() / std::sqrt(variance[peak.getI()]));
156 }
157}
158
160 auto splitSpanSets = getSpans()->split();
162 footprintList.reserve(splitSpanSets.size());
163 for (auto& spanPtr : splitSpanSets) {
164 auto tmpFootprintPointer = std::make_shared<Footprint>(spanPtr, getPeaks().getSchema(), getRegion());
165 tmpFootprintPointer->_peaks = getPeaks();
166 // No need to remove any peaks, as there is only one Footprint, so it will
167 // simply be a copy of the original
168 if (splitSpanSets.size() > 1) {
169 tmpFootprintPointer->removeOrphanPeaks();
170 }
171 footprintList.push_back(std::move(tmpFootprintPointer));
172 }
173 return footprintList;
174}
175
176bool Footprint::operator==(Footprint const& other) const {
177 /* If the peakCatalogs are not the same length the Footprints can't be equal */
178 if (getPeaks().size() != other.getPeaks().size()) {
179 return false;
180 }
181 /* Check that for every peak in the PeakCatalog there is a corresponding peak
182 * in the other, and if not return false
183 */
184 for (auto const& selfPeak : getPeaks()) {
185 bool match = false;
186 for (auto const& otherPeak : other.getPeaks()) {
187 if (selfPeak.getI() == otherPeak.getI() && selfPeak.getF() == otherPeak.getF() &&
188 selfPeak.getPeakValue() == otherPeak.getPeakValue()) {
189 match = true;
190 break;
191 }
192 }
193 if (!match) {
194 return false;
195 }
196 }
197 /* At this point the PeakCatalogs have evaluated true, compare the SpanSets
198 */
199 return *(getSpans()) == *(other.getSpans());
200}
201
202namespace {
203std::string getFootprintPersistenceName() { return "Footprint"; }
204
205class LegacyFootprintPersistenceHelper {
206public:
207 table::Schema spanSchema;
208 table::Key<int> spanY;
209 table::Key<int> spanX0;
210 table::Key<int> spanX1;
211
212 static LegacyFootprintPersistenceHelper const& get() {
213 static LegacyFootprintPersistenceHelper instance;
214 return instance;
215 }
216
217 // No copying
218 LegacyFootprintPersistenceHelper(const LegacyFootprintPersistenceHelper&) = delete;
219 LegacyFootprintPersistenceHelper& operator=(const LegacyFootprintPersistenceHelper&) = delete;
220
221 // No moving
222 LegacyFootprintPersistenceHelper(LegacyFootprintPersistenceHelper&&) = delete;
223 LegacyFootprintPersistenceHelper& operator=(LegacyFootprintPersistenceHelper&&) = delete;
224
225private:
226 LegacyFootprintPersistenceHelper()
227 : spanSchema(),
228 spanY(spanSchema.addField<int>("y", "The row of the span", "pixel")),
229 spanX0(spanSchema.addField<int>("x0", "First column of span (inclusive)", "pixel")),
230 spanX1(spanSchema.addField<int>("x1", "Second column of span (inclusive)", "pixel")) {}
231};
232
233std::pair<afw::table::Schema&, table::Key<int>&> spanSetPersistenceHelper() {
234 static afw::table::Schema spanSetIdSchema;
235 static int initialize = true;
236 static table::Key<int> idKey;
237 if (initialize) {
238 idKey = spanSetIdSchema.addField<int>("id", "id of the SpanSet catalog");
239 initialize = false;
240 }
241 std::pair<afw::table::Schema&, table::Key<int>&> returnPair(spanSetIdSchema, idKey);
242 return returnPair;
243}
244} // end anonymous namespace
245
247public:
249 afw::table::io::InputArchive const& archive,
250 afw::table::io::CatalogVector const& catalogs) const override {
251 // Verify there are two catalogs
252 LSST_ARCHIVE_ASSERT(catalogs.size() == 2u);
253 std::shared_ptr<Footprint> loadedFootprint =
254 detection::Footprint::readSpanSet(catalogs.front(), archive);
255 // Now read in the PeakCatalog records
256 detection::Footprint::readPeaks(catalogs.back(), *loadedFootprint);
257 return loadedFootprint;
258 }
259
260 explicit FootprintFactory(std::string const& name) : afw::table::io::PersistableFactory(name) {}
261};
262
263namespace {
264// Insert the factory into the registry (instantiating an instance is sufficient, because the
265// the code that does the work is in the base class ctor)
266FootprintFactory registration(getFootprintPersistenceName());
267} // end anonymous namespace
268
269std::string Footprint::getPersistenceName() const { return getFootprintPersistenceName(); }
270
272 // get the span schema and key
273 auto const keys = spanSetPersistenceHelper();
274 // create the output catalog
275 afw::table::BaseCatalog spanSetCat = handle.makeCatalog(keys.first);
276 // create a record that will hold the ID of the recursively saved SpanSet
277 auto record = spanSetCat.addNew();
278 record->set(keys.second, handle.put(getSpans()));
279 handle.saveCatalog(spanSetCat);
280 // save the peaks into a catalog
281 afw::table::BaseCatalog peakCat = handle.makeCatalog(getPeaks().getSchema());
282 peakCat.insert(peakCat.end(), getPeaks().begin(), getPeaks().end(), true);
283 handle.saveCatalog(peakCat);
284}
285
287 afw::table::io::InputArchive const& archive) {
288 int fieldCount = catalog.getSchema().getFieldCount();
289 LSST_ARCHIVE_ASSERT(fieldCount == 1 || fieldCount == 3);
290 std::shared_ptr<geom::SpanSet> loadedSpanSet;
291 if (fieldCount == 1) {
292 // This is a new style footprint with a SpanSet as a member, treat accordingly
293 auto const schemaAndKey = spanSetPersistenceHelper();
294 int persistedSpanSetId = catalog.front().get(schemaAndKey.second);
295 loadedSpanSet = std::dynamic_pointer_cast<geom::SpanSet>(archive.get(persistedSpanSetId));
296 } else {
297 // This block is for an old style footprint load.
298 auto const& keys = LegacyFootprintPersistenceHelper::get();
300 tempVec.reserve(catalog.size());
301 for (auto const& val : catalog) {
302 tempVec.emplace_back(val.get(keys.spanY), val.get(keys.spanX0), val.get(keys.spanX1));
303 }
304 loadedSpanSet = std::make_shared<geom::SpanSet>(std::move(tempVec));
305 }
306 auto loadedFootprint = std::unique_ptr<Footprint>(new Footprint(loadedSpanSet));
307 return loadedFootprint;
308}
309
310void Footprint::readPeaks(afw::table::BaseCatalog const& peakCat, Footprint& loadedFootprint) {
311 using namespace std::string_literals;
313 // need to handle an older form of Peak persistence for backwards compatibility
315 mapper.addMinimalSchema(PeakTable::makeMinimalSchema());
316 afw::table::Key<float> oldX = peakCat.getSchema()["x"];
317 afw::table::Key<float> oldY = peakCat.getSchema()["y"];
318 afw::table::Key<float> oldPeakValue = peakCat.getSchema()["value"];
319 mapper.addMapping(oldX, "f.x"s);
320 mapper.addMapping(oldY, "f.y"s);
321 mapper.addMapping(oldPeakValue, "peakValue"s);
322 loadedFootprint.setPeakSchema(mapper.getOutputSchema());
323 auto peaks = loadedFootprint.getPeaks();
324 peaks.reserve(peakCat.size());
325 for (auto const& peak : peakCat) {
326 auto newPeak = peaks.addNew();
327 newPeak->assign(peak, mapper);
328 newPeak->setIx(static_cast<int>(newPeak->getFx()));
329 newPeak->setIy(static_cast<int>(newPeak->getFy()));
330 }
331 return;
332 }
333 loadedFootprint.setPeakSchema(peakCat.getSchema());
334 auto& peaks = loadedFootprint.getPeaks();
335 peaks.reserve(peakCat.size());
336 for (auto const& peak : peakCat) {
337 peaks.addNew()->assign(peak);
338 }
339}
340
341std::shared_ptr<Footprint> mergeFootprints(Footprint const& footprint1, Footprint const& footprint2) {
342 // Bail out early if the schemas are not the same
343 if (footprint1.getPeaks().getSchema() != footprint2.getPeaks().getSchema()) {
345 "Cannot merge Footprints with different Schemas");
346 }
347
348 // Merge the SpanSets
349 auto unionedSpanSet = footprint1.getSpans()->union_(*(footprint2.getSpans()));
350
351 // Construct merged Footprint
352 auto mergedFootprint = std::make_shared<Footprint>(unionedSpanSet, footprint1.getPeaks().getSchema());
353 // Copy over the peaks from both footprints
354 mergedFootprint->setPeakCatalog(PeakCatalog(footprint1.getPeaks().getTable()));
355 PeakCatalog& peaks = mergedFootprint->getPeaks();
356 peaks.reserve(footprint1.getPeaks().size() + footprint2.getPeaks().size());
357 peaks.insert(peaks.end(), footprint1.getPeaks().begin(), footprint1.getPeaks().end(), true);
358 peaks.insert(peaks.end(), footprint2.getPeaks().begin(), footprint2.getPeaks().end(), true);
359
360 // Sort the PeaksCatalog according to value
361 mergedFootprint->sortPeaks();
362
363 return mergedFootprint;
364}
365
367 using PixelT = std::uint16_t;
368 lsst::geom::Box2I fpBBox = footprint.getBBox();
370 *idImage = 0;
371 int const height = fpBBox.getHeight();
372 lsst::geom::Extent2I shift(fpBBox.getMinX(), fpBBox.getMinY());
373 footprint.getSpans()->setImage(*idImage, static_cast<PixelT>(1), fpBBox, true);
374
376 /*
377 * Our strategy is to find a row of pixels in the Footprint and interpret it as the first
378 * row of a rectangular set of pixels. We then extend this rectangle upwards as far as it
379 * will go, and define that as a BBox. We clear all those pixels, and repeat until there
380 * are none left. I.e. a Footprint will get cut up like this:
381 *
382 * .555...
383 * 22.3314
384 * 22.331.
385 * .000.1.
386 * (as shown in Footprint_1.py)
387 */
388
389 int y0 = 0; // the first row with non-zero pixels in it
390 while (y0 < height) {
391 lsst::geom::Box2I bbox; // our next BBox
392 for (int y = y0; y < height; ++y) {
393 // Look for a set pixel in this row
394 image::Image<PixelT>::x_iterator begin = idImage->row_begin(y), end = idImage->row_end(y);
396
397 if (first != end) { // A pixel is set in this row
398 image::Image<PixelT>::x_iterator last = std::find(first, end, 0) - 1;
399 int const x0 = first - begin;
400 int const x1 = last - begin;
401 int const x_size = 1 + x1 - x0;
402
403 std::fill(first, last + 1, 0); // clear pixels; we don't want to see them again
404
405 bbox.include(lsst::geom::Point2I(x0, y)); // the LLC
406 bbox.include(lsst::geom::Point2I(x1, y)); // the LRC; initial guess for URC
407
408 // we found at least one pixel so extend the BBox upwards
409 for (++y; y < height; ++y) {
410 if (std::find(idImage->at(x0, y), idImage->at(x0, y) + x_size, 0) !=
411 idImage->at(x0, y) + x_size) {
412 break; // some pixels weren't set, so the BBox stops here, (actually in previous row)
413 }
414 std::fill(idImage->at(x0, y), idImage->at(x0, y) + x_size, 0);
415
416 bbox.include(lsst::geom::Point2I(x1, y)); // the new URC
417 }
418
419 bbox.shift(shift);
420 bboxes.push_back(bbox);
421 } else {
422 y0 = y + 1;
423 }
424 break;
425 }
426 }
427
428 return bboxes;
429}
430
432 setPeakCatalog(PeakCatalog(peakSchema));
433}
434
435void Footprint::setPeakCatalog(PeakCatalog const& otherPeaks) {
436 if (!getPeaks().empty()) {
437 throw LSST_EXCEPT(pex::exceptions::LogicError, "Cannot change the PeakCatalog unless it is empty");
438 }
439 // this syntax doesn't work in Python, which is why this method has to exist
440 getPeaks() = otherPeaks;
441}
442
444 os << rhs.getPeaks().size() << " peaks, area=" << rhs.getArea() << ", centroid=" << rhs.getCentroid();
445 return os;
446}
447
448} // namespace detection
449} // namespace afw
450} // namespace lsst
AmpInfoBoxKey bbox
Definition Amplifier.cc:117
Key< Flag > const & target
int end
#define LSST_EXCEPT(type,...)
Create an exception with a given type.
Definition Exception.h:48
table::Schema spanSchema
Definition Footprint.cc:207
table::Key< int > spanX1
Definition Footprint.cc:210
table::Key< int > spanY
Definition Footprint.cc:208
table::Key< int > spanX0
Definition Footprint.cc:209
afw::table::Key< double > sigma
afw::table::Key< afw::table::Array< VariancePixelT > > variance
std::ostream * os
Definition Schema.cc:557
SchemaMapper * mapper
int y
Definition SpanSet.cc:48
table::Key< int > transform
table::Key< int > b
#define LSST_ARCHIVE_ASSERT(EXPR)
An assertion macro used to validate the structure of an InputArchive.
Definition Persistable.h:48
FootprintFactory(std::string const &name)
Definition Footprint.cc:260
std::shared_ptr< afw::table::io::Persistable > read(afw::table::io::InputArchive const &archive, afw::table::io::CatalogVector const &catalogs) const override
Construct a new object from the given InputArchive and vector of catalogs.
Definition Footprint.cc:248
Class to describe the properties of a detected object from an image.
Definition Footprint.h:63
void dilate(int r, geom::Stencil s=geom::Stencil::CIRCLE)
Dilate the Footprint with a defined kernel.
Definition Footprint.cc:122
Footprint()
Constructor of a empty Footprint object.
Definition Footprint.h:96
lsst::geom::Box2I getRegion() const
Return the corners of the MaskedImage the footprints live in.
Definition Footprint.h:213
static std::unique_ptr< Footprint > readSpanSet(afw::table::BaseCatalog const &, afw::table::io::InputArchive const &)
Static method used to unpersist the SpanSet member of the Footprint class.
Definition Footprint.cc:286
void removeOrphanPeaks()
Remove peaks from the PeakCatalog that fall outside the area of the Footprint.
Definition Footprint.cc:136
std::shared_ptr< Footprint > transform(std::shared_ptr< geom::SkyWcs > source, std::shared_ptr< geom::SkyWcs > target, lsst::geom::Box2I const &region, bool doClip=true) const
Transform the footprint from one WCS to another.
Definition Footprint.cc:81
void setPeakSchema(afw::table::Schema const &peakSchema)
Set the Schema used by the PeakCatalog (will throw if PeakCatalog is not empty).
Definition Footprint.cc:431
std::vector< std::shared_ptr< Footprint > > split() const
Split a multi-component Footprint into a vector of contiguous Footprints.
Definition Footprint.cc:159
void write(OutputArchiveHandle &handle) const override
Write an instance of a Footprint to an output Archive.
Definition Footprint.cc:271
bool operator==(Footprint const &other) const
equality operator
Definition Footprint.cc:176
lsst::geom::Box2I getBBox() const
Return the Footprint's bounding box.
Definition Footprint.h:208
std::shared_ptr< geom::SpanSet > getSpans() const
Return a shared pointer to the SpanSet.
Definition Footprint.h:115
void sortPeaks(afw::table::Key< float > const &key=afw::table::Key< float >())
Sort Peaks from most positive value to most negative.
Definition Footprint.cc:57
PeakCatalog & getPeaks()
Return the Peaks contained in this Footprint.
Definition Footprint.h:129
std::size_t getArea() const
Return the number of pixels in this Footprint.
Definition Footprint.h:173
void setPeakCatalog(PeakCatalog const &otherPeaks)
Set the peakCatalog to a copy of the supplied catalog.
Definition Footprint.cc:435
lsst::geom::Point2D getCentroid() const
Return the Footprint's centroid.
Definition Footprint.h:180
std::string getPersistenceName() const override
Return the name correspoinging ot the persistence type.
Definition Footprint.cc:269
void clipTo(lsst::geom::Box2I const &bbox)
Clip the Footprint such that all values lie inside the supplied Bounding Box.
Definition Footprint.cc:74
void erode(int r, geom::Stencil s=geom::Stencil::CIRCLE)
Erode the Footprint with a defined kernel.
Definition Footprint.cc:126
void setSpans(std::shared_ptr< geom::SpanSet > otherSpanSet)
Sets the shared pointer to the SpanSet in the Footprint.
Definition Footprint.cc:45
bool contains(lsst::geom::Point2I const &pix) const
Tests if a pixel postion falls inside the Footprint.
Definition Footprint.cc:79
void shift(int dx, int dy)
Shift a Footprint by (dx, dy)
Definition Footprint.cc:64
std::shared_ptr< PeakRecord > addPeak(float fx, float fy, float value)
Convenience function to add a peak.
Definition Footprint.cc:47
void updatePeakSignificance(double sigma)
Compute and update the significance of each peak, given a single value for sigma.
Definition Footprint.cc:145
static void readPeaks(afw::table::BaseCatalog const &, Footprint &)
Static method used to unpersist the PeakCatalog member of the Footprint class.
Definition Footprint.cc:310
Record class that represents a peak in a Footprint.
Definition Peak.h:42
Table class for Peaks in Footprints.
Definition Peak.h:102
static afw::table::Schema makeMinimalSchema()
Return a minimal schema for Peak tables and records.
Definition Peak.h:137
static afw::table::Key< float > getPeakValueKey()
Definition Peak.h:169
typename _view_t::x_iterator x_iterator
An iterator for traversing the pixels in a row.
Definition ImageBase.h:133
A class to represent a 2-dimensional array of pixels.
Definition Image.h:51
Tag types used to declare specialized field types.
Definition misc.h:31
const_iterator cend() const
Definition Catalog.h:405
size_type size() const
Return the number of elements in the catalog.
Definition Catalog.h:412
std::shared_ptr< RecordT > addNew()
Create a new record, add it to the end of the catalog, and return a pointer to it.
Definition Catalog.h:489
iterator begin()
Iterator access.
Definition Catalog.h:400
iterator erase(iterator pos)
Erase the record pointed to by pos, and return an iterator the next record.
Definition Catalog.h:564
void reserve(size_type n)
Increase the capacity of the catalog to the given size.
Definition Catalog.h:432
void sort(Key< T > const &key)
Sort the catalog in-place by the field with the given key.
Definition Catalog.h:755
void insert(iterator pos, InputIterator first, InputIterator last, bool deep=false)
Insert an iterator range into the table.
Definition Catalog.h:517
std::shared_ptr< Table > getTable() const
Return the table associated with the catalog.
Definition Catalog.h:114
Schema getSchema() const
Return the schema associated with the catalog's table.
Definition Catalog.h:117
const_iterator cbegin() const
Definition Catalog.h:404
Defines the fields and offsets for a table.
Definition Schema.h:51
int contains(Schema const &other, int flags=EQUAL_KEYS) const
Test whether the given schema is a subset of this.
Definition Schema.cc:490
SchemaItem< T > find(std::string const &name) const
Find a SchemaItem in the Schema by name.
Definition Schema.cc:467
A mapping between the keys of two Schemas, used to copy data between them.
A vector of catalogs used by Persistable.
A multi-catalog archive object used to load table::io::Persistable objects.
std::shared_ptr< Persistable > get(int id) const
Load the Persistable with the given ID and return it.
An object passed to Persistable::write to allow it to persist itself.
void saveCatalog(BaseCatalog const &catalog)
Save a catalog in the archive.
BaseCatalog makeCatalog(Schema const &schema)
Return a new, empty catalog with the given schema.
int put(Persistable const *obj, bool permissive=false)
Save an object to the archive and return a unique ID that can be used to retrieve it from an InputArc...
A base class for factory classes used to reconstruct objects from records.
An affine coordinate transformation consisting of a linear transformation and an offset.
An integer coordinate rectangle.
Definition Box.h:55
int getMinY() const noexcept
Definition Box.h:158
int getHeight() const noexcept
Definition Box.h:188
int getMinX() const noexcept
Definition Box.h:157
A 2D linear coordinate transformation.
Reports invalid arguments.
Definition Runtime.h:66
Reports errors in the logical structure of the program.
Definition Runtime.h:46
T emplace_back(T... args)
T fill(T... args)
T find(T... args)
T move(T... args)
std::ostream & operator<<(std::ostream &os, Footprint const &rhs)
Print a Footprint to the stream.
Definition Footprint.cc:443
std::vector< lsst::geom::Box2I > footprintToBBoxList(Footprint const &footprint)
Return a list of BBoxs, whose union contains exactly the pixels in the footprint, neither more nor le...
Definition Footprint.cc:366
afw::table::CatalogT< PeakRecord > PeakCatalog
Definition Peak.h:244
std::shared_ptr< Footprint > mergeFootprints(Footprint const &footprint1, Footprint const &footprint2)
Merges two Footprints – appends their peaks, and unions their spans, returning a new Footprint.
Definition Footprint.cc:341
T push_back(T... args)
T reserve(T... args)
T sqrt(T... args)
ImageT val
Definition CR.cc:146