LSST Applications g0f08755f38+82efc23009,g12f32b3c4e+e7bdf1200e,g1653933729+a8ce1bb630,g1a0ca8cf93+50eff2b06f,g28da252d5a+52db39f6a5,g2bbee38e9b+37c5a29d61,g2bc492864f+37c5a29d61,g2cdde0e794+c05ff076ad,g3156d2b45e+41e33cbcdc,g347aa1857d+37c5a29d61,g35bb328faa+a8ce1bb630,g3a166c0a6a+37c5a29d61,g3e281a1b8c+fb992f5633,g414038480c+7f03dfc1b0,g41af890bb2+11b950c980,g5fbc88fb19+17cd334064,g6b1c1869cb+12dd639c9a,g781aacb6e4+a8ce1bb630,g80478fca09+72e9651da0,g82479be7b0+04c31367b4,g858d7b2824+82efc23009,g9125e01d80+a8ce1bb630,g9726552aa6+8047e3811d,ga5288a1d22+e532dc0a0b,gae0086650b+a8ce1bb630,gb58c049af0+d64f4d3760,gc28159a63d+37c5a29d61,gcf0d15dbbd+2acd6d4d48,gd7358e8bfb+778a810b6e,gda3e153d99+82efc23009,gda6a2b7d83+2acd6d4d48,gdaeeff99f8+1711a396fd,ge2409df99d+6b12de1076,ge79ae78c31+37c5a29d61,gf0baf85859+d0a5978c5a,gf3967379c6+4954f8c433,gfb92a5be7c+82efc23009,gfec2e1e490+2aaed99252,w.2024.46
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