v1.0.0-rc.97
Some checks failed
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
Some checks failed
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:
@@ -69,12 +69,82 @@ TEST_CASE("JFJochReader_MasterFile", "[HDF5][Full]") {
|
||||
REQUIRE(dataset->experiment.GetUnitCell().has_value());
|
||||
CHECK(dataset->experiment.GetUnitCell()->b == 20.0);
|
||||
CHECK(dataset->experiment.GetUnitCell()->beta == 101.0);
|
||||
CHECK(dataset->calibration_data.empty());
|
||||
}
|
||||
remove("test08_master.h5");
|
||||
|
||||
REQUIRE(H5Fget_obj_count(H5F_OBJ_ALL, H5F_OBJ_ALL) == 0);
|
||||
}
|
||||
|
||||
TEST_CASE("JFJochReader_MasterFile_Calibration", "[HDF5][Full]") {
|
||||
DiffractionExperiment x(DetJF(1));
|
||||
|
||||
x.FilePrefix("test_reader_calibration").ImagesPerTrigger(1).OverwriteExistingFiles(true);
|
||||
RegisterHDF5Filter();
|
||||
|
||||
std::vector<uint16_t> calib_1(200*300, 10);
|
||||
std::vector<int32_t> calib_2(100*400, 55);
|
||||
std::vector<float> calib_f(100*400, 1234.56f);
|
||||
{
|
||||
StartMessage start_message;
|
||||
x.FillMessage(start_message);
|
||||
|
||||
CompressedImage calibration_01(calib_1, 200, 300);
|
||||
CompressedImage calibration_02(calib_2, 100, 400);
|
||||
CompressedImage calibration_f(calib_f, 100, 400);
|
||||
calibration_01.Channel("c1");
|
||||
calibration_02.Channel("c2");
|
||||
calibration_f.Channel("cf");
|
||||
|
||||
EndMessage end_message;
|
||||
end_message.max_image_number = 0;
|
||||
std::unique_ptr<NXmx> master = std::make_unique<NXmx>(start_message);
|
||||
master->WriteCalibration(calibration_01);
|
||||
master->WriteCalibration(calibration_02);
|
||||
master->WriteCalibration(calibration_f);
|
||||
master->Finalize(end_message);
|
||||
master.reset();
|
||||
}
|
||||
{
|
||||
JFJochHDF5Reader reader;
|
||||
REQUIRE_NOTHROW(reader.ReadFile("test_reader_calibration_master.h5"));
|
||||
auto dataset = reader.GetDataset();
|
||||
REQUIRE(dataset->calibration_data.size() == 3);
|
||||
CHECK(dataset->calibration_data[0] == "c1");
|
||||
CHECK(dataset->calibration_data[1] == "c2");
|
||||
CHECK(dataset->calibration_data[2] == "cf");
|
||||
|
||||
std::vector<uint8_t> buffer;
|
||||
std::vector<uint8_t> buff_2;
|
||||
REQUIRE_THROWS(reader.ReadCalibration(buffer, "c3"));
|
||||
CompressedImage test;
|
||||
REQUIRE_NOTHROW(test = reader.ReadCalibration(buffer, "c1"));
|
||||
CHECK(test.GetByteDepth() == 2);
|
||||
CHECK(test.GetHeight() == 200);
|
||||
CHECK(test.GetWidth() == 300);
|
||||
CHECK(test.GetMode() == CompressedImageMode::Uint16);
|
||||
CHECK(reinterpret_cast<const uint16_t *>(test.GetUncompressedPtr(buff_2))[76] == 10);
|
||||
|
||||
REQUIRE_NOTHROW(test = reader.ReadCalibration(buffer, "c2"));
|
||||
CHECK(test.GetByteDepth() == 4);
|
||||
CHECK(test.GetHeight() == 100);
|
||||
CHECK(test.GetWidth() == 400);
|
||||
CHECK(test.GetMode() == CompressedImageMode::Int32);
|
||||
CHECK(reinterpret_cast<const int32_t *>(test.GetUncompressedPtr(buff_2))[76] == 55);
|
||||
|
||||
REQUIRE_NOTHROW(test = reader.ReadCalibration(buffer, "cf"));
|
||||
CHECK(test.GetByteDepth() == 4);
|
||||
CHECK(test.GetHeight() == 100);
|
||||
CHECK(test.GetWidth() == 400);
|
||||
CHECK(test.GetMode() == CompressedImageMode::Float32);
|
||||
CHECK(reinterpret_cast<const float *>(test.GetUncompressedPtr(buff_2))[76] == Catch::Approx(1234.56f));
|
||||
}
|
||||
remove("test_reader_calibration_master.h5");
|
||||
|
||||
REQUIRE(H5Fget_obj_count(H5F_OBJ_ALL, H5F_OBJ_ALL) == 0);
|
||||
}
|
||||
|
||||
|
||||
TEST_CASE("JFJochReader_DefaultExperiment", "[HDF5][Full]") {
|
||||
DiffractionExperiment x(DetJF(1));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user