LSSTApplications
20.0.0
LSSTDataManagementBasePackage
|
Go to the documentation of this file.
53 os <<
"kernelFunction.getNParameters() = " <<
kernelFunction.getNParameters()
54 <<
" != " << spatialFunctionList.
size() <<
" = "
55 <<
"spatialFunctionList.size()";
68 retPtr->setCtr(this->
getCtr());
113 for (
int y = 0;
y !=
image.getHeight(); ++
y) {
116 for (
int x = 0;
x !=
image.getWidth(); ++
x, ++
ptr) {
118 Pixel const pixelVal = (*_kernelFunctionPtr)(fx, fy);
124 if (doNormalize && (imSum != 1)) {
146 explicit AnalyticKernelPersistenceHelper(
int nSpatialFunctions)
147 : Kernel::PersistenceHelper(nSpatialFunctions),
149 "kernelfunction",
"archive ID for analytic function used to produce kernel images")) {}
151 explicit AnalyticKernelPersistenceHelper(table::Schema
const &schema_)
163 AnalyticKernelPersistenceHelper
const keys(catalogs.
front().getSchema());
168 if (
keys.spatialFunctions.isValid()) {
169 result = std::make_shared<AnalyticKernel>(record.
get(
keys.dimensions.getX()),
171 keys.readSpatialFunctions(archive, record));
173 result = std::make_shared<AnalyticKernel>(record.
get(
keys.dimensions.getX()),
185 std::string getAnalyticKernelPersistenceName() {
return "AnalyticKernel"; }
Backwards-compatibility support for depersisting the old Calib (FluxMag0/FluxMag0Err) objects.
void setKernelParametersFromSpatialModel(double x, double y) const
Set the kernel parameters from the spatial model (if any).
lsst::geom::Extent2I const getDimensions() const
Return the Kernel's dimensions (width, height)
bool isSpatiallyVarying() const
Return true iff the kernel is spatially varying (has a spatial function)
Field< T >::Value get(Key< T > const &key) const
Return the value of a field for the given key.
table::Key< int > kernelFunction
std::string toString(std::string const &prefix="") const override
Return a string representation of the kernel.
int getHeight() const
Return the Kernel's height.
double doComputeImage(lsst::afw::image::Image< Pixel > &image, bool doNormalize) const override
Low-level version of computeImage.
An object passed to Persistable::write to allow it to persist itself.
virtual std::shared_ptr< Function2< ReturnT > > clone() const =0
Return a pointer to a deep copy of this function.
std::vector< double > const & getParameters() const noexcept
Return all function parameters.
double computeImage(lsst::afw::image::Image< Pixel > &image, bool doNormalize, double x=0.0, double y=0.0) const
Compute an image (pixellized representation of the kernel) in place.
KernelFunctionPtr _kernelFunctionPtr
lsst::geom::Point2I getCtr() const
Return index of kernel's center.
PersistableFactory(std::string const &name)
Constructor for the factory.
void setKernelParameter(unsigned int ind, double value) const override
Set one kernel parameter.
#define LSST_ARCHIVE_ASSERT(EXPR)
An assertion macro used to validate the structure of an InputArchive.
Factory(std::string const &name)
virtual std::string toString(std::string const &prefix="") const
Return a string representation of the kernel.
Reports when the result of an arithmetic operation is too large for the destination type.
Base class for all records.
A vector of catalogs used by Persistable.
void write(OutputArchiveHandle &handle) const override
Write the object to one or more catalogs.
A base class for factory classes used to reconstruct objects from records.
_view_t::x_iterator x_iterator
An iterator for traversing the pixels in a row.
int getWidth() const
Return the Kernel's width.
A base class for image defects.
#define LSST_EXCEPT(type,...)
Create an exception with a given type.
std::vector< SpatialFunctionPtr > _spatialFunctionList
std::vector< double > getKernelParameters() const override
Return the current kernel parameters.
Reports invalid arguments.
std::shared_ptr< Kernel > resized(int width, int height) const override
Return a pointer to a clone with specified kernel dimensions.
void setParameter(unsigned int ind, double newValue)
Set one function parameter without range checking.
AnalyticKernel()
Construct an empty spatially invariant AnalyticKernel of size 0x0.
std::string getPersistenceName() const override
Return the unique name used to persist this object and look up its factory.
Kernels are used for convolution with MaskedImages and (eventually) Images.
int put(Persistable const *obj, bool permissive=false)
Save an object to the archive and return a unique ID that can be used to retrieve it from an InputArc...
std::shared_ptr< afw::table::io::Persistable > read(InputArchive const &archive, CatalogVector const &catalogs) const override
Construct a new object from the given InputArchive and vector of catalogs.
std::string toString(std::string const &prefix="") const override
Return a string representation of the function.
std::shared_ptr< Kernel > clone() const override
Return a pointer to a deep copy of this kernel.
virtual KernelFunctionPtr getKernelFunction() const
Get a deep copy of the kernel function.