Merge branch 'worktree-agent-a4c58d76a0be29dd6' into grid-scan-integration
# Conflicts: # rugnux/rugnux_cli.cpp
This commit is contained in:
@@ -798,6 +798,53 @@ HDF5MetadataSource::OpenResult HDF5MetadataSource::Open(const std::string &filen
|
||||
}
|
||||
|
||||
if (master_file->Exists("/entry/MX")) {
|
||||
// The analysis that wrote the file, kept as provenance only. It is deliberately not pushed
|
||||
// onto the experiment: what a stored file was produced by is not what the next run should
|
||||
// do, and letting it decide would be exactly the implicitness the mode exists to remove.
|
||||
dataset->file_analysis_mode =
|
||||
AnalysisModeFromName(master_file->GetString("/entry/MX/analysis_mode", ""));
|
||||
|
||||
// Grid-scan crystals: parallel 1-D datasets, one per field, all of length N. nx sets N and
|
||||
// the rest are read into that length, so a file written by a build that had one field
|
||||
// fewer still re-opens with the crystals it does have.
|
||||
if (master_file->Exists("/entry/MX/crystals/nx")) {
|
||||
auto nx = master_file->ReadOptVector<float>("/entry/MX/crystals/nx");
|
||||
auto ny = master_file->ReadOptVector<float>("/entry/MX/crystals/ny");
|
||||
auto x_um = master_file->ReadOptVector<float>("/entry/MX/crystals/xUm");
|
||||
auto y_um = master_file->ReadOptVector<float>("/entry/MX/crystals/yUm");
|
||||
auto image_number = master_file->ReadOptVector<int64_t>("/entry/MX/crystals/imageNumber");
|
||||
auto major_um = master_file->ReadOptVector<float>("/entry/MX/crystals/majorUm");
|
||||
auto minor_um = master_file->ReadOptVector<float>("/entry/MX/crystals/minorUm");
|
||||
auto angle_deg = master_file->ReadOptVector<float>("/entry/MX/crystals/angleDeg");
|
||||
auto score = master_file->ReadOptVector<float>("/entry/MX/crystals/score");
|
||||
auto ice_score = master_file->ReadOptVector<float>("/entry/MX/crystals/iceScore");
|
||||
auto res_A = master_file->ReadOptVector<float>("/entry/MX/crystals/resA");
|
||||
auto n_images = master_file->ReadOptVector<int64_t>("/entry/MX/crystals/nImages");
|
||||
|
||||
const size_t n = nx.size();
|
||||
auto f = [n](const std::vector<float> &v, size_t i) { return v.size() == n ? v[i] : 0.0f; };
|
||||
auto i64 = [n](const std::vector<int64_t> &v, size_t i) {
|
||||
return v.size() == n ? v[i] : int64_t(0);
|
||||
};
|
||||
|
||||
dataset->grid_crystals.resize(n);
|
||||
for (size_t i = 0; i < n; i++) {
|
||||
auto &c = dataset->grid_crystals[i];
|
||||
c.nx = nx[i];
|
||||
c.ny = f(ny, i);
|
||||
c.x_um = f(x_um, i);
|
||||
c.y_um = f(y_um, i);
|
||||
c.image_number = i64(image_number, i);
|
||||
c.major_um = f(major_um, i);
|
||||
c.minor_um = f(minor_um, i);
|
||||
c.angle_deg = f(angle_deg, i);
|
||||
c.score = f(score, i);
|
||||
c.ice_score = f(ice_score, i);
|
||||
c.res_A = f(res_A, i);
|
||||
c.n_images = i64(n_images, i);
|
||||
}
|
||||
}
|
||||
|
||||
auto indexing = master_file->GetString("/entry/MX/indexing_algorithm", "none");
|
||||
if (indexing == "fft" || indexing == "FFT (CUDA)" || indexing == "FFT (FFTW)")
|
||||
dataset->experiment.IndexingAlgorithm(IndexingAlgorithmEnum::FFT);
|
||||
|
||||
Reference in New Issue
Block a user