22#include "pybind11/pybind11.h"
23#include "pybind11/stl.h"
29using namespace pybind11::literals;
35 py::module::import(
"lsst.afw.table");
37 py::class_<ShapeletFunctionKey, std::shared_ptr<ShapeletFunctionKey>> clsShapeletFunctionKey(
38 mod,
"ShapeletFunctionKey");
40 clsShapeletFunctionKey.def(py::init<>());
41 clsShapeletFunctionKey.def(
43 "ellipse"_a,
"coefficients"_a,
"basisType"_a =
HERMITE);
44 clsShapeletFunctionKey.def(py::init<afw::table::SubSchema const &, BasisTypeEnum>(),
"s"_a,
47 clsShapeletFunctionKey.def(
"__eq__", &ShapeletFunctionKey::operator==, py::is_operator());
48 clsShapeletFunctionKey.def(
"__ne__", &ShapeletFunctionKey::operator!=, py::is_operator());
51 "doc"_a,
"ellipseUnit"_a,
"coeffUnit"_a,
"order"_a,
62 py::class_<MultiShapeletFunctionKey, std::shared_ptr<MultiShapeletFunctionKey>>
63 clsMultiShapeletFunctionKey(mod,
"MultiShapeletFunctionKey");
65 clsMultiShapeletFunctionKey.def(py::init<>());
66 clsMultiShapeletFunctionKey.def(py::init<afw::table::SubSchema const &, BasisTypeEnum>(),
"s"_a,
72 "name"_a,
"doc"_a,
"ellipseUnit"_a,
"coeffUnit"_a,
"orders"_a,
75 clsMultiShapeletFunctionKey.def(
"__eq__", &MultiShapeletFunctionKey::operator==, py::is_operator());
76 clsMultiShapeletFunctionKey.def(
"__ne__", &MultiShapeletFunctionKey::operator!=, py::is_operator());
77 clsMultiShapeletFunctionKey.def(
"__getitem__",
A FunctorKey used to get or set a ndarray::Array from a sequence of scalar Keys.
A FunctorKey used to get or set a geom::ellipses::Ellipse from an (xx,yy,xy,x,y) tuple of Keys.
Class that maps MultiShapeletFunction objects to fields in afw::table objects.
virtual void set(afw::table::BaseRecord &record, MultiShapeletFunction const &value) const
Set a MultiShapeletFunction in the given record.
static MultiShapeletFunctionKey addFields(afw::table::Schema &schema, std::string const &name, std::string const &doc, std::string const &ellipseUnit, std::string const &coeffUnit, std::vector< int > const &orders, BasisTypeEnum basisType=HERMITE)
Add the necessary fields for saving a ShapeletFunction to a Schema.
virtual MultiShapeletFunction get(afw::table::BaseRecord const &record) const
Get a MultiShapeletFunction from the given record.
bool isValid() const
Return True if all the constituent Keys are valid.
bool isValid() const
Return True if all the constituent Keys are valid.
afw::table::ArrayKey< double > const & getCoefficients() const
Return a FunctorKey that extracts just the coefficients.
virtual void set(afw::table::BaseRecord &record, ShapeletFunction const &value) const
Set a ShapeletFunction in the given record.
static ShapeletFunctionKey addFields(afw::table::Schema &schema, std::string const &name, std::string const &doc, std::string const &ellipseUnit, std::string const &coeffUnit, int order, BasisTypeEnum basisType=HERMITE)
Add the necessary fields for saving a ShapeletFunction to a Schema.
int getOrder() const
Return the shapelet order.
afw::table::EllipseKey const & getEllipse() const
Return a FunctorKey that extracts just the Ellipse.
BasisTypeEnum getBasisType() const
Return the type of the shapelet basis.
virtual ShapeletFunction get(afw::table::BaseRecord const &record) const
Get a ShapeletFunction from the given record.
PYBIND11_MODULE(basisEvaluator, mod)
@ HERMITE
Cartesian shapelets or Gauss-Hermite functions, as defined in Refregier, 2003.