v1.0.0-rc.97
Build Packages / build:rpm (ubuntu2404_nocuda) (push) Successful in 8m11s
Build Packages / build:rpm (ubuntu2204_nocuda) (push) Successful in 9m9s
Build Packages / build:rpm (rocky8_nocuda) (push) Successful in 9m18s
Build Packages / build:rpm (rocky9_nocuda) (push) Successful in 10m14s
Build Packages / build:rpm (rocky8_sls9) (push) Successful in 10m3s
Build Packages / Generate python client (push) Successful in 15s
Build Packages / Build documentation (push) Successful in 50s
Build Packages / Create release (push) Has been skipped
Build Packages / build:rpm (rocky8) (push) Successful in 8m31s
Build Packages / build:rpm (ubuntu2204) (push) Successful in 8m21s
Build Packages / build:rpm (ubuntu2404) (push) Successful in 7m42s
Build Packages / build:rpm (rocky9) (push) Successful in 9m11s
Build Packages / Unit tests (push) Failing after 1h13m19s
Build Packages / build:rpm (ubuntu2404_nocuda) (push) Successful in 8m11s
Build Packages / build:rpm (ubuntu2204_nocuda) (push) Successful in 9m9s
Build Packages / build:rpm (rocky8_nocuda) (push) Successful in 9m18s
Build Packages / build:rpm (rocky9_nocuda) (push) Successful in 10m14s
Build Packages / build:rpm (rocky8_sls9) (push) Successful in 10m3s
Build Packages / Generate python client (push) Successful in 15s
Build Packages / Build documentation (push) Successful in 50s
Build Packages / Create release (push) Has been skipped
Build Packages / build:rpm (rocky8) (push) Successful in 8m31s
Build Packages / build:rpm (ubuntu2204) (push) Successful in 8m21s
Build Packages / build:rpm (ubuntu2404) (push) Successful in 7m42s
Build Packages / build:rpm (rocky9) (push) Successful in 9m11s
Build Packages / Unit tests (push) Failing after 1h13m19s
This is an UNSTABLE release and not recommended for production use (please use rc.96 instead). * jfjoch_broker: For DECTRIS detectors add dark data collection during initialization for bad pixel mask * jfjoch_broker: Refactor of calibration logic for more clear code (likely to introduce problems) * jfjoch_viewer: Add option to handle user pixel mask (experimental) * jfjoch_viewer: More options for ROI * jfjoch_viewer: Add window to display calibration Reviewed-on: #2 Co-authored-by: Filip Leonarski <filip.leonarski@psi.ch> Co-committed-by: Filip Leonarski <filip.leonarski@psi.ch>
This commit was merged in pull request #2.
This commit is contained in:
@@ -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;
|
||||
@@ -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::Standard;
|
||||
|
||||
auto settings = detector.GetDefaultSettings();
|
||||
if (settings)
|
||||
detector_settings = *settings;
|
||||
@@ -46,11 +50,24 @@ DiffractionExperiment &DiffractionExperiment::Detector(const DetectorSetup &inpu
|
||||
}
|
||||
|
||||
DiffractionExperiment &DiffractionExperiment::Mode(DetectorMode 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");
|
||||
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;
|
||||
}
|
||||
|
||||
mode = input;
|
||||
if (input == DetectorMode::Conversion)
|
||||
Conversion();
|
||||
if (input == DetectorMode::Raw)
|
||||
Raw();
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
@@ -197,7 +214,8 @@ DiffractionExperiment &DiffractionExperiment::OverwriteExistingFiles(bool input)
|
||||
|
||||
// getter functions
|
||||
int64_t DiffractionExperiment::GetNumTriggers() const {
|
||||
if (IsPedestalRun())
|
||||
if (GetDetectorMode() != DetectorMode::Standard)
|
||||
// For pedestal and dark mask modes
|
||||
return 1;
|
||||
else if (IsPulsedSource())
|
||||
// For pulsed source summation happens over multiple triggers
|
||||
@@ -211,14 +229,16 @@ DetectorMode DiffractionExperiment::GetDetectorMode() const {
|
||||
}
|
||||
|
||||
std::chrono::microseconds DiffractionExperiment::GetFrameTime() const {
|
||||
if ((GetDetectorType() != DetectorType::JUNGFRAU) && dataset.GetImageTime().has_value())
|
||||
return dataset.GetImageTime().value();
|
||||
|
||||
switch (GetDetectorMode()) {
|
||||
case DetectorMode::DarkMask:
|
||||
return GetDarkMaskSettings().GetFrameTime();
|
||||
case DetectorMode::PedestalG1:
|
||||
case DetectorMode::PedestalG2:
|
||||
return detector_settings.GetFrameTimePedestalG1G2();
|
||||
default:
|
||||
if ((GetDetectorType() != DetectorType::JUNGFRAU) && dataset.GetImageTime().has_value())
|
||||
return dataset.GetImageTime().value();
|
||||
|
||||
return detector_settings.GetFrameTime();
|
||||
}
|
||||
}
|
||||
@@ -251,7 +271,9 @@ std::chrono::microseconds DiffractionExperiment::GetImageTime() const {
|
||||
}
|
||||
|
||||
int64_t DiffractionExperiment::GetImageNum() const {
|
||||
return IsPedestalRun() ? 0 : (GetFrameNum() / GetSummation());
|
||||
if (GetDetectorMode() == DetectorMode::Standard)
|
||||
return GetFrameNum() / GetSummation();
|
||||
return 0;
|
||||
}
|
||||
|
||||
int64_t DiffractionExperiment::GetFrameNum() const {
|
||||
@@ -260,6 +282,8 @@ int64_t DiffractionExperiment::GetFrameNum() const {
|
||||
|
||||
int64_t DiffractionExperiment::GetFrameNumPerTrigger() const {
|
||||
switch (GetDetectorMode()) {
|
||||
case DetectorMode::DarkMask:
|
||||
return GetDarkMaskSettings().GetNumberOfFrames();
|
||||
case DetectorMode::PedestalG0:
|
||||
return GetPedestalG0Frames() * GetStorageCellNumber();
|
||||
case DetectorMode::PedestalG1:
|
||||
@@ -1218,12 +1242,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) {
|
||||
@@ -1294,11 +1320,18 @@ uint32_t DiffractionExperiment::GetPedestalMinImageCount() const {
|
||||
}
|
||||
|
||||
float DiffractionExperiment::GetEigerThreshold_keV() const {
|
||||
float thr = GetIncidentEnergy_keV() / 2.0f;
|
||||
float thr;
|
||||
|
||||
auto val = detector_settings.GetEigerThreshold_keV();
|
||||
if (val)
|
||||
thr = val.value();
|
||||
if (GetDetectorMode() == DetectorMode::DarkMask)
|
||||
thr = GetDarkMaskSettings().GetThreshold_keV();
|
||||
else {
|
||||
auto val = detector_settings.GetEigerThreshold_keV();
|
||||
|
||||
if (val)
|
||||
thr = val.value();
|
||||
else
|
||||
thr = GetIncidentEnergy_keV() / 2.0f;
|
||||
}
|
||||
|
||||
if (thr < detector.GetMinThreshold_keV())
|
||||
thr = detector.GetMinThreshold_keV();
|
||||
@@ -1593,3 +1626,18 @@ bool DiffractionExperiment::IsDetectIceRings() const {
|
||||
const XrayFluorescenceSpectrum &DiffractionExperiment::GetFluorescenceSpectrum() const {
|
||||
return dataset.GetFluorescenceSpectrum();
|
||||
}
|
||||
|
||||
DarkMaskSettings DiffractionExperiment::GetDarkMaskSettings() const {
|
||||
return dark_mask_settings;
|
||||
}
|
||||
|
||||
DiffractionExperiment &DiffractionExperiment::ImportDarkMaskSettings(const DarkMaskSettings &input) {
|
||||
dark_mask_settings = input;
|
||||
return *this;
|
||||
}
|
||||
|
||||
int64_t DiffractionExperiment::GetDarkMaskNumberOfFrames() const {
|
||||
if (GetDetectorType() == DetectorType::DECTRIS)
|
||||
return GetDarkMaskSettings().GetNumberOfFrames();
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user