1#ifndef LSST_GAUSS2D_FIT_SERSICMIXCOMPONENT_H
2#define LSST_GAUSS2D_FIT_SERSICMIXCOMPONENT_H
4#include "lsst/modelfit/parameters.h"
7#include "ellipticalcomponent.h"
8#include "integralmodel.h"
10#include "param_filter.h"
12#include "sersicparametricellipse.h"
14namespace lsst::gauss2d::fit {
22 double value = _get_default(), std::shared_ptr<
const parameters::Limits<double>> limits =
nullptr,
23 std::shared_ptr<
const parameters::Transform<double>> transform =
nullptr,
24 std::shared_ptr<const parameters::Unit> unit =
nullptr,
bool fixed =
false,
25 std::string label =
"", std::shared_ptr<const SersicMixInterpolator> interpolator =
nullptr);
31 static std::shared_ptr<const SersicMixInterpolator> get_interpolator_default(
unsigned short order
32 = SERSICMIX_ORDER_DEFAULT);
33 const parameters::Limits<double>& get_limits_maximal()
const override;
34 double get_min()
const override {
return 0.5; }
35 double get_max()
const override {
return 8.0; }
41 InterpType get_interptype()
const;
42 unsigned short get_order()
const;
44 void set_value(
double value)
override;
45 void set_value_transformed(
double value_transformed)
override;
48 std::vector<IntegralSize> _integralsizes;
49 std::vector<IntegralSize> _integralsizes_derivs;
50 const std::shared_ptr<const SersicMixInterpolator> _interpolator;
53 void _set_ratios(
double sersicindex);
64 : _ellipsedata(std::move(ellipse)) {
65 if (_ellipsedata ==
nullptr) _ellipsedata = std::make_shared<SersicParametricEllipse>();
67 std::shared_ptr<SersicParametricEllipse> _ellipsedata;
87 explicit SersicMixComponent(std::shared_ptr<SersicParametricEllipse> ellipse =
nullptr,
88 std::shared_ptr<CentroidParameters> centroid =
nullptr,
89 std::shared_ptr<IntegralModel> integralmodel =
nullptr,
90 std::shared_ptr<SersicMixComponentIndexParameterD> sersicindex =
nullptr);
91 ~SersicMixComponent();
94 ParameterMap& offsets)
const override;
99 std::unique_ptr<const lsst::gauss2d::Gaussians>
get_gaussians(
const Channel& channel)
const override;
105 double get_sersicindex()
const;
108 std::shared_ptr<SersicMixComponentIndexParameterD> get_sersicindex_param_ptr();
110 static const size_t N_PARAMS = N_PARAMS_GAUSS2D + 1;
113 size_t index)
const override;
115 size_t index)
const override;
116 void set_sersicindex(
double value);
118 std::string repr(
bool name_keywords =
false,
119 std::string_view namespace_separator = Object::CC_NAMESPACE_SEPARATOR)
const override;
120 std::string str()
const override;
124 std::shared_ptr<SersicMixComponentIndexParameterD> _sersicindex;
125 std::map<std::reference_wrapper<const Channel>, std::vector<std::unique_ptr<SersicMixGaussianComponent>>>
An observational channel, usually representing some range of wavelengths of light.
Definition channel.h:29
EllipticalComponent(std::shared_ptr< ParametricEllipse > ellipse, std::shared_ptr< CentroidParameters > centroid=nullptr, std::shared_ptr< IntegralModel > integralmodel=nullptr)
Definition ellipticalcomponent.cc:13
Definition sersicmixcomponent.h:18
double get_sizeratio(unsigned short index) const
Return the size ratio for a given Gaussian sub-component index.
Definition sersicmixcomponent.cc:212
double get_integralratio_deriv(unsigned short index) const
Return the integral ratio derivative for a given Gaussian sub-component index.
Definition sersicmixcomponent.cc:199
SersicMixComponentIndexParameterD(double value=_get_default(), std::shared_ptr< const parameters::Limits< double > > limits=nullptr, std::shared_ptr< const parameters::Transform< double > > transform=nullptr, std::shared_ptr< const parameters::Unit > unit=nullptr, bool fixed=false, std::string label="", std::shared_ptr< const SersicMixInterpolator > interpolator=nullptr)
See docs for Parameter.
Definition sersicmixcomponent.cc:239
double get_integralratio(unsigned short index) const
Return the integral ratio for a given Gaussian sub-component index.
Definition sersicmixcomponent.cc:191
double get_sizeratio_deriv(unsigned short index) const
Return the size ratio derivative for a given Gaussian sub-component index.
Definition sersicmixcomponent.cc:220
Definition sersicmixcomponent.cc:161
void set_extra_param_factors(const Channel &channel, ExtraParamFactors &factors, size_t index) const override
Definition sersicmixcomponent.cc:419
std::unique_ptr< const lsst::gauss2d::Gaussians > get_gaussians(const Channel &channel) const override
Definition sersicmixcomponent.cc:381
void set_grad_param_factors(const Channel &channel, GradParamFactors &factors, size_t index) const override
Definition sersicmixcomponent.cc:444
void add_extra_param_map(const Channel &channel, ExtraParamMap &map_extra, const GradParamMap &map_grad, ParameterMap &offsets) const override
Definition sersicmixcomponent.cc:295
ParamRefs & get_parameters(ParamRefs ¶ms, ParamFilter *filter=nullptr) const override
Definition sersicmixcomponent.cc:397
void add_extra_param_factors(const Channel &channel, ExtraParamFactors &factors) const override
Definition sersicmixcomponent.cc:320
ParamCRefs & get_parameters_const(ParamCRefs ¶ms, ParamFilter *filter=nullptr) const override
Same as get_parameters(), but for const refs.
Definition sersicmixcomponent.cc:403
void add_grad_param_map(const Channel &channel, GradParamMap &map, ParameterMap &offsets) const override
Definition sersicmixcomponent.cc:326
void add_grad_param_factors(const Channel &channel, GradParamFactors &factor) const override
Definition sersicmixcomponent.cc:364
size_t get_n_gaussians(const Channel &channel) const override
Return the number of Gaussian sub-components controlled by this model.
Definition sersicmixcomponent.cc:393
SersicParametricEllipseHolder(std::shared_ptr< SersicParametricEllipse > ellipse=nullptr)
This constructor does not need to be called by users.
Definition sersicmixcomponent.h:63
Definition param_filter.h:17
Definition parameters.h:128