mirror of
https://github.com/slsdetectorgroup/aare.git
synced 2025-06-14 16:27:14 +02:00

New function apply_custom_weights (can we find a better name) that takes a uint16 and a NDView<double,1> of bases for the conversion. For each supplied weight it is used as base (instead of 2) to convert from bits to a double. --------- Co-authored-by: siebsi <sieb.patr@gmail.com>
27 lines
882 B
C++
27 lines
882 B
C++
#pragma once
|
|
|
|
#include <cstdint>
|
|
#include <vector>
|
|
#include <aare/NDView.hpp>
|
|
namespace aare {
|
|
|
|
|
|
uint16_t adc_sar_05_decode64to16(uint64_t input);
|
|
uint16_t adc_sar_04_decode64to16(uint64_t input);
|
|
void adc_sar_05_decode64to16(NDView<uint64_t, 2> input, NDView<uint16_t,2> output);
|
|
void adc_sar_04_decode64to16(NDView<uint64_t, 2> input, NDView<uint16_t,2> output);
|
|
|
|
|
|
/**
|
|
* @brief Apply custom weights to a 16-bit input value. Will sum up weights[i]**i
|
|
* for each bit i that is set in the input value.
|
|
* @throws std::out_of_range if weights.size() < 16
|
|
* @param input 16-bit input value
|
|
* @param weights vector of weights, size must be less than or equal to 16
|
|
*/
|
|
double apply_custom_weights(uint16_t input, const NDView<double, 1> weights);
|
|
|
|
void apply_custom_weights(NDView<uint16_t, 1> input, NDView<double, 1> output, const NDView<double, 1> weights);
|
|
|
|
} // namespace aare
|