LSSTApplications  10.0+286,10.0+36,10.0+46,10.0-2-g4f67435,10.1+152,10.1+37,11.0,11.0+1,11.0-1-g47edd16,11.0-1-g60db491,11.0-1-g7418c06,11.0-2-g04d2804,11.0-2-g68503cd,11.0-2-g818369d,11.0-2-gb8b8ce7
LSSTDataManagementBasePackage
Public Member Functions | List of all members
lsst::afw::math::LinearCombinationKernel::Factory Class Reference
Inheritance diagram for lsst::afw::math::LinearCombinationKernel::Factory:
lsst::afw::table::io::PersistableFactory

Public Member Functions

virtual boost::shared_ptr
< afw::table::io::Persistable
read (InputArchive const &archive, CatalogVector const &catalogs) const
 Construct a new object from the given InputArchive and vector of catalogs. More...
 
 Factory (std::string const &name)
 
- Public Member Functions inherited from lsst::afw::table::io::PersistableFactory
 PersistableFactory (std::string const &name)
 Constructor for the factory. More...
 
virtual ~PersistableFactory ()
 

Additional Inherited Members

- Static Public Member Functions inherited from lsst::afw::table::io::PersistableFactory
static PersistableFactory const & lookup (std::string const &name, std::string const &module="")
 Return the factory that has been registered with the given name. More...
 
- Protected Types inherited from lsst::afw::table::io::PersistableFactory
typedef io::InputArchive InputArchive
 
typedef io::CatalogVector CatalogVector
 

Detailed Description

Definition at line 326 of file LinearCombinationKernel.cc.

Constructor & Destructor Documentation

lsst::afw::math::LinearCombinationKernel::Factory::Factory ( std::string const &  name)
inlineexplicit

Definition at line 356 of file LinearCombinationKernel.cc.

356 : afw::table::io::PersistableFactory(name) {}
table::Key< std::string > name
Definition: ApCorrMap.cc:71

Member Function Documentation

virtual boost::shared_ptr< afw::table::io::Persistable > lsst::afw::math::LinearCombinationKernel::Factory::read ( InputArchive const &  archive,
CatalogVector const &  catalogs 
) const
inlinevirtual

Construct a new object from the given InputArchive and vector of catalogs.

Implements lsst::afw::table::io::PersistableFactory.

Definition at line 330 of file LinearCombinationKernel.cc.

330  {
331  LSST_ARCHIVE_ASSERT(catalogs.size() == 1u);
332  LSST_ARCHIVE_ASSERT(catalogs.front().size() == 1u);
333  LinearCombinationKernelPersistenceHelper const keys(catalogs.front().getSchema());
334  afw::table::BaseRecord const & record = catalogs.front().front();
335  geom::Extent2I dimensions(record.get(keys.dimensions));
336  std::vector<PTR(Kernel)> componentList(keys.components.getSize());
337  for (std::size_t i = 0; i < componentList.size(); ++i) {
338  componentList[i] = archive.get<Kernel>(record[keys.components[i]]);
339  }
341  if (keys.spatialFunctions.isValid()) {
342  std::vector<SpatialFunctionPtr> spatialFunctionList = keys.readSpatialFunctions(archive, record);
343  result.reset(new LinearCombinationKernel(componentList, spatialFunctionList));
344  } else {
345  std::vector<double> kernelParameters(keys.amplitudes.getSize());
346  for (std::size_t i = 0; i < kernelParameters.size(); ++i) {
347  kernelParameters[i] = record[keys.amplitudes[i]];
348  }
349  result.reset(new LinearCombinationKernel(componentList, kernelParameters));
350  }
351  LSST_ARCHIVE_ASSERT(result->getDimensions() == dimensions);
352  result->setCtr(record.get(keys.center));
353  return result;
354  }
#define PTR(...)
Definition: base.h:41
LinearCombinationKernel()
Construct an empty LinearCombinationKernel of size 0x0.
afw::table::PointKey< int > dimensions
Definition: GaussianPsf.cc:42
if(width!=gim.getWidth()||height!=gim.getHeight()||x0!=gim.getX0()||y0!=gim.getY0())
Definition: saturated.cc:47
#define LSST_ARCHIVE_ASSERT(EXPR)
An assertion macro used to validate the structure of an InputArchive.
Definition: Persistable.h:47
Kernel()
Construct a null Kernel of size 0,0.
Definition: Kernel.cc:51

The documentation for this class was generated from the following file: