2511-eiger-mask #2
@@ -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)
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user