LSST Applications g034a557a3c+0df69e75ff,g0afe43252f+b86e4b8053,g11f7dcd041+017865fdd3,g1cd03abf6b+1c8dc8730a,g1ce3e0751c+f991eae79d,g28da252d5a+a136f03385,g2bbee38e9b+b6588ad223,g2bc492864f+b6588ad223,g2cdde0e794+8523d0dbb4,g347aa1857d+b6588ad223,g35bb328faa+b86e4b8053,g3a166c0a6a+b6588ad223,g461a3dce89+b86e4b8053,g52b1c1532d+b86e4b8053,g6233c72cae+da9c58a417,g7f3b0d46df+ad13c1b82d,g80478fca09+f29c5d6c70,g858d7b2824+4fc997592f,g8cd86fa7b1+5f14beadf5,g965a9036f2+4fc997592f,g979bb04a14+87f76c17e6,g9ddcbc5298+f24b38b85a,gae0086650b+b86e4b8053,gbb886bcc26+77117948e7,gc28159a63d+b6588ad223,gc30aee3386+a2f0f6cab9,gcaf7e4fdec+4fc997592f,gcd45df26be+4fc997592f,gcdd4ae20e8+0acf6430b1,gcf0d15dbbd+0acf6430b1,gdaeeff99f8+006e14e809,gdbce86181e+467b805b48,ge3d4d395c2+224150c836,ge5f7162a3a+1d9667e7ad,ge6cb8fbbf7+0992c83eee,ge79ae78c31+b6588ad223,gf048a9a2f4+41d6ddaca1,gf0baf85859+b4cca3d10f,w.2024.30
LSST Data Management Base Package
Loading...
Searching...
No Matches
Functions
pybind11.h File Reference
#include <pybind11/pybind11.h>

Go to the source code of this file.

Functions

void bind_centroidparameters (py::module &m)
 
void bind_channel (py::module &m)
 
void bind_chromatic (py::module &m)
 
void bind_component (py::module &m)
 
void bind_componentmixture (py::module &m)
 
void bind_data (py::module &m)
 
void bind_ellipticalcomponent (py::module &m)
 
void bind_fractionalintegralmodel (py::module &m)
 
void bind_gaussiancomponent (py::module &m)
 
void bind_gaussianmodelintegral (py::module &m)
 
void bind_gaussianparametricellipse (py::module &m)
 
void bind_gaussianprior (py::module &m)
 
void bind_integralmodel (py::module &m)
 
void bind_interpolation (py::module &m)
 
void bind_linearintegralmodel (py::module &m)
 
void bind_linearsersicmixinterpolator (py::module &m)
 
void bind_model (py::module &m)
 
void bind_observation (py::module &m)
 
void bind_param_filter (py::module &m)
 
void bind_parameters (py::module &m)
 
void bind_parametric (py::module &m)
 
void bind_parametricgaussian1d (py::module &m)
 
void bind_parametricellipse (py::module &m)
 
void bind_parametricmodel (py::module &m)
 
void bind_prior (py::module &m)
 
void bind_psfmodel (py::module &m)
 
void bind_sersicmix (py::module &m)
 
void bind_sersicmixcomponent (py::module &m)
 
void bind_sersicparametricellipse (py::module &m)
 
void bind_shapeprior (py::module &m)
 
void bind_source (py::module &m)
 

Function Documentation

◆ bind_centroidparameters()

void bind_centroidparameters ( py::module & m)

Definition at line 42 of file centroidparameters.cc.

42 {
43 auto _c = py::class_<g2f::CentroidParameters, std::shared_ptr<g2f::CentroidParameters>,
44 lsst::gauss2d::CentroidData>(m, "CentroidParameters")
45 .def(py::init<double, double>(), "x"_a = 0, "y"_a = 0)
48 "x"_a = nullptr, "y"_a = nullptr)
49 .def_property("x", &g2f::CentroidParameters::get_x, &g2f::CentroidParameters::set_x)
50 .def_property("y", &g2f::CentroidParameters::get_y, &g2f::CentroidParameters::set_y)
51 .def_property("xy", &g2f::CentroidParameters::get_xy, &g2f::CentroidParameters::set_xy)
52 .def_property_readonly("x_param", &g2f::CentroidParameters::get_x_param)
53 .def_property_readonly("y_param", &g2f::CentroidParameters::get_y_param)
54 .def_property_readonly("x_param_ptr", &g2f::CentroidParameters::get_x_param_ptr)
55 .def_property_readonly("y_param_ptr", &g2f::CentroidParameters::get_y_param_ptr)
56 .def("__repr__", [](const g2f::CentroidParameters &self) { return self.repr(true); })
57 .def("__str__", &g2f::CentroidParameters::str);
58}
double _c
int m
Definition SpanSet.cc:48
Interface for an object storing Centroid data.
Definition centroid.h:43
A Centroid with Parameters for x and y.

◆ bind_channel()

void bind_channel ( py::module & m)

Definition at line 39 of file channel.cc.

39 {
40 auto _c = py::class_<g2f::Channel, std::shared_ptr<g2f::Channel> >(m, "Channel")
41 .def(py::init(&g2f::Channel::make))
42 .def_static("erase", &g2f::Channel::erase)
43 .def_property_readonly_static("all",
44 [](py::object) { return g2f::Channel::get_channels(); })
45 .def_static("find", &g2f::Channel::find_channel)
46 .def_static("get", &g2f::Channel::get_channel)
47 .def_readonly("name", &g2f::Channel::name)
48 .def_property_readonly_static("NONE",
49 [](py::object) { return g2f::Channel::NONE_PTR(); })
50 .def("__repr__", [](const g2f::Channel &self) { return self.repr(true); })
51 .def("__str__", &g2f::Channel::str);
52 /*
53 const bool operator < ( const Channel &c ) const;
54 const bool operator == ( const Channel &c ) const;
55 const bool operator != ( const Channel &c ) const;
56 */
57}
An observational channel, usually representing some range of wavelengths of light.
Definition channel.h:29

◆ bind_chromatic()

void bind_chromatic ( py::module & m)

Definition at line 37 of file chromatic.cc.

37 {
38 auto _p = py::class_<g2f::Chromatic, std::shared_ptr<g2f::Chromatic>>(m, "Chromatic");
39}

◆ bind_component()

void bind_component ( py::module & m)

Definition at line 38 of file component.cc.

38 {
39 auto _c = py::class_<g2f::Component, std::shared_ptr<g2f::Component>, g2f::ParametricModel>(m,
40 "Component");
41}
A Parametric that can manage Parameter gradients and return Gaussians.

◆ bind_componentmixture()

void bind_componentmixture ( py::module & m)

Definition at line 38 of file componentmixture.cc.

38 {
39 auto _c = py::class_<g2f::ComponentMixture, std::shared_ptr<g2f::ComponentMixture>, g2f::ParametricModel>(
40 m, "ComponentMixture");
41}

◆ bind_data()

void bind_data ( py::module & m)

Definition at line 66 of file data.cc.

66 {
67 declare_data<double>(m, "D");
68 declare_data<float>(m, "F");
69}

◆ bind_ellipticalcomponent()

void bind_ellipticalcomponent ( py::module & m)

Definition at line 41 of file ellipticalcomponent.cc.

41 {
42 auto _e = py::class_<g2f::EllipticalComponent, std::shared_ptr<g2f::EllipticalComponent>, g2f::Component>(
43 m, "EllipticalComponent")
44 .def_property_readonly("centroid", &g2f::EllipticalComponent::get_centroid)
45 .def_property_readonly("ellipse", &g2f::EllipticalComponent::get_ellipse)
46 .def_property_readonly("integralmodel", &g2f::EllipticalComponent::get_integralmodel);
47}
An atomic constituent of a source.
Definition component.h:15

◆ bind_fractionalintegralmodel()

void bind_fractionalintegralmodel ( py::module & m)

Definition at line 40 of file fractionalintegralmodel.cc.

40 {
41 auto _p = py::class_<g2f::FractionalIntegralModel, std::shared_ptr<g2f::FractionalIntegralModel>,
42 g2f::IntegralModel>(m, "FractionalIntegralModel")
43 .def(py::init(&g2f::FractionalIntegralModel::make), "data"_a, "model"_a,
44 "is_final"_a = false)
45 .def_property_readonly("channels", &g2f::FractionalIntegralModel::get_channels)
46 .def("integral", &g2f::FractionalIntegralModel::get_integral, "channel"_a)
47 .def("integral_remainder", &g2f::FractionalIntegralModel::get_integral_remainder,
48 "channel"_a)
49 .def("parameters", &g2f::FractionalIntegralModel::get_parameters,
50 "parameters"_a = g2f::ParamRefs(), "paramfilter"_a = nullptr)
51 .def_property_readonly("parent_model", &g2f::FractionalIntegralModel::get_parent_model)
52 .def_static("model", &g2f::FractionalIntegralModel::find_model)
53 .def("__getitem__", [](const g2f::FractionalIntegralModel &self,
54 const g2f::Channel &c) { return self.at(c); })
55 .def("__len__", &g2f::FractionalIntegralModel::size)
56 .def("__repr__",
57 [](const g2f::FractionalIntegralModel &self) { return self.repr(true); })
58 .def("__str__", &g2f::FractionalIntegralModel::str);
59}
An IntegralModel that returns a Parameter-dependent fraction of the flux of another IntegralModel.
A Parametric model for the integral of a 2D distribution.

◆ bind_gaussiancomponent()

void bind_gaussiancomponent ( py::module & m)

Definition at line 40 of file gaussiancomponent.cc.

40 {
41 auto _e = py::class_<g2f::GaussianComponent, std::shared_ptr<g2f::GaussianComponent>,
42 g2f::EllipticalComponent>(m, "GaussianComponent")
46 "ellipse"_a = nullptr, "centroid"_a = nullptr, "integral"_a = nullptr)
47 .def("parameters", &g2f::GaussianComponent::get_parameters,
48 "parameters"_a = g2f::ParamRefs(), "paramfilter"_a = nullptr)
49 .def("gaussians",
50 [](const g2f::GaussianComponent &g, const g2f::Channel &c) {
52 })
53 .def_static("make_uniq_default_gaussians",
54 &g2f::GaussianComponent::make_uniq_default_gaussians, "sizes"_a, "fixed"_a)
55 .def("__repr__", [](const g2f::GaussianComponent &self) { return self.repr(true); })
56 .def("__str__", &g2f::GaussianComponent::str);
57}
A Component with an elliptically-symmetric intensity profile.
A Component consisting of a 2D Gaussian.
std::unique_ptr< const lsst::gauss2d::Gaussians > get_gaussians(const Channel &channel) const override
Return the vector of Gaussian sub-components controlled by this model.

◆ bind_gaussianmodelintegral()

void bind_gaussianmodelintegral ( py::module & m)

Definition at line 41 of file gaussianmodelintegral.cc.

41 {
42 auto _p = py::class_<g2f::GaussianModelIntegral, std::shared_ptr<g2f::GaussianModelIntegral>,
43 lsst::gauss2d::GaussianIntegral>(m, "GaussianModelIntegral")
44 .def(py::init<const g2f::Channel &, const std::shared_ptr<const g2f::IntegralModel>>(),
45 "channel"_a, "integralmodel"_a)
46 .def_property("value", &g2f::GaussianModelIntegral::get_value,
47 &g2f::GaussianModelIntegral::set_value)
48 .def("__repr__", [](const g2f::GaussianModelIntegral &self) { return self.repr(true); })
49 .def("__str__", &g2f::GaussianModelIntegral::str);
50 /*
51 typename Data::iterator begin() noexcept;
52 typename Data::const_iterator cbegin() const noexcept;
53
54 typename Data::iterator end() noexcept;
55 typename Data::const_iterator cend() const noexcept;
56 */
57}
Interface for the normalization (total integrated value) of a 2D Gaussian.
Definition gaussian.h:47
A single-channel GaussianIntegral referencing a Parametric IntegralModel.

◆ bind_gaussianparametricellipse()

void bind_gaussianparametricellipse ( py::module & m)

Definition at line 39 of file gaussianparametricellipse.cc.

39 {
40 auto _e = py::class_<g2f::GaussianParametricEllipse, std::shared_ptr<g2f::GaussianParametricEllipse>,
41 lsst::gauss2d::EllipseData, g2f::ParametricEllipse>(m, "GaussianParametricEllipse")
42 .def(py::init<double, double, double>(), "sigma_x"_a = 0, "sigma_y"_a = 0, "rho"_a = 0)
46 "sigma_x"_a = nullptr, "sigma_y"_a = nullptr, "rho"_a = nullptr)
47 .def_property("rho", &g2f::GaussianParametricEllipse::get_rho,
48 &g2f::GaussianParametricEllipse::set_rho)
49 .def_property("sigma_x", &g2f::GaussianParametricEllipse::get_sigma_x,
50 &g2f::GaussianParametricEllipse::set_sigma_x)
51 .def_property("sigma_y", &g2f::GaussianParametricEllipse::get_sigma_y,
52 &g2f::GaussianParametricEllipse::set_sigma_y)
53 .def_property("size_x", &g2f::GaussianParametricEllipse::get_size_x,
54 &g2f::GaussianParametricEllipse::set_size_x)
55 .def_property("size_y", &g2f::GaussianParametricEllipse::get_size_y,
56 &g2f::GaussianParametricEllipse::set_size_y)
57 .def_property("xyr", &g2f::GaussianParametricEllipse::get_xyr,
58 &g2f::GaussianParametricEllipse::set_xyr)
59 .def_property_readonly("rho_param", &g2f::GaussianParametricEllipse::get_rho_param)
60 .def_property_readonly("sigma_x_param",
61 &g2f::GaussianParametricEllipse::get_sigma_x_param)
62 .def_property_readonly("sigma_y_param",
63 &g2f::GaussianParametricEllipse::get_sigma_y_param)
64 .def_property_readonly("size_x_param",
65 &g2f::GaussianParametricEllipse::get_size_x_param)
66 .def_property_readonly("size_y_param",
67 &g2f::GaussianParametricEllipse::get_size_y_param)
68 .def_property_readonly("rho_param_ptr",
69 &g2f::GaussianParametricEllipse::get_rho_param_ptr)
70 .def_property_readonly("sigma_x_param_ptr",
71 &g2f::GaussianParametricEllipse::get_sigma_x_param_ptr)
72 .def_property_readonly("sigma_y_param_ptr",
73 &g2f::GaussianParametricEllipse::get_sigma_y_param_ptr)
74 .def_property_readonly("size_x_param_ptr",
75 &g2f::GaussianParametricEllipse::get_size_x_param_ptr)
76 .def_property_readonly("size_y_param_ptr",
77 &g2f::GaussianParametricEllipse::get_size_y_param_ptr)
78 .def("set", &g2f::GaussianParametricEllipse::set)
79 .def("__repr__",
80 [](const g2f::GaussianParametricEllipse &self) { return self.repr(true); })
81 .def("__str__", &g2f::GaussianParametricEllipse::str);
82}
Interface for an object storing Ellipse data.
Definition ellipse.h:132
A Parameter-based implementation of lsst::gauss2d::EllipseData and ParametricEllipse.

◆ bind_gaussianprior()

void bind_gaussianprior ( py::module & m)

Definition at line 40 of file gaussianprior.cc.

40 {
41 auto _e = py::class_<g2f::GaussianPrior, std::shared_ptr<g2f::GaussianPrior>, g2f::Prior>(m,
42 "GaussianPrior")
43 .def(py::init<std::shared_ptr<const g2f::ParamBase>, double, double, bool>(),
44 "param"_a = nullptr, "mean"_a = 0, "stddev"_a = 1., "transformed"_a = false)
45 .def("evaluate", &g2f::GaussianPrior::evaluate, "calc_jacobians"_a = false,
46 "normalize_loglike"_a = false)
47 .def_property_readonly("loglike_const_terms",
48 &g2f::GaussianPrior::get_loglike_const_terms)
49 .def_property("mean", &g2f::GaussianPrior::get_mean, &g2f::GaussianPrior::set_mean)
50 .def_property_readonly("param", &g2f::GaussianPrior::get_param)
51 .def_property("stddev", &g2f::GaussianPrior::get_stddev,
52 &g2f::GaussianPrior::set_stddev)
53 .def_property("transformed", &g2f::GaussianPrior::get_transformed,
54 &g2f::GaussianPrior::set_transformed)
55 .def("__len__", &g2f::GaussianPrior::size)
56 .def("__repr__", [](const g2f::GaussianPrior &self) { return self.repr(true); })
57 .def("__str__", &g2f::GaussianPrior::str);
58}
A 1D Gaussian prior for a single Parameter.
Interface for a prior probability function.
Definition prior.h:38

◆ bind_integralmodel()

void bind_integralmodel ( py::module & m)

Definition at line 37 of file integralmodel.cc.

37 {
38 auto _p = py::class_<g2f::IntegralModel, std::shared_ptr<g2f::IntegralModel>, g2f::Chromatic>(
39 m, "IntegralModel");
40}

◆ bind_interpolation()

void bind_interpolation ( py::module & m)

Definition at line 37 of file interpolation.cc.

37 {
38 auto _e = py::enum_<g2f::InterpType>(m, "InterpType")
39 .value("linear", g2f::InterpType::linear)
40 .value("polynomial", g2f::InterpType::polynomial)
41 .value("cspline", g2f::InterpType::cspline)
42 .value("akima", g2f::InterpType::akima);
43}

◆ bind_linearintegralmodel()

void bind_linearintegralmodel ( py::module & m)

Definition at line 40 of file linearintegralmodel.cc.

40 {
41 auto _p = py::class_<g2f::LinearIntegralModel, std::shared_ptr<g2f::LinearIntegralModel>,
42 g2f::IntegralModel>(m, "LinearIntegralModel")
43 .def(py::init<const g2f::LinearIntegralModel::Data *>(), "data"_a)
44 .def_property_readonly("channels", &g2f::LinearIntegralModel::get_channels)
45 .def("integral", &g2f::LinearIntegralModel::get_integral, "channel"_a)
46 .def("parameters", &g2f::LinearIntegralModel::get_parameters,
47 "parameters"_a = g2f::ParamRefs(), "paramfilter"_a = nullptr)
48 .def("__getitem__", [](const g2f::LinearIntegralModel &self,
49 const g2f::Channel &c) { return self.at(c); })
50 .def("__len__", &g2f::LinearIntegralModel::size)
51 .def("__repr__", [](const g2f::LinearIntegralModel &self) { return self.repr(true); })
52 .def("__str__", &g2f::LinearIntegralModel::str);
53 /*
54 typename Data::iterator begin() noexcept;
55 typename Data::const_iterator cbegin() const noexcept;
56
57 typename Data::iterator end() noexcept;
58 typename Data::const_iterator cend() const noexcept;
59 */
60}
An IntegralModel with a single linear IntegralParameterD per Channel.

◆ bind_linearsersicmixinterpolator()

void bind_linearsersicmixinterpolator ( py::module & m)

Definition at line 40 of file linearsersicmixinterpolator.cc.

40 {
41 auto _e = py::class_<g2f::LinearSersicMixInterpolator, std::shared_ptr<g2f::LinearSersicMixInterpolator>,
42 g2f::SersicMixInterpolator>(m, "LinearSersicMixInterpolator")
43 .def(py::init<short>(), "order"_a = g2f::SERSICMIX_ORDER_DEFAULT)
44 .def("integralsizes", &g2f::LinearSersicMixInterpolator::get_integralsizes)
45 .def("integralsizes_derivs",
46 &g2f::LinearSersicMixInterpolator::get_integralsizes_derivs)
47 .def_property_readonly("order", &g2f::LinearSersicMixInterpolator::get_order)
48 .def("__repr__",
49 [](const g2f::LinearSersicMixInterpolator &self) { return self.repr(true); })
50 .def("__str__", &g2f::LinearSersicMixInterpolator::str);
51}
A SersicMixInterpolator that uses linear interpolation between knots.
An interpolator that returns IntegralSize vectors for a given Sersic index.
Definition sersicmix.h:34

◆ bind_model()

void bind_model ( py::module & m)

Definition at line 90 of file model.cc.

90 {
91 auto _e = py::enum_<g2f::EvaluatorMode>(m, "EvaluatorMode")
92 .value("image", g2f::EvaluatorMode::image)
93 .value("loglike", g2f::EvaluatorMode::loglike)
94 .value("loglike_image", g2f::EvaluatorMode::loglike_image)
95 .value("loglike_grad", g2f::EvaluatorMode::loglike_grad)
96 .value("jacobian", g2f::EvaluatorMode::jacobian)
97 .export_values();
98 auto _h = py::class_<g2f::HessianOptions, std::shared_ptr<g2f::HessianOptions>>(m, "HessianOptions")
99 .def(py::init<bool, double, double>(), "return_negative"_a = true,
100 "findiff_frac"_a = 1e-4, "findiff_add"_a = 1e-4)
101 .def_readwrite("return_negative", &g2f::HessianOptions::return_negative)
102 .def_readwrite("findiff_frac", &g2f::HessianOptions::return_negative)
103 .def_readwrite("findiff_add", &g2f::HessianOptions::return_negative);
104 declare_model<double>(m, "D");
105 declare_model<float>(m, "F");
106}

◆ bind_observation()

void bind_observation ( py::module & m)

Definition at line 64 of file observation.cc.

64 {
65 declare_observation<double>(m, "D");
66 declare_observation<float>(m, "F");
67}

◆ bind_param_filter()

void bind_param_filter ( py::module & m)

Definition at line 38 of file param_filter.cc.

38 {
39 auto _p = py::class_<g2f::ParamFilter, std::shared_ptr<g2f::ParamFilter>>(m, "ParamFilter")
40 .def(py::init<bool, bool, bool, bool,
42 "fixed"_a = true, "free"_a = true, "linear"_a = true, "nonlinear"_a = true,
43 "channel"_a = std::nullopt)
44 .def_readwrite("channel", &g2f::ParamFilter::channel)
45 .def_readwrite("fixed", &g2f::ParamFilter::fixed)
46 .def_readwrite("free", &g2f::ParamFilter::free)
47 .def_readwrite("linear", &g2f::ParamFilter::linear)
48 .def_readwrite("nonlinear", &g2f::ParamFilter::nonlinear);
49}

◆ bind_parameters()

void bind_parameters ( py::module & m)

Definition at line 47 of file parameters.cc.

47 {
48 auto _u = py::class_<parameters::Unit, std::shared_ptr<parameters::Unit>>(m, "Unit");
49 py::class_<g2f::UnitNone, std::shared_ptr<g2f::UnitNone>, parameters::Unit>(m, "UnitNone")
50 .def(py::init<>())
51 .def_property_readonly("name", &g2f::UnitNone::get_name);
52 declare_limits<double>(m);
53 using Parameter = parameters::ParameterBase<double>;
54 auto _p = py::class_<Parameter, std::shared_ptr<Parameter>>(m, "ParameterD");
55 auto integral = declare_parameter<double, g2f::IntegralParameterD>(m, "Integral");
56 integral.def_property("label", &g2f::IntegralParameterD::get_label, &g2f::IntegralParameterD::set_label);
57 declare_parameter<double, g2f::CentroidXParameterD>(m, "CentroidX");
58 declare_parameter<double, g2f::CentroidYParameterD>(m, "CentroidY");
59 declare_parameter<double, g2f::MeanParameterD>(m, "Mean");
60 declare_parameter<double, g2f::MoffatConcentrationParameterD>(m, "MoffatConcentration");
61 auto propfrac = declare_parameter<double, g2f::ProperFractionParameterD>(m, "ProperFraction");
62 propfrac.def_property("label", &g2f::ProperFractionParameterD::get_label,
63 &g2f::ProperFractionParameterD::set_label);
64 declare_sizeparameter_base<double, g2f::SizeXParameterD, g2f::SizeYParameterD>(m);
65 declare_parameter<double, g2f::RadiusScaleParameterD>(m, "RadiusScale");
66 declare_sizeparameter<double, g2f::ReffXParameterD, g2f::SizeXParameterD>(m, "ReffX");
67 declare_sizeparameter<double, g2f::ReffYParameterD, g2f::SizeYParameterD>(m, "ReffY");
68 declare_parameter<double, g2f::RhoParameterD>(m, "Rho");
69 declare_parameter<double, g2f::SersicIndexParameterD>(m, "SersicIndex");
70 declare_sizeparameter<double, g2f::SigmaXParameterD, g2f::SizeXParameterD>(m, "SigmaX");
71 declare_sizeparameter<double, g2f::SigmaYParameterD, g2f::SizeYParameterD>(m, "SigmaY");
72 declare_parameter<double, g2f::StdDevParameterD>(m, "StdDev");
73 declare_transform_base<double>(m);
74 declare_transform<double, lsst::modelfit::parameters::UnitTransform<double>>(m, "Unit");
75 declare_transform<double, g2f::InverseTransform>(m, "Inverse");
76 declare_transform<double, g2f::JanskyToABMagTransform>(m, "JanskyToABMag");
77 declare_transform<double, g2f::NanojanskyToABMagTransform>(m, "NanojanskyToABMag");
78 declare_transform<double, g2f::LogTransform>(m, "Log");
79 declare_transform<double, g2f::Log10Transform>(m, "Log10");
80 declare_transform<double, g2f::LogitTransform>(m, "Logit");
81 // TODO: Determine why this won't work with std::shared_ptr<parameters::Limits<double>>
83 std::shared_ptr<parameters::Limits<double>>, double>(m, "LogitLimited");
86 "params"_a = _default);
87}
Interface for parameters with values and metadata.
Definition parameter.h:58
A generic interface for physical units described by strings.
Definition unit.h:35
void declare_transform_full(py::module &m, std::string name)
Definition parameters.h:145
std::vector< T > nonconsecutive_unique(const std::vector< T > &vec)
Definition util.h:92

◆ bind_parametric()

void bind_parametric ( py::module & m)

Definition at line 38 of file parametric.cc.

38 {
39 auto _p = py::class_<g2f::Parametric, std::shared_ptr<g2f::Parametric>, lsst::gauss2d::Object>(
40 m, "Parametric");
41}
A generic object from the gauss2d library.
Definition object.h:40

◆ bind_parametricellipse()

void bind_parametricellipse ( py::module & m)

Definition at line 38 of file parametricellipse.cc.

38 {
39 auto _p = py::class_<g2f::ParametricEllipse, std::shared_ptr<g2f::ParametricEllipse>, g2f::Parametric>(
40 m, "ParametricEllipse");
41}
A parametric object that can return and filter its Parameter instances.
Definition parametric.h:13

◆ bind_parametricgaussian1d()

void bind_parametricgaussian1d ( py::module & m)

Definition at line 39 of file parametricgaussian1d.cc.

39 {
40 auto _e = py::class_<g2f::ParametricGaussian1D, std::shared_ptr<g2f::ParametricGaussian1D>,
41 lsst::gauss2d::Object>(m, "ParametricGaussian1D")
44 "mean"_a = nullptr, "stddev"_a = nullptr)
45 .def_property("mean", &g2f::ParametricGaussian1D::get_mean,
46 &g2f::ParametricGaussian1D::set_mean)
47 .def_property_readonly("mean_parameter", &g2f::ParametricGaussian1D::get_mean_parameter)
48 .def_property("stddev", &g2f::ParametricGaussian1D::get_stddev,
49 &g2f::ParametricGaussian1D::set_stddev)
50 .def_property_readonly("stddev_parameter",
51 &g2f::ParametricGaussian1D::get_stddev_parameter)
52 .def("__repr__", [](const g2f::ParametricGaussian1D &self) { return self.repr(true); })
53 .def("__str__", &g2f::ParametricGaussian1D::str);
54}

◆ bind_parametricmodel()

void bind_parametricmodel ( py::module & m)

Definition at line 38 of file parametricmodel.cc.

38 {
39 auto _p = py::class_<g2f::ParametricModel, std::shared_ptr<g2f::ParametricModel>, g2f::Parametric>(
40 m, "ParametricModel");
41}

◆ bind_prior()

void bind_prior ( py::module & m)

Definition at line 39 of file prior.cc.

39 {
40 auto _e = py::class_<g2f::PriorEvaluation, std::shared_ptr<g2f::PriorEvaluation>, lsst::gauss2d::Object>(
41 m, "PriorEvaluation")
42 .def(py::init<double, std::vector<double>,
44 "loglike"_a, "residuals"_a = std::vector<double>{},
46 .def_readonly("loglike", &g2f::PriorEvaluation::loglike)
47 .def_readonly("jacobians", &g2f::PriorEvaluation::jacobians)
48 .def_readonly("residuals", &g2f::PriorEvaluation::residuals)
49 .def("__repr__", [](const g2f::PriorEvaluation &self) { return self.repr(true); })
50 .def("__str__", &g2f::PriorEvaluation::str);
51 auto _p = py::class_<g2f::Prior, std::shared_ptr<g2f::Prior>, lsst::gauss2d::Object>(m, "Prior");
52}
Results from the evaluation of a prior probability function.
Definition prior.h:16

◆ bind_psfmodel()

void bind_psfmodel ( py::module & m)

Definition at line 40 of file psfmodel.cc.

40 {
41 auto _o = py::class_<g2f::PsfModel, std::shared_ptr<g2f::PsfModel>, g2f::ComponentMixture>(m, "PsfModel")
42 .def(py::init<g2f::Components &>(), "components"_a = nullptr)
43 .def_property_readonly("components", &g2f::PsfModel::get_components)
44 .def("gaussians",
45 [](const g2f::PsfModel &p, const g2f::Channel &c) {
47 })
48 .def("parameters", &g2f::PsfModel::get_parameters, "parameters"_a = g2f::ParamRefs(),
49 "paramfilter"_a = nullptr)
50 .def("__repr__", [](const g2f::PsfModel &self) { return self.repr(true); })
51 .def("__str__", &g2f::PsfModel::str);
52}
A list of related Component instances.
A Gaussian mixture model of a point spread function.
Definition psfmodel.h:26
std::unique_ptr< const lsst::gauss2d::Gaussians > get_gaussians(const Channel &channel=Channel::NONE()) const override
Return the vector of Gaussian sub-components controlled by this model.
Definition psfmodel.cc:50

◆ bind_sersicmix()

void bind_sersicmix ( py::module & m)

Definition at line 39 of file sersicmix.cc.

39 {
40 auto _is = py::class_<g2f::IntegralSize, std::shared_ptr<g2f::IntegralSize>, lsst::gauss2d::Object>(
41 m, "IntegralSize")
42 .def(py::init<const double, const double>(), "integral"_a = 0, "sigma"_a = 0)
43 .def_readonly("integral", &g2f::IntegralSize::integral)
44 .def_readonly("sigma", &g2f::IntegralSize::sigma)
45 .def("__repr__", [](const g2f::IntegralSize &self) { return self.repr(true); })
46 .def("__str__", &g2f::IntegralSize::str);
47
48 auto _smi = py::class_<g2f::SersicMixInterpolator, std::shared_ptr<g2f::SersicMixInterpolator>>(
49 m, "SersicMixInterpolator");
50
51 auto _smv
52 = py::class_<g2f::SersicMixValues, std::shared_ptr<g2f::SersicMixValues>, lsst::gauss2d::Object>(
53 m, "SersicMixValues")
54 .def(py::init<double, std::vector<g2f::IntegralSize>>(), "sersicindex"_a, "values"_a)
55 .def_readonly("sersicindex", &g2f::SersicMixValues::sersicindex)
56 .def_readonly("values", &g2f::SersicMixValues::values)
57 .def("__repr__", [](const g2f::SersicMixValues &self) { return self.repr(true); })
58 .def("__str__", &g2f::SersicMixValues::str);
59
60 m.def("sersic_mix_knots", &g2f::get_sersic_mix_knots_copy, "order"_a = g2f::SERSICMIX_ORDER_DEFAULT,
61 py::return_value_policy::copy);
62}
A pair of integral - size values for a Gaussian (sub)Component.
Definition sersicmix.h:19
A vector of IntegralSize values for a given Sersic index.
Definition sersicmix.h:55
std::vector< SersicMixValues > get_sersic_mix_knots_copy(unsigned short order)
Definition sersicmix.cc:68

◆ bind_sersicmixcomponent()

void bind_sersicmixcomponent ( py::module & m)

Definition at line 44 of file sersicmixcomponent.cc.

44 {
45 using T = double;
47 using Base = g2f::SersicIndexParameterD;
48
49 std::string pyclass_name = "SersicMixComponentIndexParameter" + g2f::suffix_type_str<T>();
50 declare_parameter_methods<C, C, std::shared_ptr<C>, Base>(
51 // note that Base is the actual name of the base Parameter class, not the CRTP class
52 // that it is "derived" from
53 py::class_<C, std::shared_ptr<C>, Base>(m, pyclass_name.c_str()))
54 // new properties
55 .def_property_readonly("integralratio",
56 &g2f::SersicMixComponentIndexParameterD::get_integralratio)
57 .def_property_readonly("interptype", &g2f::SersicMixComponentIndexParameterD::get_interptype)
58 .def_property_readonly("order", &g2f::SersicMixComponentIndexParameterD::get_order)
59 .def_property_readonly("sizeratio", &g2f::SersicMixComponentIndexParameterD::get_sizeratio)
60 // constructor with added arg
61 .def(py::init<T, std::shared_ptr<const parameters::Limits<T>>,
65 "value"_a = g2f::SersicMixComponentIndexParameterD::_get_default(), "limits"_a = nullptr,
66 "transform"_a = nullptr, "unit"_a = lsst::gauss2d::fit::unit_none, "fixed"_a = false,
67 "label"_a = "", "interpolator"_a = nullptr);
68
69 auto _e = py::class_<g2f::SersicMixComponent, std::shared_ptr<g2f::SersicMixComponent>,
70 g2f::EllipticalComponent>(m, "SersicMixComponent")
75 "ellipse"_a = nullptr, "centroid"_a = nullptr, "integral"_a = nullptr,
76 "sersicindex"_a = nullptr)
77 .def_property("sersicindex", &g2f::SersicMixComponent::get_sersicindex,
78 &g2f::SersicMixComponent::set_sersicindex)
79 .def_property_readonly("sersicindex_param",
80 &g2f::SersicMixComponent::get_sersicindex_param)
81 .def_property_readonly("sersicindex_param_ptr",
82 &g2f::SersicMixComponent::get_sersicindex_param_ptr)
83 .def("parameters", &g2f::SersicMixComponent::get_parameters,
84 "parameters"_a = g2f::ParamRefs(), "paramfilter"_a = nullptr)
85 .def("gaussians",
86 [](const g2f::SersicMixComponent &g, const g2f::Channel &c) {
88 })
89 .def("__repr__", [](const g2f::SersicMixComponent &self) { return self.repr(true); })
90 .def("__str__", &g2f::SersicMixComponent::str);
91}
T c_str(T... args)
A Gaussian mixture approximation to a Sersic profile Component.
std::unique_ptr< const lsst::gauss2d::Gaussians > get_gaussians(const Channel &channel) const override
Return the vector of Gaussian sub-components controlled by this model.
A SersicIndexParameter for a Gaussian mixture Component.
Range-based limits for parameter values.
Definition limits.h:45
A reversible transformation of a real scalar value.
Definition transform.h:45

◆ bind_sersicparametricellipse()

void bind_sersicparametricellipse ( py::module & m)

Definition at line 39 of file sersicparametricellipse.cc.

39 {
40 auto _e = py::class_<g2f::SersicParametricEllipse, std::shared_ptr<g2f::SersicParametricEllipse>,
41 g2f::ParametricEllipse>(m, "SersicParametricEllipse")
42 .def(py::init<double, double, double>(), "size_x"_a = 0, "size_y"_a = 0, "rho"_a = 0)
46 "size_x"_a = nullptr, "size_y"_a = nullptr, "rho"_a = nullptr)
47 .def_property("rho", &g2f::SersicParametricEllipse::get_rho,
48 &g2f::SersicParametricEllipse::set_rho)
49 .def_property("size_x", &g2f::SersicParametricEllipse::get_size_x,
50 &g2f::SersicParametricEllipse::set_size_x)
51 .def_property("size_y", &g2f::SersicParametricEllipse::get_size_y,
52 &g2f::SersicParametricEllipse::set_size_y)
53 .def_property("xyr", &g2f::SersicParametricEllipse::get_xyr,
54 &g2f::SersicParametricEllipse::set_xyr)
55 .def_property_readonly("rho_param", &g2f::SersicParametricEllipse::get_rho_param)
56 .def_property_readonly("size_x_param", &g2f::SersicParametricEllipse::get_size_x_param)
57 .def_property_readonly("size_y_param", &g2f::SersicParametricEllipse::get_size_y_param)
58 .def_property_readonly("rho_param_ptr",
59 &g2f::SersicParametricEllipse::get_rho_param_ptr)
60 .def_property_readonly("size_x_param_ptr",
61 &g2f::SersicParametricEllipse::get_size_x_param_ptr)
62 .def_property_readonly("size_y_param_ptr",
63 &g2f::SersicParametricEllipse::get_size_y_param_ptr)
64 .def("__repr__",
65 [](const g2f::SersicParametricEllipse &self) { return self.repr(true); })
66 .def("__str__", &g2f::SersicParametricEllipse::str);
67}
A ParametericEllipse with effective radius Parameters.

◆ bind_shapeprior()

void bind_shapeprior ( py::module & m)

Definition at line 41 of file shapeprior.cc.

41 {
42 auto _o = py::class_<g2f::ShapePriorOptions, std::shared_ptr<g2f::ShapePriorOptions>,
43 lsst::gauss2d::Object>(m, "ShapePriorOptions")
44 .def(py::init<double, double, double>(),
45 "delta_jacobian"_a = g2f::ShapePriorOptions::delta_jacobian_default,
46 "size_maj_floor"_a = g2f::ShapePriorOptions::size_maj_floor_default,
47 "axrat_floor"_a = g2f::ShapePriorOptions::axrat_floor_default)
48 .def("check_delta_jacobian", &g2f::ShapePriorOptions::check_delta_jacobian)
49 .def("check_size_maj_floor", &g2f::ShapePriorOptions::check_size_maj_floor)
50 .def("check_axrat_floor", &g2f::ShapePriorOptions::check_axrat_floor)
51 .def_property("delta_jacobian", &g2f::ShapePriorOptions::get_delta_jacobian,
52 &g2f::ShapePriorOptions::set_delta_jacobian)
53 .def_property("size_maj_floor", &g2f::ShapePriorOptions::get_size_maj_floor,
54 &g2f::ShapePriorOptions::set_size_maj_floor)
55 .def_property("size_maj_floor", &g2f::ShapePriorOptions::get_size_maj_floor,
56 &g2f::ShapePriorOptions::set_size_maj_floor)
57 .def("__repr__", [](const g2f::ShapePriorOptions &self) { return self.repr(true); })
58 .def("__str__", &g2f::ShapePriorOptions::str);
59
60 auto _s = py::class_<g2f::ShapePrior, std::shared_ptr<g2f::ShapePrior>, g2f::Prior>(m, "ShapePrior")
65 "ellipse"_a, "prior_size"_a = nullptr, "prior_axrat"_a = nullptr,
66 "options"_a = nullptr)
67 .def("evaluate", &g2f::ShapePrior::evaluate, "calc_jacobians"_a = false,
68 "normalize_loglike"_a = false)
69 .def_property_readonly("loglike_const_terms", &g2f::ShapePrior::get_loglike_const_terms)
70 .def_property("prior_size", &g2f::ShapePrior::get_prior_size,
71 &g2f::ShapePrior::set_prior_size)
72 .def_property("prior_axrat", &g2f::ShapePrior::get_prior_axrat,
73 &g2f::ShapePrior::set_prior_axrat)
74 .def("__len__", &g2f::ShapePrior::size)
75 .def("__repr__", [](const g2f::ShapePrior &self) { return self.repr(true); })
76 .def("__str__", &g2f::ShapePrior::str);
77}
A two-part prior on the shape of a parametric ellipse.
Definition shapeprior.h:63
Options for a ShapePrior.
Definition shapeprior.h:18

◆ bind_source()

void bind_source ( py::module & m)

Definition at line 39 of file source.cc.

39 {
40 auto _s = py::class_<g2f::Source, std::shared_ptr<g2f::Source>, g2f::ComponentMixture>(m, "Source")
41 .def(py::init<g2f::Components &>(), "components"_a = nullptr)
42 .def_property_readonly("components", &g2f::Source::get_components)
43 .def("gaussians",
44 [](const g2f::Source &g, const g2f::Channel &c) {
46 })
47 .def("parameters", &g2f::Source::get_parameters, "parameters"_a = g2f::ParamRefs(),
48 "paramfilter"_a = nullptr)
49 .def("__repr__", [](const g2f::Source &self) { return self.repr(true); })
50 .def("__str__", &g2f::Source::str);
51}
An association of physically-related Component instances.
Definition source.h:22
std::unique_ptr< const lsst::gauss2d::Gaussians > get_gaussians(const Channel &channel) const override
Return the vector of Gaussian sub-components controlled by this model.
Definition source.cc:39