LSST Applications g063fba187b+cac8b7c890,g0f08755f38+6aee506743,g1653933729+a8ce1bb630,g168dd56ebc+a8ce1bb630,g1a2382251a+b4475c5878,g1dcb35cd9c+8f9bc1652e,g20f6ffc8e0+6aee506743,g217e2c1bcf+73dee94bd0,g28da252d5a+1f19c529b9,g2bbee38e9b+3f2625acfc,g2bc492864f+3f2625acfc,g3156d2b45e+6e55a43351,g32e5bea42b+1bb94961c2,g347aa1857d+3f2625acfc,g35bb328faa+a8ce1bb630,g3a166c0a6a+3f2625acfc,g3e281a1b8c+c5dd892a6c,g3e8969e208+a8ce1bb630,g414038480c+5927e1bc1e,g41af890bb2+8a9e676b2a,g7af13505b9+809c143d88,g80478fca09+6ef8b1810f,g82479be7b0+f568feb641,g858d7b2824+6aee506743,g89c8672015+f4add4ffd5,g9125e01d80+a8ce1bb630,ga5288a1d22+2903d499ea,gb58c049af0+d64f4d3760,gc28159a63d+3f2625acfc,gcab2d0539d+b12535109e,gcf0d15dbbd+46a3f46ba9,gda6a2b7d83+46a3f46ba9,gdaeeff99f8+1711a396fd,ge79ae78c31+3f2625acfc,gef2f8181fd+0a71e47438,gf0baf85859+c1f95f4921,gfa517265be+6aee506743,gfa999e8aa5+17cd334064,w.2024.51
LSST Data Management Base Package
Loading...
Searching...
No Matches
sersicmixcomponent.h
Go to the documentation of this file.
1#ifndef LSST_GAUSS2D_FIT_SERSICMIXCOMPONENT_H
2#define LSST_GAUSS2D_FIT_SERSICMIXCOMPONENT_H
3
5
6#include "channel.h"
8#include "integralmodel.h"
9#include "param_defs.h"
10#include "param_filter.h"
11#include "sersicmix.h"
13
14namespace lsst::gauss2d::fit {
19public:
22 double value = _get_default(), std::shared_ptr<const parameters::Limits<double>> limits = nullptr,
24 std::shared_ptr<const parameters::Unit> unit = nullptr, bool fixed = false,
25 std::string label = "", std::shared_ptr<const SersicMixInterpolator> interpolator = nullptr);
26
28 double get_integralratio(unsigned short index) const;
30 double get_integralratio_deriv(unsigned short index) const;
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; }
37 double get_sizeratio(unsigned short index) const;
39 double get_sizeratio_deriv(unsigned short index) const;
40
42 unsigned short get_order() const;
43
44 void set_value(double value) override;
45 void set_value_transformed(double value_transformed) override;
46
47private:
48 std::vector<IntegralSize> _integralsizes;
49 std::vector<IntegralSize> _integralsizes_derivs;
51
53 void _set_ratios(double sersicindex);
54};
55
56// TODO: Revisit the necessity of this class
61public:
64 : _ellipsedata(std::move(ellipse)) {
65 if (_ellipsedata == nullptr) _ellipsedata = std::make_shared<SersicParametricEllipse>();
66 }
68};
69
70// TODO: Add ref to derivation of weights, when published
86public:
88 std::shared_ptr<CentroidParameters> centroid = nullptr,
89 std::shared_ptr<IntegralModel> integralmodel = nullptr,
92
93 void add_extra_param_map(const Channel& channel, ExtraParamMap& map_extra, const GradParamMap& map_grad,
94 ParameterMap& offsets) const override;
95 void add_extra_param_factors(const Channel& channel, ExtraParamFactors& factors) const override;
96 void add_grad_param_map(const Channel& channel, GradParamMap& map, ParameterMap& offsets) const override;
97 void add_grad_param_factors(const Channel& channel, GradParamFactors& factor) const override;
98
100 size_t get_n_gaussians(const Channel& channel) const override;
101
102 ParamRefs& get_parameters(ParamRefs& params, ParamFilter* filter = nullptr) const override;
103 ParamCRefs& get_parameters_const(ParamCRefs& params, ParamFilter* filter = nullptr) const override;
104
105 double get_sersicindex() const;
106
109
110 static const size_t N_PARAMS = N_PARAMS_GAUSS2D + 1;
111
112 void set_extra_param_factors(const Channel& channel, ExtraParamFactors& factors,
113 size_t index) const override;
114 void set_grad_param_factors(const Channel& channel, GradParamFactors& factors,
115 size_t index) const override;
116 void set_sersicindex(double value);
117
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;
121
122private:
126 _gaussians;
127};
128} // namespace lsst::gauss2d::fit
129
130#endif
table::Key< int > transform
static constexpr std::string_view CC_NAMESPACE_SEPARATOR
The C++ namespace separator.
Definition object.h:45
An observational channel, usually representing some range of wavelengths of light.
Definition channel.h:29
A Component with an elliptically-symmetric intensity profile.
A Gaussian mixture approximation to a Sersic profile Component.
void set_extra_param_factors(const Channel &channel, ExtraParamFactors &factors, size_t index) const override
Set extra Parameter gradient factors in an existing map.
std::string str() const override
Return a brief, human-readable string representation of this.
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.
void set_grad_param_factors(const Channel &channel, GradParamFactors &factors, size_t index) const override
Set Parameter gradient factors in an existing map.
void add_extra_param_map(const Channel &channel, ExtraParamMap &map_extra, const GradParamMap &map_grad, ParameterMap &offsets) const override
Add extra Parameter indices to a map.
std::string repr(bool name_keywords=false, std::string_view namespace_separator=Object::CC_NAMESPACE_SEPARATOR) const override
Return a full, callable string representation of this.
ParamRefs & get_parameters(ParamRefs &params, ParamFilter *filter=nullptr) const override
Add Parameter refs matching the filter to a vector, in order.
SersicMixComponentIndexParameterD & get_sersicindex_param() const
std::shared_ptr< SersicMixComponentIndexParameterD > get_sersicindex_param_ptr()
SersicMixComponent(std::shared_ptr< SersicParametricEllipse > ellipse=nullptr, std::shared_ptr< CentroidParameters > centroid=nullptr, std::shared_ptr< IntegralModel > integralmodel=nullptr, std::shared_ptr< SersicMixComponentIndexParameterD > sersicindex=nullptr)
void add_extra_param_factors(const Channel &channel, ExtraParamFactors &factors) const override
Add extra Parameter gradient factors to an existing vector.
ParamCRefs & get_parameters_const(ParamCRefs &params, ParamFilter *filter=nullptr) const override
Same as get_parameters(), but for const refs.
void add_grad_param_map(const Channel &channel, GradParamMap &map, ParameterMap &offsets) const override
Add Parameter gradient indices to an existing map.
void add_grad_param_factors(const Channel &channel, GradParamFactors &factor) const override
Add Parameter gradient factors to an existing map.
size_t get_n_gaussians(const Channel &channel) const override
Return the number of Gaussian sub-components controlled by this model.
A SersicIndexParameter for a Gaussian mixture Component.
double get_sizeratio(unsigned short index) const
Return the size ratio for a given Gaussian sub-component index.
double get_min() const override
Return the minimum value for this parameter instance.
double get_integralratio_deriv(unsigned short index) const
Return the integral ratio derivative for a given Gaussian sub-component index.
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.
const parameters::Limits< double > & get_limits_maximal() const override
Return limits representing the maximum/minimum untransformed value.
double get_integralratio(unsigned short index) const
Return the integral ratio for a given Gaussian sub-component index.
double get_max() const override
Return the maximum value for this parameter instance.
void set_value_transformed(double value_transformed) override
static std::shared_ptr< const SersicMixInterpolator > get_interpolator_default(unsigned short order=SERSICMIX_ORDER_DEFAULT)
double get_sizeratio_deriv(unsigned short index) const
Return the size ratio derivative for a given Gaussian sub-component index.
A workaround class to store a SersicParametricEllipse.
SersicParametricEllipseHolder(std::shared_ptr< SersicParametricEllipse > ellipse=nullptr)
This constructor does not need to be called by users.
std::shared_ptr< SersicParametricEllipse > _ellipsedata
Range-based limits for parameter values.
Definition limits.h:45
static constexpr T _get_default()
Get the default value for the derived type of this.
Definition parameter.h:212
A reversible transformation of a real scalar value.
Definition transform.h:45
const size_t N_PARAMS_GAUSS2D
Definition evaluate.h:61
STL namespace.
Options for filtering Parameter instances.
table::Key< int > order