diff --git a/viewer/widgets/PowderCalibrationWidget.cpp b/viewer/widgets/PowderCalibrationWidget.cpp index 14dd62208..e1d11a4d2 100644 --- a/viewer/widgets/PowderCalibrationWidget.cpp +++ b/viewer/widgets/PowderCalibrationWidget.cpp @@ -80,8 +80,15 @@ std::vector PowderCalibrationWidget::GetCalibrantRings() const { const auto &table = Calibrants(); if (idx >= 0 && idx < static_cast(table.size())) return CalibrantRings(table[idx].name); - if (sample_cell) + if (sample_cell) { + // With the group where the dataset has one: the absences then come from the symmetry rather + // than from a bare P-lattice assumption, and a centred cell's list no longer opens with a + // reflection that is not there - which would scale the whole calibration by the ratio between + // that ring and the first real one. Same call the CLI makes. + if (sample_sg) + return CalculateXtalRings(sample_cell.value(), *sample_sg); return CalculateXtalRings(sample_cell.value()); + } return CalibrantRings(table.front().name); } @@ -108,8 +115,10 @@ void PowderCalibrationWidget::updateCalibrantList() { } void PowderCalibrationWidget::loadImage(std::shared_ptr image) { - if (image) + if (image) { sample_cell = image->Dataset().experiment.GetUnitCell(); + sample_sg = image->Dataset().experiment.GetGemmiSpaceGroup(); + } updateCalibrantList(); } diff --git a/viewer/widgets/PowderCalibrationWidget.h b/viewer/widgets/PowderCalibrationWidget.h index 699f7a54f..a4be9cc23 100644 --- a/viewer/widgets/PowderCalibrationWidget.h +++ b/viewer/widgets/PowderCalibrationWidget.h @@ -4,6 +4,7 @@ #pragma once #include +#include #include #include #include @@ -26,6 +27,9 @@ struct CalibrationSelection { class PowderCalibrationWidget : public QWidget { Q_OBJECT std::optional sample_cell; + // Taken with the cell, and used with it: the ring list a user-supplied cell produces has to carry + // the group's absences, or the fit pairs the innermost OBSERVED ring with a forbidden one. + std::optional sample_sg; QComboBox* calibrantCombo{nullptr}; // stores current calibrant selection QComboBox* methodCombo{nullptr}; // rings / spots, for the whole-dataset run