Fix tests + trim unnecessary variables in DataProcessingSettings

This commit is contained in:
2023-11-16 19:58:24 +01:00
parent 4307a670eb
commit 0d3cb19a2e
9 changed files with 37 additions and 51 deletions
-6
View File
@@ -11,11 +11,8 @@ inline DataProcessingSettings Convert(const JFJochProtoBuf::DataProcessingSettin
ret.photon_count_threshold = input.photon_count_threshold();
ret.min_pix_per_spot = input.min_pix_per_spot();
ret.max_pix_per_spot = input.max_pix_per_spot();
ret.local_bkg_size = input.local_bkg_size();
ret.high_resolution_limit = input.high_resolution_limit();
ret.low_resolution_limit = input.low_resolution_limit();
ret.bkg_estimate_low_q = input.bkg_estimate_low_q();
ret.bkg_estimate_high_q = input.bkg_estimate_high_q();
ret.preview_indexed_only = input.preview_indexed_only();
return ret;
}
@@ -26,11 +23,8 @@ inline JFJochProtoBuf::DataProcessingSettings Convert(const DataProcessingSettin
ret.set_photon_count_threshold(input.photon_count_threshold);
ret.set_min_pix_per_spot(input.min_pix_per_spot);
ret.set_max_pix_per_spot(input.max_pix_per_spot);
ret.set_local_bkg_size(input.local_bkg_size);
ret.set_high_resolution_limit(input.high_resolution_limit);
ret.set_low_resolution_limit(input.low_resolution_limit);
ret.set_bkg_estimate_low_q(input.bkg_estimate_low_q);
ret.set_bkg_estimate_high_q(input.bkg_estimate_high_q);
ret.set_preview_indexed_only(input.preview_indexed_only);
return ret;
}
+8 -7
View File
@@ -702,8 +702,6 @@ void DiffractionExperiment::CheckDataProcessingSettings(const DataProcessingSett
check_min("Photon count threshold", settings.photon_count_threshold, 0);
check_min("Minimum pixels per spot", settings.min_pix_per_spot, 1);
check_min("Maximum pixels per spot", settings.max_pix_per_spot, settings.min_pix_per_spot + 1);
check_min("Local background size", settings.local_bkg_size, 2);
check_max("Local background size", settings.local_bkg_size, 7);
if (settings.high_resolution_limit > 0) {
check_min("Spot finding high resolution limit", settings.high_resolution_limit, 0.5);
check_max("Spot finding high resolution limit", settings.high_resolution_limit, 50.0);
@@ -715,19 +713,14 @@ void DiffractionExperiment::CheckDataProcessingSettings(const DataProcessingSett
check_min("Spot finding low resolution limit", settings.low_resolution_limit, 1.0);
check_max("Spot finding low resolution limit", settings.low_resolution_limit, 50.0);
}
check_min("Background estimate lowQ", settings.bkg_estimate_low_q, 0.0);
check_min("Background estimate highQ", settings.bkg_estimate_high_q, settings.bkg_estimate_low_q);
}
DataProcessingSettings DiffractionExperiment::DefaultDataProcessingSettings() {
DataProcessingSettings ret{};
ret.local_bkg_size = 5;
ret.signal_to_noise_threshold = 3;
ret.photon_count_threshold = 16;
ret.min_pix_per_spot = 1;
ret.max_pix_per_spot = 50;
ret.bkg_estimate_low_q = 2 * M_PI / 5.0;
ret.bkg_estimate_high_q= 2 * M_PI / 3.0;
return ret;
}
@@ -974,3 +967,11 @@ DiffractionExperiment::GetDetectorModuleConfig(const std::vector<AcquisitionDevi
}
return ret;
}
float DiffractionExperiment::GetLowQForBkgEstimate_recipA() const {
return 2 * static_cast<float>(M_PI) / 5.0;
}
float DiffractionExperiment::GetHighQForBkgEstimate_recipA() const {
return 2 * static_cast<float>(M_PI) / 3.0;
}
+3
View File
@@ -248,6 +248,9 @@ public:
float GetHighQForRadialInt_recipA() const;
float GetQSpacingForRadialInt_recipA() const;
float GetLowQForBkgEstimate_recipA() const;
float GetHighQForBkgEstimate_recipA() const;
int64_t GetSpaceGroupNumber() const;
int64_t GetStorageCellNumber() const;
-3
View File
@@ -156,11 +156,8 @@ message DataProcessingSettings {
int64 photon_count_threshold = 2; // Threshold in photon counts
int64 min_pix_per_spot = 3; // Minimum pixels per spot
int64 max_pix_per_spot = 4; // Maximum pixels per spot
int64 local_bkg_size = 5; // NBX/NBY parameter
float high_resolution_limit = 6;
float low_resolution_limit = 7;
float bkg_estimate_low_q = 8;
float bkg_estimate_high_q = 9;
bool preview_indexed_only = 10;
}
-3
View File
@@ -10,11 +10,8 @@ struct DataProcessingSettings {
int64_t photon_count_threshold; // Threshold in photon counts
int64_t min_pix_per_spot; // Minimum pixels per spot
int64_t max_pix_per_spot; // Maximum pixels per spot
int64_t local_bkg_size; // NBX/NBY parameter
float high_resolution_limit;
float low_resolution_limit;
float bkg_estimate_low_q;
float bkg_estimate_high_q;
bool preview_indexed_only;
};
+24 -24
View File
File diff suppressed because one or more lines are too long
+2 -4
View File
@@ -444,10 +444,8 @@ void JFJochReceiver::FrameTransformationThread() {
}
if (rad_int_profile_image) {
uint16_t rad_int_min_bin = std::floor(
rad_int_mapping->QToBin(local_data_processing_settings.bkg_estimate_low_q));
uint16_t rad_int_max_bin = std::ceil(
rad_int_mapping->QToBin(local_data_processing_settings.bkg_estimate_high_q));
uint16_t rad_int_min_bin = std::floor(rad_int_mapping->QToBin(experiment.GetLowQForBkgEstimate_recipA()));
uint16_t rad_int_max_bin = std::ceil(rad_int_mapping->QToBin(experiment.GetHighQForBkgEstimate_recipA()));
float bkg_estimate_val = rad_int_profile_image->GetMeanValueOfBins(rad_int_min_bin, rad_int_max_bin);
bkg_estimate.AddElement(image_number, bkg_estimate_val);
-1
View File
@@ -24,7 +24,6 @@ JFJochReceiverOutput RunJFJochReceiverTest(AcquisitionDeviceGroup &aq_devices, I
settings.photon_count_threshold = 5;
settings.min_pix_per_spot = 3;
settings.max_pix_per_spot = 200;
settings.local_bkg_size = 5;
service.SetDataProcessingSettings(settings);
service.Start(x, &calib);
-3
View File
@@ -792,9 +792,6 @@ TEST_CASE("JFJochIntegrationTest_ZMQ_lysozyme_spot", "[JFJochReceiver]") {
settings.max_pix_per_spot = 200;
settings.low_resolution_limit = 80.0;
settings.high_resolution_limit = 2.5;
settings.bkg_estimate_high_q = 0.0;
settings.bkg_estimate_low_q = 0.0;
settings.local_bkg_size = 5;
REQUIRE_NOTHROW(state_machine.SetDataProcessingSettings(settings));