LSSTApplications  19.0.0-14-gb0260a2+72efe9b372,20.0.0+7927753e06,20.0.0+8829bf0056,20.0.0+995114c5d2,20.0.0+b6f4b2abd1,20.0.0+bddc4f4cbe,20.0.0-1-g253301a+8829bf0056,20.0.0-1-g2b7511a+0d71a2d77f,20.0.0-1-g5b95a8c+7461dd0434,20.0.0-12-g321c96ea+23efe4bbff,20.0.0-16-gfab17e72e+fdf35455f6,20.0.0-2-g0070d88+ba3ffc8f0b,20.0.0-2-g4dae9ad+ee58a624b3,20.0.0-2-g61b8584+5d3db074ba,20.0.0-2-gb780d76+d529cf1a41,20.0.0-2-ged6426c+226a441f5f,20.0.0-2-gf072044+8829bf0056,20.0.0-2-gf1f7952+ee58a624b3,20.0.0-20-geae50cf+e37fec0aee,20.0.0-25-g3dcad98+544a109665,20.0.0-25-g5eafb0f+ee58a624b3,20.0.0-27-g64178ef+f1f297b00a,20.0.0-3-g4cc78c6+e0676b0dc8,20.0.0-3-g8f21e14+4fd2c12c9a,20.0.0-3-gbd60e8c+187b78b4b8,20.0.0-3-gbecbe05+48431fa087,20.0.0-38-ge4adf513+a12e1f8e37,20.0.0-4-g97dc21a+544a109665,20.0.0-4-gb4befbc+087873070b,20.0.0-4-gf910f65+5d3db074ba,20.0.0-5-gdfe0fee+199202a608,20.0.0-5-gfbfe500+d529cf1a41,20.0.0-6-g64f541c+d529cf1a41,20.0.0-6-g9a5b7a1+a1cd37312e,20.0.0-68-ga3f3dda+5fca18c6a4,20.0.0-9-g4aef684+e18322736b,w.2020.45
LSSTDataManagementBasePackage
Public Member Functions | Static Public Member Functions | Protected Types | List of all members
lsst::meas::algorithms::KernelPsfFactory< T, K > Class Template Reference

A PersistableFactory for KernelPsf and its subclasses. More...

#include <KernelPsfFactory.h>

Inheritance diagram for lsst::meas::algorithms::KernelPsfFactory< T, K >:
lsst::afw::table::io::PersistableFactory

Public Member Functions

virtual boost::shared_ptr< afw::table::io::Persistableread (afw::table::io::InputArchive const &archive, afw::table::io::CatalogVector const &catalogs) const
 Construct a new object from the given InputArchive and vector of catalogs. More...
 
 KernelPsfFactory (std::string const &name)
 

Static Public Member Functions

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

typedef io::InputArchive InputArchive
 
typedef io::CatalogVector CatalogVector
 

Detailed Description

template<typename T = KernelPsf, typename K = afw::math::Kernel>
class lsst::meas::algorithms::KernelPsfFactory< T, K >

A PersistableFactory for KernelPsf and its subclasses.

If a KernelPsf subclass has no data members other than its kernel, table persistence for it can be implemented simply by reimplementing getPersistenceName() and registering a specialization of KernelPsfFactory.

Template Parameters
TKernelPsf subclass the factory will construct.
KKernel subclass the Psf constructor requires.

Definition at line 55 of file KernelPsfFactory.h.

Member Typedef Documentation

◆ CatalogVector

typedef io::CatalogVector lsst::afw::table::io::PersistableFactory::CatalogVector
protectedinherited

Definition at line 231 of file Persistable.h.

◆ InputArchive

typedef io::InputArchive lsst::afw::table::io::PersistableFactory::InputArchive
protectedinherited

Definition at line 230 of file Persistable.h.

Constructor & Destructor Documentation

◆ KernelPsfFactory()

template<typename T = KernelPsf, typename K = afw::math::Kernel>
lsst::meas::algorithms::KernelPsfFactory< T, K >::KernelPsfFactory ( std::string const &  name)
inline

Definition at line 67 of file KernelPsfFactory.h.

67 : afw::table::io::PersistableFactory(name) {}

Member Function Documentation

◆ lookup()

PersistableFactory const & lsst::afw::table::io::PersistableFactory::lookup ( std::string const &  name,
std::string const &  module = "" 
)
staticinherited

Return the factory that has been registered with the given name.

If the lookup fails and module is not an empty string, we will attempt to import a Python module with that name (this will only work when the C++ is being called from Python) and try again.

Definition at line 76 of file Persistable.cc.

76  {
77  RegistryMap::const_iterator i = getRegistry().find(name);
78  if (i == getRegistry().end()) {
79  if (!module.empty()) {
80  bool success = base::ModuleImporter::import(module);
81  if (!success) {
82  throw LSST_EXCEPT(
83  pex::exceptions::NotFoundError,
85  "PersistableFactory with name '%s' not found, and import of module "
86  "'%s' failed (possibly because Python calls were not available from C++).") %
87  name % module)
88  .str());
89  }
90  i = getRegistry().find(name);
91  if (i == getRegistry().end()) {
92  throw LSST_EXCEPT(
93  pex::exceptions::LogicError,
95  "PersistableFactory with name '%s' not found even after successful import "
96  "of module '%s'. Please report this as a bug in the persistence "
97  "implementation for this object.") %
98  name % module)
99  .str());
100  }
101  } else {
102  throw LSST_EXCEPT(
103  pex::exceptions::LogicError,
104  (boost::format(
105  "PersistableFactory with name '%s' not found, and no Python module to import "
106  "was provided. Please report this as a bug in the persistence implementation "
107  "for this object.") %
108  name)
109  .str());
110  }
111  }
112  return *i->second;
113 }

◆ read()

template<typename T = KernelPsf, typename K = afw::math::Kernel>
virtual boost::shared_ptr< afw::table::io::Persistable > lsst::meas::algorithms::KernelPsfFactory< T, K >::read ( afw::table::io::InputArchive const &  archive,
afw::table::io::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 57 of file KernelPsfFactory.h.

58  {
59  static KernelPsfPersistenceHelper const& keys = KernelPsfPersistenceHelper::get();
60  LSST_ARCHIVE_ASSERT(catalogs.size() == 1u);
61  LSST_ARCHIVE_ASSERT(catalogs.front().size() == 1u);
62  afw::table::BaseRecord const& record = catalogs.front().front();
63  LSST_ARCHIVE_ASSERT(record.getSchema() == keys.schema);
64  return PTR(T)(new T(archive.get<K>(record.get(keys.kernel)), record.get(keys.averagePosition)));
65  }

The documentation for this class was generated from the following file:
astshim.keyMap.keyMapContinued.keys
def keys(self)
Definition: keyMapContinued.py:6
lsst.pex.config.history.format
def format(config, name=None, writeSourceLine=True, prefix="", verbose=False)
Definition: history.py:174
lsst::meas::algorithms::KernelPsfPersistenceHelper::get
static KernelPsfPersistenceHelper const & get()
Definition: KernelPsf.cc:55
lsst::afw::geom.transform.transformContinued.name
string name
Definition: transformContinued.py:32
PTR
#define PTR(...)
Definition: base.h:41
end
int end
Definition: BoundedField.cc:105
lsst::base::ModuleImporter::import
static bool import(std::string const &name)
Import the given Python module, and return true if successful.
Definition: ModuleImporter.cc:49
LSST_EXCEPT
#define LSST_EXCEPT(type,...)
Create an exception with a given type.
Definition: Exception.h:48
LSST_ARCHIVE_ASSERT
#define LSST_ARCHIVE_ASSERT(EXPR)
An assertion macro used to validate the structure of an InputArchive.
Definition: Persistable.h:48
lsst::meas::modelfit.psf.psfContinued.module
module
Definition: psfContinued.py:42