version 1.0.0-rc.27
This commit is contained in:
@@ -357,10 +357,6 @@ TEST_CASE("DiffractionExperiment_DetectorGeometry_gaps_mirror_y","[DiffractionEx
|
||||
TEST_CASE("DiffractionExperiment_Metadata","[DiffractionExperiment]") {
|
||||
DiffractionExperiment x;
|
||||
|
||||
x.PhotonEnergy_keV(6.0);
|
||||
REQUIRE(x.GetPhotonEnergy_keV() == 6.0);
|
||||
REQUIRE(x.GetWavelength_A() == Catch::Approx(12.39854 / 6.0));
|
||||
|
||||
x.DetectorDistance_mm(30.0).BeamX_pxl(1200).BeamY_pxl(1000).FrameTime(900us);
|
||||
|
||||
REQUIRE(x.GetBeamX_pxl() == Catch::Approx(1200));
|
||||
@@ -373,6 +369,30 @@ TEST_CASE("DiffractionExperiment_Metadata","[DiffractionExperiment]") {
|
||||
REQUIRE_THROWS(x.PedestalG2Frames(-1));
|
||||
}
|
||||
|
||||
TEST_CASE("DiffractionExperiment_Wavelength", "[DiffractionExperiment]") {
|
||||
DiffractionExperiment x;
|
||||
|
||||
x.IncidentEnergy_keV(6.0);
|
||||
REQUIRE(x.GetIncidentEnergy_keV() == 6.0);
|
||||
REQUIRE(x.GetWavelength_A() == Catch::Approx(12.39854 / 6.0));
|
||||
|
||||
// From https://advanced-microscopy.utah.edu/education/electron-micro/
|
||||
// Therefore, the wavelength at 100 keV, 200 keV, and 300 keV in electron microscopes
|
||||
// is 3.70 pm, 2.51 pm and 1.96 pm, respectively.
|
||||
|
||||
x.IncidentEnergy_keV(100.0).ElectronSource(true);
|
||||
REQUIRE(x.GetIncidentEnergy_keV() == 100.0);
|
||||
CHECK(fabs(x.GetWavelength_A() - 0.0370) < 0.0005);
|
||||
|
||||
x.IncidentEnergy_keV(200.0).ElectronSource(true);
|
||||
REQUIRE(x.GetIncidentEnergy_keV() == 200.0);
|
||||
CHECK(fabs(x.GetWavelength_A() - 0.0251) < 0.0005);
|
||||
|
||||
x.IncidentEnergy_keV(300.0).ElectronSource(true);
|
||||
REQUIRE(x.GetIncidentEnergy_keV() == 300.0);
|
||||
CHECK(fabs(x.GetWavelength_A() - 0.0196) < 0.0005);
|
||||
}
|
||||
|
||||
TEST_CASE("DiffractionExperiment_ZMQPreview", "[DiffractionExperiment]") {
|
||||
DiffractionExperiment x;
|
||||
|
||||
@@ -913,15 +933,15 @@ TEST_CASE("DiffractionExperiment_EIGER","[DiffractionExperiment]") {
|
||||
|
||||
TEST_CASE("DiffractionExperiment_JungfrauConversionFactor","[DiffractionExperiment]") {
|
||||
DiffractionExperiment x(DetectorSetup(DetectorGeometry(4)));
|
||||
x.Mode(DetectorMode::Conversion).PhotonEnergy_keV(16.0);
|
||||
x.Mode(DetectorMode::Conversion).IncidentEnergy_keV(16.0);
|
||||
REQUIRE(!x.GetJungfrauConversionFactor_keV().has_value());
|
||||
REQUIRE(x.GetPhotonEnergy_keV() == 16.0f);
|
||||
REQUIRE(x.GetIncidentEnergy_keV() == 16.0f);
|
||||
REQUIRE(x.GetPhotonEnergyForConversion_keV() == 16.0f);
|
||||
|
||||
x.JungfrauConversionFactor_keV(0.25f);
|
||||
REQUIRE(x.GetJungfrauConversionFactor_keV().has_value());
|
||||
REQUIRE(x.GetJungfrauConversionFactor_keV() == 0.25f);
|
||||
REQUIRE(x.GetPhotonEnergy_keV() == 16.0f);
|
||||
REQUIRE(x.GetIncidentEnergy_keV() == 16.0f);
|
||||
REQUIRE(x.GetPhotonEnergyForConversion_keV() == 0.25f);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user