25 #include "pybind11/pybind11.h"
26 #include "pybind11/stl.h"
40 using namespace pybind11::literals;
47 py::class_<Point, std::shared_ptr<Point>> cls(mod,
"Point");
49 cls.def(py::init<double, double>(),
"x"_a,
"y"_a);
58 py::class_<FatPoint, std::shared_ptr<FatPoint>, Point> cls(mod,
"FatPoint");
64 py::class_<BaseStar, std::shared_ptr<BaseStar>, FatPoint> cls(mod,
"BaseStar");
66 cls.def(py::init<double, double, double, double>(),
"x"_a,
"y"_a,
"flux"_a,
"fluxErr"_a);
70 cls.def_readwrite(
"vx", &BaseStar::vx);
71 cls.def_readwrite(
"vy", &BaseStar::vy);
72 cls.def_readwrite(
"vxy", &BaseStar::vxy);
74 cls.def_property_readonly(
"flux", (
double (BaseStar::*)()
const) & BaseStar::getFlux);
75 cls.def_property_readonly(
"fluxErr", (
double (BaseStar::*)()
const) & BaseStar::getFluxErr);
76 cls.def_property_readonly(
"mag", (
double (BaseStar::*)()
const) & BaseStar::getMag);
77 cls.def_property_readonly(
"magErr", (
double (BaseStar::*)()
const) & BaseStar::getMagErr);
81 py::class_<RefStar, std::shared_ptr<RefStar>, BaseStar> cls(mod,
"RefStar");
83 cls.def(py::init<double, double, double, double>(),
"xx"_a,
"yy"_a,
"flux"_a,
"fluxErr"_a);
85 cls.def(
"setProperMotion", py::overload_cast<ProperMotion const &>(&RefStar::setProperMotion));
86 cls.def(
"applyProperMotion", &RefStar::applyProperMotion);
90 py::class_<FittedStar, std::shared_ptr<FittedStar>, BaseStar> cls(mod,
"FittedStar");
92 cls.def(py::init<>());
93 cls.def(py::init<BaseStar const &>(),
"baseStar"_a);
97 py::class_<MeasuredStar, std::shared_ptr<MeasuredStar>, BaseStar> cls(mod,
"MeasuredStar");
99 cls.def(py::init<>());
100 cls.def(py::init<BaseStar const &>(),
"baseStar"_a);
102 cls.def(
"getFittedStar", &MeasuredStar::getFittedStar);
103 cls.def(
"setFittedStar", &MeasuredStar::setFittedStar);
105 cls.def(
"getInstFlux", &MeasuredStar::getInstFlux);
106 cls.def(
"setInstFluxAndErr", &MeasuredStar::setInstFluxAndErr);
107 cls.def(
"getInstFluxErr", &MeasuredStar::getInstFluxErr);
108 cls.def(
"getInstMag", &MeasuredStar::getInstMag);
109 cls.def(
"getInstMagErr", &MeasuredStar::getInstMagErr);
110 cls.def(
"setXFocal", &MeasuredStar::setXFocal);
111 cls.def(
"setYFocal", &MeasuredStar::setYFocal);
112 cls.def(
"getXFocal", &MeasuredStar::getXFocal);
113 cls.def(
"getYFocal", &MeasuredStar::getYFocal);
117 py::class_<ProperMotion, std::shared_ptr<ProperMotion>> cls(mod,
"ProperMotion");
119 cls.def(py::init<double, double, double, double, double>(),
"ra"_a,
"dec"_a,
"raErr"_a,
"decErr"_a,
122 cls.def(
"apply", &ProperMotion::apply);
129 declareFatPoint(mod);
130 declareBaseStar(mod);
132 declareFittedStar(mod);
133 declareMeasuredStar(mod);
134 declareProperMotion(mod);
PYBIND11_MODULE(_cameraGeom, mod)
void addOutputOp(PyClass &cls, std::string const &method)
Add __str__ or __repr__ method implemented by operator<<.
A base class for image defects.