37 lines
1.2 KiB
C++
37 lines
1.2 KiB
C++
// Copyright (2019-2022) Paul Scherrer Institute
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
#ifndef JUNGFRAUJOCH_RADIALINTEGRATION_H
|
|
#define JUNGFRAUJOCH_RADIALINTEGRATION_H
|
|
|
|
#include <vector>
|
|
#include <cstdint>
|
|
#include <cmath>
|
|
|
|
#include "../common/DiffractionExperiment.h"
|
|
#include "RadialIntegrationMapping.h"
|
|
|
|
class RadialIntegration {
|
|
const std::vector<uint16_t> pixel_to_bin;
|
|
float *coeff;
|
|
const uint32_t nbins;
|
|
const uint32_t pixel_split;
|
|
std::vector<float> sum;
|
|
std::vector<float> count;
|
|
public:
|
|
RadialIntegration(const RadialIntegrationMapping& mapping, uint32_t pixel_split = 1);
|
|
RadialIntegration(const std::vector<uint16_t>& mapping, uint32_t nbins, uint32_t pixel_split = 1);
|
|
~RadialIntegration();
|
|
void Clear();
|
|
void Process(const int16_t *data, size_t npixel);
|
|
void ProcessOneImage(const int16_t *data, size_t npixel); // Process + Clear
|
|
void GetResult(std::vector<float> &result) const;
|
|
void LoadRadialIntegrationCorr(const std::vector<float> &v);
|
|
[[nodiscard]] float GetRangeValue(uint32_t min_bin, uint32_t max_bin);
|
|
[[nodiscard]] const std::vector<float>& GetSum() const;
|
|
[[nodiscard]] const std::vector<float>& GetCount() const;
|
|
};
|
|
|
|
|
|
#endif //JUNGFRAUJOCH_RADIALINTEGRATION_H
|