Loading [MathJax]/extensions/tex2jax.js
LSST Applications g0d33ba9806+3d1aa5cd78,g0fba68d861+6c07529581,g1e78f5e6d3+aa4d1c21f1,g1ec0fe41b4+f536777771,g1fd858c14a+c6963eae98,g35bb328faa+fcb1d3bbc8,g4af146b050+58cb980876,g4d2262a081+bfae794ebc,g53246c7159+fcb1d3bbc8,g5a012ec0e7+b20b785ecb,g60b5630c4e+3d1aa5cd78,g67b6fd64d1+4086c0989b,g78460c75b0+2f9a1b4bcd,g786e29fd12+cf7ec2a62a,g7b71ed6315+fcb1d3bbc8,g87b7deb4dc+a8b896a16a,g8852436030+75f93ca278,g89139ef638+4086c0989b,g9125e01d80+fcb1d3bbc8,g94187f82dc+3d1aa5cd78,g989de1cb63+4086c0989b,g9f33ca652e+94dd9a85be,g9f7030ddb1+3f50642ad9,ga2b97cdc51+3d1aa5cd78,ga44b1db4f6+7d2d5e68ea,gabe3b4be73+1e0a283bba,gabf8522325+fa80ff7197,gb1101e3267+96cb2ddcf2,gb58c049af0+f03b321e39,gb89ab40317+4086c0989b,gcf25f946ba+75f93ca278,gd6cbbdb0b4+af3c3595f5,gd9a9a58781+fcb1d3bbc8,gde0f65d7ad+ed90e8109d,ge278dab8ac+d65b3c2b70,ge410e46f29+4086c0989b,gf67bdafdda+4086c0989b,gfe06eef73a+e2ab3e8e4f,v29.0.0.rc5
LSST Data Management Base Package
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
data.cc File Reference
#include <pybind11/attr.h>
#include <pybind11/pybind11.h>
#include <pybind11/stl.h>
#include <memory>
#include <string>
#include "lsst/gauss2d/fit/data.h"
#include "lsst/gauss2d/fit/observation.h"
#include "lsst/gauss2d/fit/parametric.h"
#include "lsst/gauss2d/python/image.h"
#include "pybind11.h"

Go to the source code of this file.

Functions

template<typename T>
void declare_data (py::module &m, std::string str_type)
 
void bind_data (py::module &m)
 

Function Documentation

◆ bind_data()

void bind_data ( py::module & m)

Definition at line 66 of file data.cc.

66 {
68 declare_data<float>(m, "F");
69}
void declare_data(py::module &m, std::string str_type)
Definition data.cc:44

◆ declare_data()

template<typename T>
void declare_data ( py::module & m,
std::string str_type )

Definition at line 44 of file data.cc.

44 {
47 std::string pyclass_name = std::string("Data") + str_type;
48 py::class_<Data, std::shared_ptr<Data>, g2f::Chromatic, g2f::Parametric>(m, pyclass_name.c_str())
49 .def(py::init<std::vector<std::shared_ptr<const Observation>>>(), "data"_a)
50 .def_property_readonly("channels", &Data::get_channels)
51 .def("parameters", &Data::get_parameters, "parameters"_a = g2f::ParamRefs(),
52 "paramfilter"_a = nullptr)
53 .def_property_readonly("size", &Data::size)
54 .def("__getitem__", &Data::at)
55 .def("__len__", &Data::size)
56 // .def("__repr__", [](const Data &self) { return self.repr(true);
57 // })
58 .def("__str__", [str_type](const Data &self) {
59 std::string str = self.str();
61 self.CC_NAMESPACE_SEPARATOR);
62 return str;
63 });
64}
T c_str(T... args)
A list of Observation instances that can be modelled.
Definition data.h:32
An observed single-channel image with an associated variance and mask.
Definition observation.h:35
A parametric object that can return and filter its Parameter instances.
Definition parametric.h:13
A Python image using numpy arrrays for storage.
Definition image.h:72
std::vector< ParamBaseRef > ParamRefs
Definition param_defs.h:13
std::string replace_images_types(std::string target, std::string str_type, std::string_view separator)
Replace templated Image and index Image type name with Pythonic names.
Definition image.h:144