25 #include "lsst/pex/exceptions.h" 36 "dimensions of a Kernel's images",
"pixel")),
37 center(afw::table::PointKey<int>::addFields(
schema,
"center",
"center point in a Kernel image",
39 if (nSpatialFunctions > 0) {
41 "spatialfunctions",
"archive IDs for the Kernel's spatial functions", nSpatialFunctions);
56 std::shared_ptr<afw::table::BaseRecord> record = catalog.
addNew();
68 std::vector<std::shared_ptr<Kernel::SpatialFunction>>
const& spatialFunctionList)
const {
70 for (std::size_t n = 0; n < spatialFunctionList.size(); ++n) {
71 array[n] = handle.
put(spatialFunctionList[n]);
78 std::vector<std::shared_ptr<Kernel::SpatialFunction>> spatialFunctionList(array.getSize<0>());
79 for (std::size_t n = 0; n < spatialFunctionList.size(); ++n) {
83 return spatialFunctionList;
PersistenceHelper(int nSpatialFunctions)
Defines the fields and offsets for a table.
int put(Persistable const *obj, bool permissive=false)
Save a nested Persistable to the same archive.
An object passed to Persistable::write to allow it to persist itself.
A custom container class for records, based on std::vector.
afw::table::Schema schema
#define LSST_ARCHIVE_ASSERT(EXPR)
An assertion macro used to validate the structure of an InputArchive.
lsst::afw::geom::Point2I getCtr() const
Return index of kernel's center.
Key< T > addField(Field< T > const &field, bool doReplace=false)
Add a new field to the Schema, and return the associated Key.
A Function taking two arguments.
afw::table::PointKey< int > dimensions
afw::table::PointKey< int > dimensions
void writeSpatialFunctions(afw::table::io::OutputArchiveHandle &handle, afw::table::BaseRecord &record, std::vector< SpatialFunctionPtr > const &spatialFunctionList) const
A base class for image defects.
afw::table::Schema schema
Tag types used to declare specialized field types.
BaseCatalog makeCatalog(Schema const &schema)
Return a new, empty catalog with the given schema.
std::vector< SpatialFunctionPtr > readSpatialFunctions(afw::table::io::InputArchive const &archive, afw::table::BaseRecord const &record) const
Base class for all records.
std::vector< SpatialFunctionPtr > _spatialFunctionList
void saveCatalog(BaseCatalog const &catalog)
Save a catalog in the archive.
std::shared_ptr< afw::table::BaseRecord > write(afw::table::io::OutputArchiveHandle &handle, Kernel const &kernel) const
afw::table::Key< afw::table::Array< int > > spatialFunctions
afw::table::PointKey< int > center
Kernels are used for convolution with MaskedImages and (eventually) Images.
geom::Extent2I const getDimensions() const
Return the Kernel's dimensions (width, height)
std::shared_ptr< RecordT > addNew()
Create a new record, add it to the end of the catalog, and return a pointer to it.