v1.0.0-rc.81
This commit is contained in:
@@ -52,6 +52,7 @@ void JFJochHDF5Reader::ReadFile(const std::string& filename) {
|
||||
try {
|
||||
auto dataset = std::make_shared<JFJochReaderDataset>();
|
||||
master_file = std::make_unique<HDF5ReadOnlyFile>(filename);
|
||||
dataset->experiment.DetectIceRings(true);
|
||||
|
||||
std::filesystem::path fsPath(filename);
|
||||
dataset->experiment.FilePrefix(dataset_name(filename));
|
||||
@@ -171,6 +172,10 @@ void JFJochHDF5Reader::ReadFile(const std::string& filename) {
|
||||
dataset->experiment.IndexingAlgorithm(IndexingAlgorithmEnum::FFBIDX);
|
||||
}
|
||||
|
||||
auto ring_current_A = master_file->GetOptFloat("/entry/source/current");
|
||||
if (ring_current_A) dataset->experiment.RingCurrent_mA(ring_current_A.value() * 1000.0);
|
||||
|
||||
dataset->experiment.DetectIceRings(master_file->GetOptBool("/entry/instrument/detector/detectorSpecific/detect_ice_rings").value_or(false));
|
||||
dataset->experiment.PoniRot1_rad(master_file->GetOptFloat("/entry/instrument/detector/transformations/rot1").value_or(0.0));
|
||||
dataset->experiment.PoniRot2_rad(master_file->GetOptFloat("/entry/instrument/detector/transformations/rot2").value_or(0.0));
|
||||
dataset->experiment.PoniRot3_rad(master_file->GetOptFloat("/entry/instrument/detector/transformations/rot3").value_or(0.0));
|
||||
@@ -254,6 +259,14 @@ void JFJochHDF5Reader::ReadFile(const std::string& filename) {
|
||||
}
|
||||
}
|
||||
|
||||
// Read fluorescence spectrum if present
|
||||
if (master_file->Exists("/entry/instrument/fluorescence")) {
|
||||
auto energy = master_file->ReadOptVector<float>("/entry/instrument/fluorescence/energy");
|
||||
auto data = master_file->ReadOptVector<float>("/entry/instrument/fluorescence/data");
|
||||
if (!energy.empty() && energy.size() == data.size())
|
||||
dataset->experiment.FluorescenceSpectrum(XrayFluorescenceSpectrum(energy, data));
|
||||
}
|
||||
|
||||
auto detector_name = master_file->GetString("/entry/instrument/detector/description");
|
||||
|
||||
DetectorSetup detector = DetDECTRIS(image_size_x, image_size_y, detector_name, {});
|
||||
@@ -431,6 +444,11 @@ bool JFJochHDF5Reader::LoadImage_i(std::shared_ptr<JFJochReaderDataset> &dataset
|
||||
s.ice_ring = (spot_ice.at(i) != 0);
|
||||
message.spots.emplace_back(s);
|
||||
}
|
||||
|
||||
message.spot_count = source_file->ReadElement<uint32_t>("/entry/MX/peakCountUnfiltered", image_id);
|
||||
message.spot_count_ice_rings = source_file->ReadElement<uint32_t>("/entry/MX/peakCountIceRingRes", image_id);
|
||||
message.spot_count_low_res = source_file->ReadElement<uint32_t>("/entry/MX/peakCountLowRes", image_id);
|
||||
message.spot_count_indexed = source_file->ReadElement<uint32_t>("/entry/MX/peakCountIndexed", image_id);
|
||||
}
|
||||
|
||||
if (!dataset->az_int_bin_to_q.empty()) {
|
||||
|
||||
Reference in New Issue
Block a user