* Enhancements for XFEL
* Enhancements for EIGER * Writer is more flexible and capable of handling DECTRIS data
This commit is contained in:
@@ -69,10 +69,6 @@ TEST_CASE("PxlToRes","") {
|
||||
DiffractionExperiment x(DetectorGeometry(8, 2, 8, 36));
|
||||
x.DetectorDistance_mm(75).PhotonEnergy_keV(WVL_1A_IN_KEV);
|
||||
|
||||
std::cout << x.GetWavelength_A() << std::endl;
|
||||
std::cout << x.GetDetectorDistance_mm() << std::endl;
|
||||
|
||||
std::cout << 1000 * sqrt(3) << std::endl;
|
||||
// sin(theta) = 1/2
|
||||
// theta = 30 deg
|
||||
// tan(2 * theta) = sqrt(3)
|
||||
@@ -105,13 +101,13 @@ TEST_CASE("SolidAngleCorrection","") {
|
||||
x.PhotonEnergy_keV(WVL_1A_IN_KEV);
|
||||
x.BeamX_pxl(1000).BeamY_pxl(1000).DetectorDistance_mm(75);
|
||||
|
||||
REQUIRE(CalcRadIntSolidAngleCorr(x, 0.0) == 1.0f);
|
||||
REQUIRE(CalcRadIntSolidAngleCorr(x, 2*M_PI) == Approx(0.5f*0.5f*0.5f));
|
||||
REQUIRE(CalcAzIntSolidAngleCorr(x, 0.0) == 1.0f);
|
||||
REQUIRE(CalcAzIntSolidAngleCorr(x, 2 * M_PI) == Approx(0.5f * 0.5f * 0.5f));
|
||||
|
||||
// theta = 30 deg
|
||||
// cos (2 * theta) = 1/2
|
||||
REQUIRE(CalcRadIntSolidAngleCorr(x, 1000, 1000) == 1.0f);
|
||||
REQUIRE(CalcRadIntSolidAngleCorr(x, 1000 * (1.0 + sqrt(3)), 1000) == Approx(0.5f*0.5f*0.5f));
|
||||
REQUIRE(CalcAzIntSolidAngleCorr(x, 1000, 1000) == 1.0f);
|
||||
REQUIRE(CalcAzIntSolidAngleCorr(x, 1000 * (1.0 + sqrt(3)), 1000) == Approx(0.5f * 0.5f * 0.5f));
|
||||
}
|
||||
|
||||
TEST_CASE("PolarizationCorrection","") {
|
||||
@@ -121,17 +117,17 @@ TEST_CASE("PolarizationCorrection","") {
|
||||
|
||||
// Circular polarization 0.5*(1+cos(2theta)^2)
|
||||
x.PolarizationFactor(0);
|
||||
REQUIRE(CalcRadIntPolarizationCorr(x, 1000 * (1.0 + sqrt(3)), 1000) == Approx(0.5f*(1+0.5f*0.5f)));
|
||||
REQUIRE(CalcRadIntPolarizationCorr(x, 1000, 1000* (1.0 + sqrt(3))) == Approx(0.5f*(1+0.5f*0.5f)));
|
||||
REQUIRE(CalcAzIntPolarizationCorr(x, 1000 * (1.0 + sqrt(3)), 1000) == Approx(0.5f * (1 + 0.5f * 0.5f)));
|
||||
REQUIRE(CalcAzIntPolarizationCorr(x, 1000, 1000 * (1.0 + sqrt(3))) == Approx(0.5f * (1 + 0.5f * 0.5f)));
|
||||
|
||||
// Horizontal polarization
|
||||
x.PolarizationFactor(1);
|
||||
|
||||
// No correction in vertical direction
|
||||
REQUIRE(CalcRadIntPolarizationCorr(x, 1000, 1000 * (1.0 + sqrt(3))) == Approx(1.0f));
|
||||
REQUIRE(CalcRadIntPolarizationCorr(x, 1000, 1000 * (1.0 - sqrt(3))) == Approx(1.0f));
|
||||
REQUIRE(CalcAzIntPolarizationCorr(x, 1000, 1000 * (1.0 + sqrt(3))) == Approx(1.0f));
|
||||
REQUIRE(CalcAzIntPolarizationCorr(x, 1000, 1000 * (1.0 - sqrt(3))) == Approx(1.0f));
|
||||
|
||||
// cos(2*theta)^2 in horizontal direction
|
||||
REQUIRE(CalcRadIntPolarizationCorr(x, 1000 * (1.0 + sqrt(3)), 1000) == Approx(0.5f*0.5f));
|
||||
REQUIRE(CalcRadIntPolarizationCorr(x, 1000 * (1.0 - sqrt(3)), 1000) == Approx(0.5f*0.5f));
|
||||
REQUIRE(CalcAzIntPolarizationCorr(x, 1000 * (1.0 + sqrt(3)), 1000) == Approx(0.5f * 0.5f));
|
||||
REQUIRE(CalcAzIntPolarizationCorr(x, 1000 * (1.0 - sqrt(3)), 1000) == Approx(0.5f * 0.5f));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user