29 namespace lsst {
namespace afw {
namespace math {
34 afw::
table::PointKey<int>::addFields(
35 schema,
"dimensions",
"dimensions of a Kernel's images",
"pixels"
39 afw::
table::PointKey<int>::addFields(
schema,
"center",
"center point in a Kernel image",
"pixels")
42 if (nSpatialFunctions > 0) {
44 "spatialfunctions",
"archive IDs for the Kernel's spatial functions", nSpatialFunctions
66 record->set(center, kernel.getCtr());
67 if (spatialFunctions.isValid()) {
68 writeSpatialFunctions(handle, *record, kernel._spatialFunctionList);
70 handle.saveCatalog(catalog);
80 for (std::size_t n = 0; n < spatialFunctionList.size(); ++n) {
81 array[n] = handle.
put(spatialFunctionList[n]);
90 std::vector<PTR(Kernel::SpatialFunction)> spatialFunctionList(array.
getSize<0>());
91 for (std::size_t n = 0; n < spatialFunctionList.size(); ++n) {
95 return spatialFunctionList;
Defines the fields and offsets for a table.
Declare the Kernel class and subclasses.
An object passed to Persistable::write to allow it to persist itself.
#define LSST_ARCHIVE_ASSERT(EXPR)
An assertion macro used to validate the structure of an InputArchive.
int put(Persistable const *obj, bool permissive=false)
Save a nested Persistable to the same archive.
A custom container class for records, based on std::vector.
afw::table::Key< afw::table::Array< int > > spatialFunctions
afw::table::Schema schema
int getSize() const
Return the size of a specific dimension.
boost::shared_ptr< RecordT > addNew()
Create a new record, add it to the end of the catalog, and return a pointer to it.
std::map< Citizen const *, CitizenInfo > table
afw::table::PointKey< int > dimensions
PersistenceHelper(int nSpatialFunctions)
virtual void write(OutputArchiveHandle &handle) const
Write the object to one or more catalogs.
Tag types used to declare specialized field types.
std::vector< SpatialFunctionPtr > readSpatialFunctions(afw::table::io::InputArchive const &archive, afw::table::BaseRecord const &record) const
Key< T > addField(Field< T > const &field, bool doReplace=false)
Add a new field to the Schema, and return the associated Key.
Base class for all records.
void writeSpatialFunctions(afw::table::io::OutputArchiveHandle &handle, afw::table::BaseRecord &record, std::vector< SpatialFunctionPtr > const &spatialFunctionList) const
Kernels are used for convolution with MaskedImages and (eventually) Images.
Include files required for standard LSST Exception handling.