DiffractionExperiment: Remove DetectorMode::Raw

This commit is contained in:
2025-11-04 20:52:36 +01:00
parent 3096454e7d
commit 5431f9cefb
14 changed files with 123 additions and 160 deletions
+9 -13
View File
@@ -29,7 +29,7 @@ DiffractionExperiment::DiffractionExperiment(const DetectorSetup& det_setup)
series_id = 0;
mode = DetectorMode::Conversion;
mode = DetectorMode::Standard;
image_format_settings.Conv();
summation = 1;
@@ -41,7 +41,7 @@ DiffractionExperiment &DiffractionExperiment::Detector(const DetectorSetup &inpu
detector = input;
// Conversion is always default mode after switching detectors
mode = DetectorMode::Conversion;
mode = DetectorMode::Standard;
auto settings = detector.GetDefaultSettings();
if (settings)
@@ -50,8 +50,6 @@ DiffractionExperiment &DiffractionExperiment::Detector(const DetectorSetup &inpu
}
DiffractionExperiment &DiffractionExperiment::Mode(DetectorMode input) {
mode = input;
// Handle allowed mode settings
switch (GetDetectorType()) {
case DetectorType::JUNGFRAU:
@@ -61,19 +59,15 @@ DiffractionExperiment &DiffractionExperiment::Mode(DetectorMode input) {
case DetectorType::DECTRIS:
if ((input == DetectorMode::PedestalG0) || (input == DetectorMode::PedestalG1) || (input == DetectorMode::PedestalG2))
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, "Pedestal data collection is not supported for DECTRIS detector");
if (input == DetectorMode::Raw)
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, "Raw data collection is not supported for DECTRIS detector");
break;
break;
case DetectorType::EIGER:
if ((input == DetectorMode::PedestalG0) || (input == DetectorMode::PedestalG1) || (input == DetectorMode::PedestalG2) || (input == DetectorMode::DarkMask))
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, "Pedestal or dark mask data collection is not supported for PSI EIGER detector");
break;
}
if (input == DetectorMode::Conversion)
Conversion();
if (input == DetectorMode::Raw)
Raw();
mode = input;
return *this;
}
@@ -1241,12 +1235,14 @@ std::optional<float> DiffractionExperiment::GetJungfrauConversionFactor_keV() co
return image_format_settings.GetJungfrauConvFactor_keV();
}
void DiffractionExperiment::Conversion() {
DiffractionExperiment & DiffractionExperiment::Conversion() {
image_format_settings.Conv();
return *this;
}
void DiffractionExperiment::Raw() {
DiffractionExperiment & DiffractionExperiment::Raw() {
image_format_settings.Raw();
return *this;
}
DiffractionExperiment &DiffractionExperiment::ImportDetectorSettings(const DetectorSettings &input) {