SourceXtractorPlusPlus 0.21
SourceXtractor++, the next generation SExtractor
Loading...
Searching...
No Matches
GrowthCurveResampledTask.cpp
Go to the documentation of this file.
1
18#include <MathUtils/interpolation/interpolation.h>
19
23
24using namespace Euclid::MathUtils;
25using namespace Euclid::NdArray;
26
27namespace SourceXtractor {
28
31
35
36 for (size_t i = 0; i < m_instances.size(); ++i) {
37 auto& growth_curve_prop = source.getProperty<GrowthCurve>(m_instances[i]);
38 auto& growth_curve = growth_curve_prop.getCurve();
39 auto step_size = growth_curve_prop.getStepSize();
42
44 for (size_t s = 0; s < steps.size(); ++s) {
45 steps[s] = (s + 1) * step_size;
46 }
47
48 auto interpolated = interpolate(steps, growth_curve, InterpolationType::LINEAR, true);
49 for (size_t s = 0; s < m_nsamples; ++s) {
50 data.at(i, s) = (*interpolated)((s + 1) * new_step_size);
51 }
52 }
54}
55
56} // end of namespace SourceXtractor
void computeProperties(SourceInterface &source) const override
Computes one or more properties for the Source.
GrowthCurveResampledTask(const std::vector< unsigned > &instances, size_t nsamples)
The SourceInterface is an abstract "source" that has properties attached to it.
T move(T... args)
ELEMENTS_API std::unique_ptr< Function > interpolate(const std::vector< double > &x, const std::vector< double > &y, InterpolationType type, bool extrapolate=false)
T size(T... args)