Updates March 2023
This commit is contained in:
@@ -473,6 +473,40 @@ TEST_CASE("RawToConvertedGeometry_Gaps","[RawToConvertedGeometry]") {
|
||||
free(input2);
|
||||
}
|
||||
|
||||
TEST_CASE("RawToConvertedGeometry_Vertical","[RawToConvertedGeometry]") {
|
||||
std::vector<DetectorModuleGeometry> module_geom;
|
||||
|
||||
REQUIRE_NOTHROW(module_geom.emplace_back(2999, 2999, DetectorModuleGeometry::Direction::Xneg,
|
||||
DetectorModuleGeometry::Direction::Yneg));
|
||||
|
||||
REQUIRE_NOTHROW(module_geom.emplace_back(0, 0, DetectorModuleGeometry::Direction::Ypos,
|
||||
DetectorModuleGeometry::Direction::Xpos));
|
||||
|
||||
REQUIRE_NOTHROW(module_geom.emplace_back(5000, 0, DetectorModuleGeometry::Direction::Ypos,
|
||||
DetectorModuleGeometry::Direction::Xpos));
|
||||
|
||||
DetectorGeometry geometry(module_geom);
|
||||
DiffractionExperiment x(geometry);
|
||||
x.DataStreams(3);
|
||||
|
||||
x.Mode(DetectorMode::Conversion);
|
||||
std::vector<uint32_t> input(x.GetModulesNum() * RAW_MODULE_SIZE);
|
||||
std::vector<uint32_t> input2(x.GetModulesNum() * RAW_MODULE_SIZE);
|
||||
std::vector<uint32_t> output(x.GetPixelsNum(), UINT32_MAX);
|
||||
|
||||
for (uint32_t i = 0; i < x.GetModulesNum() * RAW_MODULE_SIZE; i++)
|
||||
input[i] = 3*i-1;
|
||||
|
||||
RawToConvertedGeometry<uint32_t, uint32_t>(x, output.data(), input.data());
|
||||
ConvertedToRawGeometry<uint32_t>(x, input2.data(), output.data());
|
||||
|
||||
uint64_t diff = 0;
|
||||
for (int i = 0; i < x.GetModulesNum(2) * RAW_MODULE_SIZE; i++) {
|
||||
if (input[i] != input2[i]) diff++;
|
||||
}
|
||||
REQUIRE(diff == 0);
|
||||
}
|
||||
|
||||
TEST_CASE("RawToConvertedCoordinate","[RawToConvertedGeometry]") {
|
||||
DiffractionExperiment experiment(DetectorGeometry(4, 2, 8, 36, true));
|
||||
auto [x,y] = RawToConvertedCoordinate(experiment, 1, 300 * RAW_MODULE_COLS + 800);
|
||||
|
||||
Reference in New Issue
Block a user