2511-eiger-mask #2

Merged
leonarski_f merged 69 commits from 2511-eiger-mask into main 2025-11-09 12:42:28 +01:00
2 changed files with 24 additions and 1 deletions
Showing only changes of commit 3096454e7d - Show all commits

View File

@@ -39,6 +39,10 @@ DiffractionExperiment::DiffractionExperiment(const DetectorSetup& det_setup)
// setter functions
DiffractionExperiment &DiffractionExperiment::Detector(const DetectorSetup &input) {
detector = input;
// Conversion is always default mode after switching detectors
mode = DetectorMode::Conversion;
auto settings = detector.GetDefaultSettings();
if (settings)
detector_settings = *settings;
@@ -47,6 +51,25 @@ DiffractionExperiment &DiffractionExperiment::Detector(const DetectorSetup &inpu
DiffractionExperiment &DiffractionExperiment::Mode(DetectorMode input) {
mode = input;
// Handle allowed mode settings
switch (GetDetectorType()) {
case DetectorType::JUNGFRAU:
if (input == DetectorMode::DarkMask)
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, "Dark mask is not supported for PSI JUNGFRAU detector");
break;
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;
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)

View File

@@ -31,7 +31,7 @@
#include "../symmetry/gemmi/symmetry.hpp"
enum class DetectorMode {
Conversion, Raw, PedestalG0, PedestalG1, PedestalG2
Conversion, Raw, PedestalG0, PedestalG1, PedestalG2, DarkMask
};
struct AcquisitionDeviceNetConfig {