v1.0.0-rc.141 (#51)
Build Packages / build:rpm (rocky8_nocuda) (push) Successful in 9m32s
Build Packages / build:rpm (ubuntu2404_nocuda) (push) Successful in 10m19s
Build Packages / build:rpm (ubuntu2204_nocuda) (push) Successful in 11m49s
Build Packages / build:rpm (rocky9_nocuda) (push) Successful in 12m37s
Build Packages / build:rpm (rocky8_sls9) (push) Successful in 12m23s
Build Packages / build:rpm (rocky9_sls9) (push) Successful in 11m44s
Build Packages / build:rpm (rocky8) (push) Successful in 9m15s
Build Packages / build:rpm (rocky9) (push) Successful in 12m14s
Build Packages / build:rpm (ubuntu2204) (push) Successful in 11m28s
Build Packages / Generate python client (push) Successful in 21s
Build Packages / XDS test (durin plugin) (push) Successful in 8m58s
Build Packages / build:rpm (ubuntu2404) (push) Successful in 12m7s
Build Packages / Build documentation (push) Successful in 42s
Build Packages / Create release (push) Has been skipped
Build Packages / XDS test (JFJoch plugin) (push) Successful in 8m24s
Build Packages / DIALS test (push) Successful in 14m1s
Build Packages / XDS test (neggia plugin) (push) Successful in 7m26s
Build Packages / Unit tests (push) Failing after 1h20m14s
Build Packages / build:rpm (rocky8_nocuda) (push) Successful in 9m32s
Build Packages / build:rpm (ubuntu2404_nocuda) (push) Successful in 10m19s
Build Packages / build:rpm (ubuntu2204_nocuda) (push) Successful in 11m49s
Build Packages / build:rpm (rocky9_nocuda) (push) Successful in 12m37s
Build Packages / build:rpm (rocky8_sls9) (push) Successful in 12m23s
Build Packages / build:rpm (rocky9_sls9) (push) Successful in 11m44s
Build Packages / build:rpm (rocky8) (push) Successful in 9m15s
Build Packages / build:rpm (rocky9) (push) Successful in 12m14s
Build Packages / build:rpm (ubuntu2204) (push) Successful in 11m28s
Build Packages / Generate python client (push) Successful in 21s
Build Packages / XDS test (durin plugin) (push) Successful in 8m58s
Build Packages / build:rpm (ubuntu2404) (push) Successful in 12m7s
Build Packages / Build documentation (push) Successful in 42s
Build Packages / Create release (push) Has been skipped
Build Packages / XDS test (JFJoch plugin) (push) Successful in 8m24s
Build Packages / DIALS test (push) Successful in 14m1s
Build Packages / XDS test (neggia plugin) (push) Successful in 7m26s
Build Packages / Unit tests (push) Failing after 1h20m14s
This is an UNSTABLE release. The release has significant modifications and bug fixes, if things go wrong, it is better to revert to 1.0.0-rc.132. * jfjoch_broker: Azimuthal integration mapping is generated with parallel computations, significantly reducing setup times * frontend: Fix selection of FFTW in indexing settings Reviewed-on: #51 Co-authored-by: Filip Leonarski <filip.leonarski@psi.ch> Co-committed-by: Filip Leonarski <filip.leonarski@psi.ch>
This commit was merged in pull request #51.
This commit is contained in:
@@ -4,19 +4,19 @@
|
||||
#include <catch2/catch_all.hpp>
|
||||
|
||||
#include "../common/AzimuthalIntegrationProfile.h"
|
||||
#include "../common/AzimuthalIntegration.h"
|
||||
#include "../common/AzimuthalIntegrationMapping.h"
|
||||
|
||||
TEST_CASE("AzimuthalIntegrationMapping_Constructor","[AzimuthalIntegration]") {
|
||||
DiffractionExperiment x(DetJF4M());
|
||||
|
||||
REQUIRE(x.GetPixelsNum() == 2164*2068);
|
||||
|
||||
std::unique_ptr<AzimuthalIntegration> radial;
|
||||
std::unique_ptr<AzimuthalIntegrationMapping> radial;
|
||||
|
||||
x.QSpacingForAzimInt_recipA(0.1).QRangeForAzimInt_recipA(0.1, 5);
|
||||
|
||||
PixelMask pixel_mask(x);
|
||||
REQUIRE_NOTHROW(radial = std::make_unique<AzimuthalIntegration>(x, pixel_mask));
|
||||
REQUIRE_NOTHROW(radial = std::make_unique<AzimuthalIntegrationMapping>(x, pixel_mask));
|
||||
}
|
||||
|
||||
TEST_CASE("AzimuthalIntegrationMapping_GetBinNumber","[AzimuthalIntegration]") {
|
||||
@@ -25,7 +25,7 @@ TEST_CASE("AzimuthalIntegrationMapping_GetBinNumber","[AzimuthalIntegration]") {
|
||||
x.QSpacingForAzimInt_recipA(0.1).QRangeForAzimInt_recipA(0.1, 4);
|
||||
|
||||
PixelMask pixel_mask(x);
|
||||
AzimuthalIntegration mapping(x, pixel_mask);
|
||||
AzimuthalIntegrationMapping mapping(x, pixel_mask);
|
||||
REQUIRE(mapping.GetBinNumber() == 39);
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ TEST_CASE("AzimuthalIntegrationMapping_GetBinNumber_mask","[AzimuthalIntegration
|
||||
|
||||
PixelMask pixel_mask_obj(x);
|
||||
pixel_mask_obj.LoadUserMask(x, pixel_mask);
|
||||
AzimuthalIntegration mapping(x, pixel_mask_obj);
|
||||
AzimuthalIntegrationMapping mapping(x, pixel_mask_obj);
|
||||
REQUIRE(mapping.GetBinNumber() == 89);
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ TEST_CASE("AzimuthalIntegrationMapping_GetBinNumber_DetectorLimit","[AzimuthalIn
|
||||
|
||||
x.QSpacingForAzimInt_recipA(0.1).QRangeForAzimInt_recipA(0.1, 9.9);
|
||||
PixelMask pixel_mask(x);
|
||||
AzimuthalIntegration mapping(x, pixel_mask);
|
||||
AzimuthalIntegrationMapping mapping(x, pixel_mask);
|
||||
|
||||
REQUIRE(mapping.GetBinNumber() == 98);
|
||||
}
|
||||
@@ -68,7 +68,7 @@ TEST_CASE("AzimuthalIntegrationMapping_GetBinToQ","[AzimuthalIntegration]") {
|
||||
x.QSpacingForAzimInt_recipA(0.1).QRangeForAzimInt_recipA(0.1, 4);
|
||||
|
||||
PixelMask pixel_mask(x);
|
||||
AzimuthalIntegration mapping(x, pixel_mask);
|
||||
AzimuthalIntegrationMapping mapping(x, pixel_mask);
|
||||
|
||||
auto bin_to_q = mapping.GetBinToQ();
|
||||
|
||||
@@ -89,7 +89,7 @@ TEST_CASE("AzimuthalIntegrationMapping_GetBinToPhi","[AzimuthalIntegration]") {
|
||||
x.ImportAzimuthalIntegrationSettings(settings);
|
||||
|
||||
PixelMask pixel_mask(x);
|
||||
AzimuthalIntegration mapping(x, pixel_mask);
|
||||
AzimuthalIntegrationMapping mapping(x, pixel_mask);
|
||||
|
||||
auto &bin_to_q = mapping.GetBinToQ();
|
||||
|
||||
@@ -134,7 +134,7 @@ TEST_CASE("AzimuthalIntegrationMapping_GetMapping","[AzimuthalIntegration]") {
|
||||
x.ImportAzimuthalIntegrationSettings(settings);
|
||||
|
||||
PixelMask pixel_mask(x);
|
||||
AzimuthalIntegration mapping(x, pixel_mask);
|
||||
AzimuthalIntegrationMapping mapping(x, pixel_mask);
|
||||
|
||||
auto map = mapping.GetPixelToBin();
|
||||
|
||||
@@ -153,7 +153,7 @@ TEST_CASE("AzimuthalIntegrationMapping_QToBin","[AzimuthalIntegration]") {
|
||||
x.QSpacingForAzimInt_recipA(0.1).QRangeForAzimInt_recipA(0.1, 4);
|
||||
|
||||
PixelMask pixel_mask(x);
|
||||
AzimuthalIntegration mapping(x, pixel_mask);
|
||||
AzimuthalIntegrationMapping mapping(x, pixel_mask);
|
||||
|
||||
REQUIRE(mapping.QToBin(0.0) == 0);
|
||||
REQUIRE(std::floor(mapping.QToBin(0.200001)) == 1);
|
||||
@@ -167,7 +167,7 @@ TEST_CASE("AzimuthalIntegrationProfile","[AzimuthalIntegration]") {
|
||||
x.QSpacingForAzimInt_recipA(0.1).QRangeForAzimInt_recipA(0.1, 4);
|
||||
|
||||
PixelMask pixel_mask(x);
|
||||
AzimuthalIntegration mapping(x, pixel_mask);
|
||||
AzimuthalIntegrationMapping mapping(x, pixel_mask);
|
||||
|
||||
AzimuthalIntegrationProfile profile(mapping);
|
||||
|
||||
@@ -204,7 +204,7 @@ TEST_CASE("AzimuthalIntegrationProfile_operatorAdd","[AzimuthalIntegration]") {
|
||||
x.QSpacingForAzimInt_recipA(0.1).QRangeForAzimInt_recipA(0.1, 4);
|
||||
|
||||
PixelMask pixel_mask(x);
|
||||
AzimuthalIntegration mapping(x, pixel_mask);
|
||||
AzimuthalIntegrationMapping mapping(x, pixel_mask);
|
||||
|
||||
AzimuthalIntegrationProfile profile0(mapping), profile1(mapping);
|
||||
|
||||
@@ -235,7 +235,7 @@ TEST_CASE("AzimuthalIntegrationProfile_GetMeanValueOfBins","[AzimuthalIntegratio
|
||||
x.QSpacingForAzimInt_recipA(0.1).QRangeForAzimInt_recipA(0.1, 4);
|
||||
|
||||
PixelMask pixel_mask(x);
|
||||
AzimuthalIntegration mapping(x, pixel_mask);
|
||||
AzimuthalIntegrationMapping mapping(x, pixel_mask);
|
||||
|
||||
AzimuthalIntegrationProfile profile(mapping);
|
||||
|
||||
@@ -268,7 +268,7 @@ TEST_CASE("AzimuthalIntegrationProfile_GetResult1D","[AzimuthalIntegration]") {
|
||||
x.ImportAzimuthalIntegrationSettings(settings);
|
||||
|
||||
PixelMask pixel_mask(x);
|
||||
AzimuthalIntegration mapping(x, pixel_mask);
|
||||
AzimuthalIntegrationMapping mapping(x, pixel_mask);
|
||||
AzimuthalIntegrationProfile profile(mapping);
|
||||
|
||||
REQUIRE(mapping.GetQBinCount() == 3);
|
||||
@@ -308,3 +308,99 @@ TEST_CASE("AzimuthalIntegrationProfile_GetResult1D","[AzimuthalIntegration]") {
|
||||
CHECK(result_1d[1] == Catch::Approx(21.0f));
|
||||
CHECK(result_1d[2] == Catch::Approx(22.0f));
|
||||
}
|
||||
|
||||
template <class T>
|
||||
static void RequireVectorsEqual(const std::vector<T> &ref,
|
||||
const std::vector<T> &other,
|
||||
const std::string &name,
|
||||
int nthreads) {
|
||||
INFO(name << ", threads=" << nthreads);
|
||||
REQUIRE(ref.size() == other.size());
|
||||
CHECK(memcmp(ref.data(), other.data(), sizeof(T) * ref.size()) == 0);
|
||||
}
|
||||
|
||||
static void CheckAzimuthalIntegrationMappingThreadingExact(const DiffractionExperiment &experiment) {
|
||||
PixelMask pixel_mask(experiment);
|
||||
|
||||
AzimuthalIntegrationMapping mapping_1(experiment, pixel_mask, 1);
|
||||
AzimuthalIntegrationMapping mapping_2(experiment, pixel_mask, 2);
|
||||
AzimuthalIntegrationMapping mapping_16(experiment, pixel_mask, 16);
|
||||
AzimuthalIntegrationMapping mapping_0(experiment, pixel_mask, 0);
|
||||
|
||||
REQUIRE(mapping_1.GetBinNumber() == mapping_2.GetBinNumber());
|
||||
REQUIRE(mapping_1.GetBinNumber() == mapping_16.GetBinNumber());
|
||||
REQUIRE(mapping_1.GetBinNumber() == mapping_0.GetBinNumber());
|
||||
|
||||
REQUIRE(mapping_1.GetQBinCount() == mapping_2.GetQBinCount());
|
||||
REQUIRE(mapping_1.GetQBinCount() == mapping_16.GetQBinCount());
|
||||
REQUIRE(mapping_1.GetQBinCount() == mapping_0.GetQBinCount());
|
||||
|
||||
REQUIRE(mapping_1.GetAzimuthalBinCount() == mapping_2.GetAzimuthalBinCount());
|
||||
REQUIRE(mapping_1.GetAzimuthalBinCount() == mapping_16.GetAzimuthalBinCount());
|
||||
REQUIRE(mapping_1.GetAzimuthalBinCount() == mapping_0.GetAzimuthalBinCount());
|
||||
|
||||
RequireVectorsEqual(mapping_1.GetPixelToBin(), mapping_2.GetPixelToBin(), "pixel_to_bin", 2);
|
||||
RequireVectorsEqual(mapping_1.GetPixelToBin(), mapping_16.GetPixelToBin(), "pixel_to_bin", 16);
|
||||
RequireVectorsEqual(mapping_1.GetPixelToBin(), mapping_0.GetPixelToBin(), "pixel_to_bin", 0);
|
||||
|
||||
RequireVectorsEqual(mapping_1.Resolution(), mapping_2.Resolution(), "resolution", 2);
|
||||
RequireVectorsEqual(mapping_1.Resolution(), mapping_16.Resolution(), "resolution", 16);
|
||||
RequireVectorsEqual(mapping_1.Resolution(), mapping_0.Resolution(), "resolution", 0);
|
||||
|
||||
RequireVectorsEqual(mapping_1.Corrections(), mapping_2.Corrections(), "corrections", 2);
|
||||
RequireVectorsEqual(mapping_1.Corrections(), mapping_16.Corrections(), "corrections", 16);
|
||||
RequireVectorsEqual(mapping_1.Corrections(), mapping_0.Corrections(), "corrections", 0);
|
||||
|
||||
RequireVectorsEqual(mapping_1.GetBinToQ(), mapping_2.GetBinToQ(), "bin_to_q", 2);
|
||||
RequireVectorsEqual(mapping_1.GetBinToQ(), mapping_16.GetBinToQ(), "bin_to_q", 16);
|
||||
RequireVectorsEqual(mapping_1.GetBinToQ(), mapping_0.GetBinToQ(), "bin_to_q", 0);
|
||||
|
||||
RequireVectorsEqual(mapping_1.GetBinToD(), mapping_2.GetBinToD(), "bin_to_d", 2);
|
||||
RequireVectorsEqual(mapping_1.GetBinToD(), mapping_16.GetBinToD(), "bin_to_d", 16);
|
||||
RequireVectorsEqual(mapping_1.GetBinToD(), mapping_0.GetBinToD(), "bin_to_d", 0);
|
||||
|
||||
RequireVectorsEqual(mapping_1.GetBinToTwoTheta(), mapping_2.GetBinToTwoTheta(), "bin_to_2theta", 2);
|
||||
RequireVectorsEqual(mapping_1.GetBinToTwoTheta(), mapping_16.GetBinToTwoTheta(), "bin_to_2theta", 16);
|
||||
RequireVectorsEqual(mapping_1.GetBinToTwoTheta(), mapping_0.GetBinToTwoTheta(), "bin_to_2theta", 0);
|
||||
|
||||
RequireVectorsEqual(mapping_1.GetBinToPhi(), mapping_2.GetBinToPhi(), "bin_to_phi", 2);
|
||||
RequireVectorsEqual(mapping_1.GetBinToPhi(), mapping_16.GetBinToPhi(), "bin_to_phi", 16);
|
||||
RequireVectorsEqual(mapping_1.GetBinToPhi(), mapping_0.GetBinToPhi(), "bin_to_phi", 0);
|
||||
}
|
||||
|
||||
TEST_CASE("AzimuthalIntegrationMapping_Threading_FixedGeometry_2000x2000", "[AzimuthalIntegration]") {
|
||||
DiffractionExperiment x(DetDECTRIS(2000, 2000, "E16M", ""));
|
||||
x.DetectorDistance_mm(50).BeamX_pxl(1000).BeamY_pxl(1000);
|
||||
x.QSpacingForAzimInt_recipA(0.1).QRangeForAzimInt_recipA(0.1, 10);
|
||||
x.PolarizationFactor(0.99f);
|
||||
|
||||
REQUIRE(x.IsGeometryTransformed());
|
||||
|
||||
CheckAzimuthalIntegrationMappingThreadingExact(x);
|
||||
}
|
||||
|
||||
TEST_CASE("AzimuthalIntegrationMapping_Threading_RawGeometry_18Modules", "[AzimuthalIntegration]") {
|
||||
DiffractionExperiment x(DetJF9M());
|
||||
x.Raw();
|
||||
x.DetectorDistance_mm(100).BeamX_pxl(1500).BeamY_pxl(1500);
|
||||
x.QSpacingForAzimInt_recipA(0.05).QRangeForAzimInt_recipA(0.1, 8.0);
|
||||
x.PolarizationFactor(0.99f);
|
||||
|
||||
REQUIRE(!x.IsGeometryTransformed());
|
||||
REQUIRE(x.GetModulesNum() == 18);
|
||||
|
||||
CheckAzimuthalIntegrationMappingThreadingExact(x);
|
||||
}
|
||||
|
||||
TEST_CASE("AzimuthalIntegrationMapping_Threading_ConvertedGeometry_18Modules", "[AzimuthalIntegration]") {
|
||||
DiffractionExperiment x(DetJF9M());
|
||||
x.Conversion();
|
||||
x.DetectorDistance_mm(100).BeamX_pxl(1500).BeamY_pxl(1500);
|
||||
x.QSpacingForAzimInt_recipA(0.05).QRangeForAzimInt_recipA(0.1, 8.0);
|
||||
x.PolarizationFactor(0.99f);
|
||||
|
||||
REQUIRE(x.IsGeometryTransformed());
|
||||
REQUIRE(x.GetModulesNum() == 18);
|
||||
|
||||
CheckAzimuthalIntegrationMappingThreadingExact(x);
|
||||
}
|
||||
Reference in New Issue
Block a user