mirror of
https://github.com/slsdetectorgroup/aare.git
synced 2025-06-21 03:07:59 +02:00
Custom base for decoding ADC data (#163)
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>
This commit is contained in:
@ -190,4 +190,16 @@ TEST_CASE("compare two views") {
|
||||
NDView<int, 2> view2(vec2.data(), Shape<2>{3, 4});
|
||||
|
||||
REQUIRE((view1 == view2));
|
||||
}
|
||||
|
||||
|
||||
TEST_CASE("Create a view over a vector"){
|
||||
std::vector<int> vec;
|
||||
for (int i = 0; i != 12; ++i) {
|
||||
vec.push_back(i);
|
||||
}
|
||||
auto v = aare::make_view(vec);
|
||||
REQUIRE(v.shape()[0] == 12);
|
||||
REQUIRE(v[0] == 0);
|
||||
REQUIRE(v[11] == 11);
|
||||
}
|
Reference in New Issue
Block a user