Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions include/lsst/ip/diffim/BuildSingleKernelVisitor.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,12 @@ namespace detail {
int getNProcessed() {return _nProcessed;}
void reset() {_nRejected = 0; _nProcessed = 0;}

std::shared_ptr<lsst::daf::base::PropertySet> getPropertySet() { return _ps; }
bool getSkipBuilt() { return _skipBuilt; }
bool getUseRegularization() { return _useRegularization; }
bool getUseCoreStats() { return _useCoreStats; }
int getCoreRadius() { return _coreRadius; }

void processCandidate(lsst::afw::math::SpatialCellCandidate *candidate);

private:
Expand Down
7 changes: 7 additions & 0 deletions python/lsst/ip/diffim/detail/buildSingleKernelVisitor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,13 @@ void declareBuildSingleKernelVisitor(lsst::cpputils::python::WrapperCollection &
cls.def("getNProcessed", &BuildSingleKernelVisitor<PixelT>::getNProcessed);
cls.def("reset", &BuildSingleKernelVisitor<PixelT>::reset);
cls.def("processCandidate", &BuildSingleKernelVisitor<PixelT>::processCandidate, "candidate"_a);
cls.def_property_readonly("nRejected", &BuildSingleKernelVisitor<PixelT>::getNRejected);
cls.def_property_readonly("nProcessed", &BuildSingleKernelVisitor<PixelT>::getNProcessed);
cls.def_property_readonly("useRegularization", &BuildSingleKernelVisitor<PixelT>::getUseRegularization);
cls.def_property_readonly("skipBuilt", &BuildSingleKernelVisitor<PixelT>::getSkipBuilt);
cls.def_property_readonly("useCoreStats", &BuildSingleKernelVisitor<PixelT>::getUseCoreStats);
cls.def_property_readonly("coreRadius", &BuildSingleKernelVisitor<PixelT>::getCoreRadius);
cls.def_property_readonly("propertySet", &BuildSingleKernelVisitor<PixelT>::getPropertySet);

mod.def("makeBuildSingleKernelVisitor",
(std::shared_ptr<BuildSingleKernelVisitor<PixelT>>(*)(afw::math::KernelList const &,
Expand Down
3 changes: 1 addition & 2 deletions python/lsst/ip/diffim/makeKernel.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,7 @@ class MakeKernelTask(PsfMatchTask):
_DefaultName = "makeALKernel"

def __init__(self, *args, **kwargs):
PsfMatchTask.__init__(self, *args, **kwargs)
self.kConfig = self.config.kernel.active
super().__init__(*args, **kwargs)
# the background subtraction task uses a config from an unusual location,
# so cannot easily be constructed with makeSubtask
self.background = SubtractBackgroundTask(config=self.kConfig.afwBackgroundConfig, name="background",
Expand Down
23 changes: 6 additions & 17 deletions python/lsst/ip/diffim/psfMatch.py
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,12 @@ class PsfMatchTask(pipeBase.Task, abc.ABC):
also performs background matching and returns the differential background model as an
`lsst.afw.math.Kernel.SpatialFunction`.

The initialization sets the Psf-matching kernel configuration using the
value of self.config.kernel.active. If the kernel is requested with
regularization to moderate the bias/variance tradeoff, currently only used
when a delta function kernel basis is provided, it creates a
regularization matrix stored as member variable self.hMat.

**Invoking the Task**

As a base class, this Task is not directly invoked. However, ``run()`` methods that are
Expand Down Expand Up @@ -549,23 +555,6 @@ def DebugInfo(name):
_DefaultName = "psfMatch"

def __init__(self, *args, **kwargs):
"""Create the psf-matching Task

Parameters
----------
*args
Arguments to be passed to ``lsst.pipe.base.task.Task.__init__``
**kwargs
Keyword arguments to be passed to ``lsst.pipe.base.task.Task.__init__``

Notes
-----
The initialization sets the Psf-matching kernel configuration using the value of
self.config.kernel.active. If the kernel is requested with regularization to moderate
the bias/variance tradeoff, currently only used when a delta function kernel basis
is provided, it creates a regularization matrix stored as member variable
self.hMat.
"""
pipeBase.Task.__init__(self, *args, **kwargs)
self.kConfig = self.config.kernel.active

Expand Down