diff --git a/common/JFJochMessages.h b/common/JFJochMessages.h index ccc45015..4aaf580a 100644 --- a/common/JFJochMessages.h +++ b/common/JFJochMessages.h @@ -112,9 +112,8 @@ struct DataMessage { std::optional bkg_estimate; std::optional indexing_result; - std::optional indexing_lattice_count; std::optional indexing_lattice; - std::vector extra_lattices; + std::vector indexing_extra_lattices; std::optional indexing_unit_cell; std::optional spot_count_indexed; @@ -330,7 +329,7 @@ struct EndMessage { std::optional rotation_lattice_type; std::optional rotation_lattice; - std::vector extra_lattices; + std::vector rotation_extra_lattices; std::optional unit_cell; // Vectors with end result: diff --git a/frame_serialize/CBORStream2Deserializer.cpp b/frame_serialize/CBORStream2Deserializer.cpp index c3c5769f..6c26151d 100644 --- a/frame_serialize/CBORStream2Deserializer.cpp +++ b/frame_serialize/CBORStream2Deserializer.cpp @@ -733,7 +733,7 @@ namespace { std::vector tmp; GetCBORFloatArray(array_value, tmp); if (tmp.size() == 9) - message.extra_lattices.emplace_back(tmp); + message.indexing_extra_lattices.emplace_back(tmp); } cborErr(cbor_value_leave_container(&value, &array_value)); } else if (key == "indexing_time") @@ -1429,7 +1429,7 @@ namespace { std::vector tmp; GetCBORFloatArray(array_value, tmp); if (tmp.size() == 9) - message.extra_lattices.emplace_back(tmp); + message.rotation_extra_lattices.emplace_back(tmp); } cborErr(cbor_value_leave_container(&value, &array_value)); } else diff --git a/frame_serialize/CBORStream2Serializer.cpp b/frame_serialize/CBORStream2Serializer.cpp index 6c9bc346..8b636427 100644 --- a/frame_serialize/CBORStream2Serializer.cpp +++ b/frame_serialize/CBORStream2Serializer.cpp @@ -722,11 +722,11 @@ void CBORStream2Serializer::SerializeSequenceEnd(const EndMessage& message) { CBOR_ENC(mapEncoder, "rotation_lattice_type", message.rotation_lattice_type); if (message.rotation_lattice.has_value()) CBOR_ENC(mapEncoder, "rotation_lattice", message.rotation_lattice->GetVector()); - if (!message.extra_lattices.empty()) { + if (!message.rotation_extra_lattices.empty()) { CborEncoder arrayEncoder; cborErr(cbor_encode_text_stringz(&mapEncoder, "extra_lattices")); - cborErr(cbor_encoder_create_array(&mapEncoder, &arrayEncoder, message.extra_lattices.size())); - for (const auto &el : message.extra_lattices) + cborErr(cbor_encoder_create_array(&mapEncoder, &arrayEncoder, message.rotation_extra_lattices.size())); + for (const auto &el : message.rotation_extra_lattices) CBOR_ENC_FLOAT_ARRAY_NOKEY(arrayEncoder, el.GetVector()); cborErr(cbor_encoder_close_container(&mapEncoder, &arrayEncoder)); } @@ -781,11 +781,11 @@ void CBORStream2Serializer::SerializeImageInternal(CborEncoder &mapEncoder, cons CBOR_ENC(mapEncoder, "indexing_lattice_count", message.indexing_lattice_count); if (message.indexing_lattice) CBOR_ENC(mapEncoder, "indexing_lattice", message.indexing_lattice->GetVector()); - if (!message.extra_lattices.empty()) { + if (!message.indexing_extra_lattices.empty()) { CborEncoder arrayEncoder; cborErr(cbor_encode_text_stringz(&mapEncoder, "extra_lattices")); - cborErr(cbor_encoder_create_array(&mapEncoder, &arrayEncoder, message.extra_lattices.size())); - for (const auto &el : message.extra_lattices) + cborErr(cbor_encoder_create_array(&mapEncoder, &arrayEncoder, message.indexing_extra_lattices.size())); + for (const auto &el : message.indexing_extra_lattices) CBOR_ENC_FLOAT_ARRAY_NOKEY(arrayEncoder, el.GetVector()); cborErr(cbor_encoder_close_container(&mapEncoder, &arrayEncoder)); } diff --git a/image_analysis/indexing/AnalyzeIndexing.cpp b/image_analysis/indexing/AnalyzeIndexing.cpp index a85bd286..964269d8 100644 --- a/image_analysis/indexing/AnalyzeIndexing.cpp +++ b/image_analysis/indexing/AnalyzeIndexing.cpp @@ -369,8 +369,8 @@ bool AnalyzeIndexing(DataMessage &message, // Spots already assigned to the main lattice (lattice == 0) are never // overwritten. Each extra lattice gets index 1, 2, 3, ... const size_t n_extra = std::min(extra_lattices.size(), experiment.GetIndexingSettings().GetMaxExtraLattices()); - message.extra_lattices.clear(); - message.extra_lattices.reserve(n_extra); + message.indexing_extra_lattices.clear(); + message.indexing_extra_lattices.reserve(n_extra); for (size_t li = 0; li < n_extra; li++) { const CrystalLattice &el = extra_lattices[li]; @@ -414,10 +414,10 @@ bool AnalyzeIndexing(DataMessage &message, } } - message.extra_lattices.push_back(el); + message.indexing_extra_lattices.push_back(el); } - message.indexing_lattice_count = static_cast(1 + message.extra_lattices.size()); + message.indexing_lattice_count = static_cast(1 + message.indexing_extra_lattices.size()); outcome = true; } } diff --git a/receiver/JFJochReceiver.cpp b/receiver/JFJochReceiver.cpp index ebc92658..64e82e33 100644 --- a/receiver/JFJochReceiver.cpp +++ b/receiver/JFJochReceiver.cpp @@ -172,7 +172,7 @@ void JFJochReceiver::SendEndMessage() { .niggli_class = rotation_indexer_ret->search_result.niggli_class, .crystal_system = rotation_indexer_ret->search_result.system }; - message.extra_lattices = rotation_indexer_ret->extra_lattices; + message.rotation_extra_lattices = rotation_indexer_ret->extra_lattices; rotation_indexing_lattice = rotation_indexer_ret->lattice; } message.unit_cell = indexer.GetConsensusUnitCell(); diff --git a/receiver/JFJochReceiverPlots.cpp b/receiver/JFJochReceiverPlots.cpp index 3f7e2599..987d1015 100644 --- a/receiver/JFJochReceiverPlots.cpp +++ b/receiver/JFJochReceiverPlots.cpp @@ -168,7 +168,7 @@ void JFJochReceiverPlots::Add(const DataMessage &msg, const AzimuthalIntegration indexing_uc_gamma.AddElement(msg.number, msg.indexing_unit_cell->gamma); } - indexing_lattice_count.AddElement(msg.number, msg.indexing_lattice_count); + indexing_lattice_count.AddElement(msg.number, msg.indexing_extra_lattices.size()); beam_center_x.AddElement(msg.number, msg.beam_corr_x); beam_center_y.AddElement(msg.number, msg.beam_corr_y); diff --git a/writer/HDF5DataFilePluginMX.cpp b/writer/HDF5DataFilePluginMX.cpp index e0318c4f..f8473200 100644 --- a/writer/HDF5DataFilePluginMX.cpp +++ b/writer/HDF5DataFilePluginMX.cpp @@ -177,8 +177,8 @@ void HDF5DataFilePluginMX::Write(const DataMessage &msg, uint64_t image_number) for (size_t li = 0; li < max_extra_lattices; li++) { const size_t base = (image_number * max_extra_lattices + li) * 9; - if (li < msg.extra_lattices.size()) { - auto tmp = msg.extra_lattices[li].GetVector(); + if (li < msg.indexing_extra_lattices.size()) { + auto tmp = msg.indexing_extra_lattices[li].GetVector(); for (int i = 0; i < 9; i++) extra_lattices[base + i] = tmp[i]; } else {