23 #include "pybind11/pybind11.h" 24 #include "pybind11/stl.h" 40 template <
typename Catalog1,
typename Catalog2>
42 typedef typename Catalog1::Record Record1;
43 typedef typename Catalog2::Record Record2;
46 using Class = Match<Record1, Record2>;
47 py::class_<Class, std::shared_ptr<Class>> clsMatch(mod, (prefix +
"Match").c_str());
48 clsMatch.def(py::init<>());
50 "first"_a,
"second"_a,
"distance"_a);
58 mod.def(
"unpackMatches", &unpackMatches<Catalog1, Catalog2>,
"matches"_a,
"cat1"_a,
"cat2"_a);
60 mod.def(
"matchRaDec", (MatchList(*)(Catalog1
const &, Catalog2
const &,
lsst::geom::Angle,
61 MatchControl
const &))matchRaDec<Catalog1, Catalog2>,
62 "cat1"_a,
"cat2"_a,
"radius"_a,
"mc"_a = MatchControl());
70 template <
typename Catalog>
74 (MatchList(*)(Catalog
const &,
lsst::geom::Angle, MatchControl
const &))matchRaDec<Catalog>,
75 "cat"_a,
"radius"_a,
"mc"_a = MatchControl());
85 py::class_<MatchControl> clsMatchControl(mod,
"MatchControl");
86 clsMatchControl.def(py::init<>());
91 declareMatch2<SimpleCatalog, SimpleCatalog>(mod,
"Simple");
92 declareMatch2<SimpleCatalog, SourceCatalog>(mod,
"Reference");
93 declareMatch2<SourceCatalog, SourceCatalog>(mod,
"Source");
94 declareMatch1<SimpleCatalog>(mod);
95 declareMatch1<SourceCatalog>(mod);
99 "cat1"_a,
"cat2"_a,
"radius"_a,
"mc"_a =
MatchControl());
A class representing an angle.
Pass parameters to algorithms that match list of sources.
PYBIND11_MODULE(match, mod)
A base class for image defects.
#define LSST_DECLARE_CONTROL_FIELD(WRAPPER, CLASS, NAME)
Macro used to wrap fields declared by LSST_CONTROL_FIELD using Pybind11.
SourceMatchVector matchXy(SourceCatalog const &cat1, SourceCatalog const &cat2, double radius, MatchControl const &mc=MatchControl())
Compute all tuples (s1,s2,d) where s1 belings to cat1, s2 belongs to cat2 and d, the distance between...
std::vector< SourceMatch > SourceMatchVector