22 #include "pybind11/pybind11.h" 
   27 using namespace pybind11::literals;
 
   31 namespace algorithms {
 
   34 template <
typename PixelT>
 
   36     using Class = PsfCandidate<PixelT>;
 
   38     py::class_<Class, std::shared_ptr<Class>, afw::math::SpatialCellImageCandidate> 
cls(
 
   39             mod, (
"PsfCandidate" + suffix).c_str());
 
   43             "source"_a, 
"parentExposure"_a);
 
   46             "source"_a, 
"parentExposure"_a, 
"xCenter"_a, 
"yCenter"_a);
 
   52     cls.def(
"_getCandidateRating", &Class::getCandidateRating);
 
   53     cls.def(
"getSource", &Class::getSource);
 
   54     cls.def(
"getAmplitude", &Class::getAmplitude);
 
   55     cls.def(
"setAmplitude", &Class::setAmplitude);
 
   56     cls.def(
"getVar", &Class::getVar);
 
   57     cls.def(
"setVar", &Class::setVar);
 
   58     cls.def(
"getMaskedImage", (
std::shared_ptr<afw::image::MaskedImage<PixelT> 
const>(Class::*)() 
const) &
 
   59                                       Class::getMaskedImage);
 
   60     cls.def(
"getMaskedImage",
 
   61             (
std::shared_ptr<afw::image::MaskedImage<PixelT> 
const>(Class::*)(
int, 
int) 
const) &
 
   62                     Class::getMaskedImage,
 
   63             "width"_a, 
"height"_a);
 
   64     cls.def(
"getOffsetImage", &Class::getOffsetImage);
 
   65     cls.def_static(
"getBorderWidth", &Class::getBorderWidth);
 
   66     cls.def_static(
"setBorderWidth", &Class::setBorderWidth);
 
   67     cls.def_static(
"setPixelThreshold", &Class::setPixelThreshold);
 
   68     cls.def_static(
"getPixelThreshold", &Class::getPixelThreshold);
 
   69     cls.def_static(
"setMaskBlends", &Class::setMaskBlends);
 
   70     cls.def_static(
"getMaskBlends", &Class::getMaskBlends);
 
   72     mod.def(
"makePsfCandidate", makePsfCandidate<PixelT>, 
"source"_a, 
"image"_a);
 
   78     declarePsfCandidate<float>(mod, 
"F");