v1.0.0-rc.41
This commit is contained in:
@@ -48,7 +48,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);
|
||||
REQUIRE(mapping.GetBinNumber() == 30);
|
||||
REQUIRE(mapping.GetBinNumber() == 89);
|
||||
}
|
||||
|
||||
TEST_CASE("AzimuthalIntegrationMapping_GetBinNumber_DetectorLimit","[AzimuthalIntegration]") {
|
||||
@@ -59,7 +59,7 @@ TEST_CASE("AzimuthalIntegrationMapping_GetBinNumber_DetectorLimit","[AzimuthalIn
|
||||
PixelMask pixel_mask(x);
|
||||
AzimuthalIntegration mapping(x, pixel_mask);
|
||||
|
||||
REQUIRE(mapping.GetBinNumber() < 80);
|
||||
REQUIRE(mapping.GetBinNumber() == 98);
|
||||
}
|
||||
|
||||
TEST_CASE("AzimuthalIntegrationMapping_GetBinToQ","[AzimuthalIntegration]") {
|
||||
@@ -79,6 +79,74 @@ TEST_CASE("AzimuthalIntegrationMapping_GetBinToQ","[AzimuthalIntegration]") {
|
||||
CHECK(bin_to_q[38] == Catch::Approx(3.95));
|
||||
}
|
||||
|
||||
TEST_CASE("AzimuthalIntegrationMapping_GetBinToPhi","[AzimuthalIntegration]") {
|
||||
DiffractionExperiment x(DetJF4M());
|
||||
x.DetectorDistance_mm(50).BeamX_pxl(1000).BeamY_pxl(1000);
|
||||
|
||||
AzimuthalIntegrationSettings settings;
|
||||
|
||||
settings.QSpacing_recipA(0.1).QRange_recipA(0.1, 4.1).AzimuthalBinCount(4);
|
||||
x.ImportAzimuthalIntegrationSettings(settings);
|
||||
|
||||
PixelMask pixel_mask(x);
|
||||
AzimuthalIntegration mapping(x, pixel_mask);
|
||||
|
||||
auto &bin_to_q = mapping.GetBinToQ();
|
||||
|
||||
REQUIRE(bin_to_q.size() == 40 * 4);
|
||||
CHECK(bin_to_q[0] == Catch::Approx(0.15));
|
||||
CHECK(bin_to_q[1] == Catch::Approx(0.25));
|
||||
CHECK(bin_to_q[15] == Catch::Approx(1.65));
|
||||
CHECK(bin_to_q[38] == Catch::Approx(3.95));
|
||||
|
||||
auto &bin_to_phi = mapping.GetBinToPhi();
|
||||
|
||||
REQUIRE(bin_to_phi.size() == 40 * 4);
|
||||
CHECK(bin_to_phi[0] == Catch::Approx(0));
|
||||
CHECK(bin_to_phi[1] == Catch::Approx(0));
|
||||
CHECK(bin_to_phi[38] == Catch::Approx(0));
|
||||
CHECK(bin_to_phi[40] == Catch::Approx(90));
|
||||
}
|
||||
|
||||
TEST_CASE("AzimuthalIntegrationMapping_GetBin","[AzimuthalIntegration]") {
|
||||
DiffractionExperiment x(DetJF4M());
|
||||
x.DetectorDistance_mm(50).BeamX_pxl(1000).BeamY_pxl(1000);
|
||||
|
||||
AzimuthalIntegrationSettings settings;
|
||||
|
||||
settings.QSpacing_recipA(0.1).QRange_recipA(0.1, 4.1).AzimuthalBinCount(4);
|
||||
|
||||
CHECK(settings.GetBin(0.11f, 0.0f) == 0);
|
||||
CHECK(settings.GetBin(0.11f, 95.0f) == 40);
|
||||
CHECK(settings.GetBin(0.11f, 185.0f) == 80);
|
||||
CHECK(settings.GetBin(4.02f, 280.0f) == 120 + 39);
|
||||
}
|
||||
|
||||
#include "../preview/JFJochTIFF.h"
|
||||
|
||||
TEST_CASE("AzimuthalIntegrationMapping_GetMapping","[AzimuthalIntegration]") {
|
||||
DiffractionExperiment x(DetJF4M());
|
||||
x.DetectorDistance_mm(100).BeamX_pxl(1000).BeamY_pxl(1000);
|
||||
|
||||
AzimuthalIntegrationSettings settings;
|
||||
|
||||
settings.QSpacing_recipA(0.1).QRange_recipA(0.1, 4.1).AzimuthalBinCount(4);
|
||||
x.ImportAzimuthalIntegrationSettings(settings);
|
||||
|
||||
PixelMask pixel_mask(x);
|
||||
AzimuthalIntegration mapping(x, pixel_mask);
|
||||
|
||||
auto map = mapping.GetPixelToBin();
|
||||
|
||||
CompressedImage image(map, x.GetXPixelsNum(), x.GetYPixelsNum());
|
||||
WriteTIFFToFile("test.tiff", image);
|
||||
|
||||
CHECK(map[x.GetXPixelsNum() * 500 + 1500] / 40 == 0);
|
||||
CHECK(map[x.GetXPixelsNum() * 500 + 500] / 40 == 1);
|
||||
CHECK(map[x.GetXPixelsNum() * 1500 + 500] / 40 == 2);
|
||||
CHECK(map[x.GetXPixelsNum() * 1500 + 1500] / 40 == 3);
|
||||
}
|
||||
|
||||
TEST_CASE("AzimuthalIntegrationMapping_QToBin","[AzimuthalIntegration]") {
|
||||
DiffractionExperiment x(DetJF4M());
|
||||
x.DetectorDistance_mm(50).BeamX_pxl(1000).BeamY_pxl(1000);
|
||||
|
||||
Reference in New Issue
Block a user