jfjoch_writer: the live refinement's model, maps and blobs are written beside the master file
In broker live mode the refined model, its map coefficients and the difference-map blobs stayed in the broker for the viewer routes and were lost at the next run. They now go to the writer in the END message as the placed model and maps already do - EndMessage::refined_model (PlacedModelMessage), refined_map_coefficients (MtzTable) and blobs (DensityBlobsMessage, one vector per field) - and the writer writes <prefix>_refined_model.cif (+ .pdb), <prefix>_refined_maps.mtz and <prefix>_blobs.json, the names the CLI gives them. The blobs' JSON is made by one function (DensityBlobsJson) that the CLI now writes through as well, so the two files are byte-identical. Optional CBOR fields, no version bump. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015CeEGgpKdfkCTJb3YNMJcu (cherry picked from commit c65220d96a96d2b1897f3c6632c94f9379b670a3)
This commit is contained in:
1 parent
2461d67e14
commit
2e296e6bed
13 files changed
+282
-36
No files matched your search
@@ -1679,6 +1679,30 @@ namespace {
|
||||
return m;
|
||||
}
|
||||
|
||||
DensityBlobsMessage ProcessDensityBlobsElement(CborValue &value) {
|
||||
DensityBlobsMessage b;
|
||||
CborValue map_value;
|
||||
cborErr(cbor_value_enter_container(&value, &map_value));
|
||||
while (!cbor_value_at_end(&map_value)) {
|
||||
auto key = GetCBORString(map_value);
|
||||
if (key == "kind") GetCBORStringArray(map_value, b.kind);
|
||||
else if (key == "x") GetCBORDoubleArray(map_value, b.x);
|
||||
else if (key == "y") GetCBORDoubleArray(map_value, b.y);
|
||||
else if (key == "z") GetCBORDoubleArray(map_value, b.z);
|
||||
else if (key == "peak_sigma") GetCBORDoubleArray(map_value, b.peak_sigma);
|
||||
else if (key == "volume") GetCBORDoubleArray(map_value, b.volume);
|
||||
else if (key == "score") GetCBORDoubleArray(map_value, b.score);
|
||||
else if (key == "nearest_atom") GetCBORStringArray(map_value, b.nearest_atom);
|
||||
else if (key == "nearest_atom_distance") GetCBORDoubleArray(map_value, b.nearest_atom_distance);
|
||||
else if (key == "polar_contacts") GetCBORInt32Array(map_value, b.polar_contacts);
|
||||
else if (key == "metal_contacts") GetCBORInt32Array(map_value, b.metal_contacts);
|
||||
else if (key == "anomalous_sigma") GetCBORDoubleArray(map_value, b.anomalous_sigma);
|
||||
else SkipCBORValue(map_value);
|
||||
}
|
||||
cborErr(cbor_value_leave_container(&value, &map_value));
|
||||
return b;
|
||||
}
|
||||
|
||||
bool ProcessEndMessageElement(EndMessage &message, CborValue &value) {
|
||||
if (cbor_value_at_end(&value))
|
||||
return false;
|
||||
@@ -1783,6 +1807,12 @@ namespace {
|
||||
message.map_coefficients = ProcessMtzTableElement(value);
|
||||
else if (key == "placed_model")
|
||||
message.placed_model = ProcessPlacedModelElement(value);
|
||||
else if (key == "refined_model")
|
||||
message.refined_model = ProcessPlacedModelElement(value);
|
||||
else if (key == "refined_map_coefficients")
|
||||
message.refined_map_coefficients = ProcessMtzTableElement(value);
|
||||
else if (key == "blobs")
|
||||
message.blobs = ProcessDensityBlobsElement(value);
|
||||
else if (key == "rotation_lattice") {
|
||||
std::vector<float> tmp;
|
||||
GetCBORFloatArray(value, tmp);
|
||||
|
||||
Reference in new issue
Block a user