Extra metadata in HDF5 writer completed file stream
This commit is contained in:
@@ -226,7 +226,11 @@ TEST_CASE("HDF5Writer_Socket", "[HDF5][Full]") {
|
||||
std::vector<SpotToSave> spots;
|
||||
|
||||
x.FilePrefix("test05").ImagesPerTrigger(5).ImagesPerFile(2).Compression(CompressionAlgorithm::NO_COMPRESSION)
|
||||
.HeaderAppendix("{\"z\":567}");
|
||||
.HeaderAppendix("{\"z\":567}").DetectorDistance_mm(155).BeamX_pxl(1606.62).BeamY_pxl(1669.59)
|
||||
.FrameTime(std::chrono::microseconds(1000), std::chrono::microseconds(100))
|
||||
.PhotonEnergy_keV(12.07).SetUnitCell(UnitCell{.a = 97, .b = 97, .c = 38, .alpha= 90, .beta = 90, .gamma = 90})
|
||||
.SpaceGroupNumber(96);
|
||||
|
||||
StartMessage start_message;
|
||||
x.FillMessage(start_message);
|
||||
|
||||
@@ -259,11 +263,15 @@ TEST_CASE("HDF5Writer_Socket", "[HDF5][Full]") {
|
||||
nlohmann::json j;
|
||||
|
||||
REQUIRE(s.Receive(msg, true));
|
||||
|
||||
j = nlohmann::json::parse(std::string((char *) msg.data(), msg.size()));
|
||||
REQUIRE(j["filename"] == "test05_data_000001.h5");
|
||||
REQUIRE(j["nimages"] == 2);
|
||||
REQUIRE(j["photon_energy_eV"] == Catch::Approx(x.GetPhotonEnergy_keV() * 1000.0));
|
||||
REQUIRE(j["space_group_number"] == 96);
|
||||
REQUIRE(j.contains("user_data"));
|
||||
REQUIRE(j["user_data"]["z"] == 567);
|
||||
std::cout << j.dump(4) << std::endl;
|
||||
|
||||
REQUIRE(s.Receive(msg, true));
|
||||
j = nlohmann::json::parse(std::string((char *) msg.data(), msg.size()));
|
||||
|
||||
Reference in New Issue
Block a user