22 #include "pybind11/pybind11.h" 24 #include "lsst/afw/table/io/python.h" 28 static double PSFEX_SAVE_BIG =
BIG;
29 static double PSFEX_SAVE_INTERPFAC =
INTERPFAC;
35 #include "lsst/afw/table/io/OutputArchive.h" 39 double BIG = PSFEX_SAVE_BIG;
42 namespace py = pybind11;
47 namespace extensions {
51 py::module::import(
"lsst.afw.table");
52 py::module::import(
"lsst.meas.algorithms");
54 py::module mod(
"psfexPsf");
56 mod.attr(
"BIG") = py::cast(
BIG);
57 mod.attr(
"INTERPFAC") = py::cast(
INTERPFAC);
59 lsst::afw::table::io::python::declarePersistableFacade<PsfexPsf>(mod,
"PsfexPsf");
61 py::class_<PsfexPsf, std::shared_ptr<PsfexPsf>, lsst::afw::table::io::PersistableFacade<PsfexPsf>, lsst::meas::algorithms::ImagePsf> clsPsfexPsf(mod,
"PsfexPsf");
64 clsPsfexPsf.def(py::init<lsst::meas::extensions::psfex::Psf const&, lsst::afw::geom::Point2D const &>(),
65 "psf"_a,
"averagePosition"_a=lsst::afw::geom::Point2D());
68 clsPsfexPsf.def(
"clone", &PsfexPsf::clone);
69 clsPsfexPsf.def(
"getAveragePosition", &PsfexPsf::getAveragePosition);
70 clsPsfexPsf.def(
"getKernel", &PsfexPsf::getKernel,
71 "position"_a=lsst::afw::geom::Point2D(std::numeric_limits<double>::quiet_NaN()));
72 clsPsfexPsf.def(
"isPersistable", &PsfexPsf::isPersistable);
73 clsPsfexPsf.def(
"write", &PsfexPsf::write);
PYBIND11_PLUGIN(psfexPsf)