LSSTApplications
20.0.0
LSSTDataManagementBasePackage
|
Go to the documentation of this file.
42 class PeakFitsWriter :
public afw::table::io::FitsWriter {
44 explicit PeakFitsWriter(Fits*
fits,
int flags) :
afw::table::io::FitsWriter(
fits, flags) {}
54 "Cannot use a PeakFitsWriter on a non-Peak table.");
57 _fits->writeKey(
"AFW_TYPE",
"PEAK",
"Tells lsst::afw to load this as a Peak table.");
71 class PeakFitsReader :
public afw::table::io::FitsReader {
73 PeakFitsReader() :
afw::table::io::FitsReader(
"PEAK") {}
77 int ioFlags,
bool stripMetadata)
const override {
79 table->setMetadata(metadata);
85 static PeakFitsReader
const peakFitsReader;
100 static CachedTableList cache;
103 "Schema for Peak must contain at least the keys defined by makeMinimalSchema().");
108 CachedTableList::iterator
iter = cache.begin();
109 while (
iter != cache.end()) {
118 if (
iter != cache.begin()) {
119 cache.splice(cache.begin(), cache,
iter);
128 cache.push_front(newTable);
134 :
afw::table::BaseTable(
schema), _idFactory(idFactory) {}
144 PeakTable::MinimalSchema::MinimalSchema() {
146 fx =
schema.addField<
float>(
"f_x",
"subpixel column position",
"pixel");
147 fy =
schema.addField<
float>(
"f_y",
"subpixel row position",
"pixel");
148 ix =
schema.addField<
int>(
"i_x",
"column position of highest pixel",
"pixel");
149 iy =
schema.addField<
int>(
"i_y",
"row position of highest pixel",
"pixel");
150 peakValue =
schema.addField<
float>(
"peakValue",
"value of [smoothed] image at peak position",
"count");
153 PeakTable::MinimalSchema& PeakTable::getMinimalSchema() {
154 static MinimalSchema it;
159 return std::make_shared<PeakFitsWriter>(fitsfile, flags);
167 auto record = constructRecord<PeakRecord>();
176 template class CatalogT<afw::detection::PeakRecord>;
177 template class CatalogT<afw::detection::PeakRecord const>;
std::ostream & operator<<(std::ostream &os, PeakRecord const &record)
std::shared_ptr< afw::table::BaseTable > _clone() const override
Clone implementation with noncovariant return types.
Record class that represents a peak in a Footprint.
static std::shared_ptr< IdFactory > makeSimple()
Return a simple IdFactory that simply counts from 1.
def format(config, name=None, writeSourceLine=True, prefix="", verbose=False)
afw::table::RecordId getId() const
Convenience accessors for the keys in the minimal schema.
Defines the fields and offsets for a table.
static std::shared_ptr< PeakTable > make(afw::table::Schema const &schema, bool forceNew=false)
Obtain a table that can be used to create records with given schema.
std::shared_ptr< afw::table::IdFactory > getIdFactory()
Return the object that generates IDs for the table (may be null).
ItemVariant const * other
Reports errors in the logical structure of the program.
@ IDENTICAL
Everything is the same.
A base class for image defects.
#define LSST_EXCEPT(type,...)
Create an exception with a given type.
static bool checkSchema(afw::table::Schema const &other)
Return true if the given schema is a valid PeakTable schema.
virtual void _writeTable(std::shared_ptr< BaseTable const > const &table, std::size_t nRows)
Write a table and its schema.
Reports invalid arguments.
std::shared_ptr< afw::table::BaseRecord > _makeRecord() override
Default-construct an associated record (protected implementation).
Table class for Peaks in Footprints.
PeakTable(afw::table::Schema const &schema, std::shared_ptr< afw::table::IdFactory > const &idFactory)