23 #include "pybind11/pybind11.h"
24 #include "pybind11/stl.h"
29 #include "ndarray/pybind11.h"
36 using namespace pybind11::literals;
44 void declareVectorOperations(
py::module& mod) {
45 typedef ndarray::Array<T, 1> Array;
46 typedef ndarray::Array<T const, 1> ConstArray;
47 mod.def(
"abMagFromFlux", (Array(*)(ConstArray
const&)) & abMagFromFlux<T>,
"flux"_a);
48 mod.def(
"abMagErrFromFluxErr", (Array(*)(ConstArray
const&, ConstArray
const&)) & abMagErrFromFluxErr<T>,
49 "fluxErr"_a,
"flux"_a);
50 mod.def(
"fluxFromABMag", (Array(*)(ConstArray
const&)) & fluxFromABMag<T>,
"mag"_a);
51 mod.def(
"fluxErrFromABMagErr", (Array(*)(ConstArray
const&, ConstArray
const&)) & fluxErrFromABMagErr<T>,
57 mod.def(
"abMagFromFlux", (
double (*)(
double)) &
abMagFromFlux,
"flux"_a);
58 mod.def(
"abMagErrFromFluxErr", (
double (*)(
double,
double)) &
abMagErrFromFluxErr,
"fluxErr"_a,
"flux"_a);
59 mod.def(
"fluxFromABMag", (
double (*)(
double)) &
fluxFromABMag,
"mag"_a);
60 mod.def(
"fluxErrFromABMagErr", (
double (*)(
double,
double)) &
fluxErrFromABMagErr,
"magErr"_a,
"mag"_a);
61 declareVectorOperations<float>(mod);
62 declareVectorOperations<double>(mod);