Go to the documentation of this file.
12 #ifndef RTCTK_EXAMPLEDATATASK_MEASURETEL_COMPUTATION_HPP
13 #define RTCTK_EXAMPLEDATATASK_MEASURETEL_COMPUTATION_HPP
28 constexpr
size_t NUM_SLOPES =
30 m_result.resize(NUM_SLOPES);
40 m_samples.resize(to_read);
42 m_samples_to_read = to_read;
47 m_samples[m_sample_idx++] = sample.
wfs.
slopes;
57 if (m_sample_idx != m_samples_to_read) {
58 CII_THROW(RtctkException,
"not all data available");
64 CII_THROW(RtctkException,
"algorithm not implemented");
72 for (
auto& slope : m_result) {
76 for (
auto const& sample : m_samples) {
78 for (
auto const& slope : sample) {
79 m_result[idx++] += slope;
83 for (
auto& slope : m_result) {
84 slope = slope / m_samples.size();
89 unsigned m_sample_idx;
90 unsigned m_samples_to_read;
92 std::vector<float> m_result;
95 #endif // RTCTK_EXAMPLEDATATASK_MEASURETEL_COMPUTATION_HPP
void Reset()
Definition: computation.hpp:79
WfsLoopBaseTopic< N_SUBAPS > wfs
Definition: topics.hpp:29
Provides macros and utilities for exception handling.
void SetDynamicConfig(unsigned to_read)
Definition: computation.hpp:38
The RtctkException class is the base class for all Rtctk exceptions.
Definition: exceptions.hpp:207
Definition: computation.hpp:97
std::array< float, 2 *NSUBAPS > slopes
Definition: topics.hpp:23
void OnDataAvailable(ScaoLoopTopic const &sample)
Definition: computation.hpp:46
Definition: topics.hpp:27
Algorithm
Definition: computation.hpp:24
slopes
Definition: rtctkExampleDataTaskGenFitsData.py:9
void ComputeMean()
Definition: computation.hpp:71
Definition: computation.hpp:28
Result Compute(Algorithm algorithm)
Definition: computation.hpp:54
std::vector< float > const & avg_values
Definition: computation.hpp:51
Computation()
Definition: computation.hpp:26
Common topic definitions used in various examples.