Replace the dead PartialityModel with a force_still_processing flag

With ScaleOnTheFly now fixed-only and rotation routed through RotationScaleMerge, the
PartialityModel enum carried no information (it was always Rotation for rotation processing,
Fixed otherwise, and mirrored combine_3d). Drop it:

- ScalingSettings: `partiality_mode` (PartialityModel) -> `force_still_processing` (bool);
  SetPartialityModel/GetPartialityModel -> ForceStillProcessing/GetForceStillProcessing.
  Remove the enum.
- DiffractionExperiment: drop GetPartialityModel(); the rotation-vs-stills decision is now
  just GetCombine3D() (set by the tool = rotation && !force_still). The wedge getters no longer
  key off the model (dead since wedge refinement was removed).
- jfjoch_process: `-P/--partiality fixed|rot3d` -> `--force-still-processing` (a rotation
  dataset scaled as independent stills). Auto-detect sets combine_3d for rotation data unless
  the flag is given.
- jfjoch_scale: `-P fixed|rot3d` now toggles combine_3d directly (no PartialityModel).
- jfjoch_viewer: the "process as stills" toggle sets ForceStillProcessing(!rotation_mode) -
  UI unchanged, just wired to the new field.

PartialityModel was never in the OpenAPI, so no generated clients change. Rotation path
behaviour is unchanged (lyso 16.4/99.6%/87.3%); --force-still-processing correctly routes to
ScaleOnTheFly. CUDA + non-CUDA + viewer all build.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-07-03 11:58:34 +02:00
co-authored by Claude Opus 4.8
parent 9f45935fd3
commit b4d3d40cd8
9 changed files with 35 additions and 73 deletions
+12 -25
View File
@@ -63,7 +63,7 @@ void print_usage() {
std::cout << " --no-scale-fulls Disable the rot3d scale-fulls refit (it is on by default for rot3d)" << std::endl;
std::cout << " --write-process-h5 Also write the (large) _process.h5 when merging (default: only .mtz/.cif when merging)" << std::endl;
std::cout << " --smooth-g[=deg] rot3d: smooth per-frame scale G over a deg-degree rotation range (XDS DELPHI-like) before the combine (default: 5 for rot3d; 0 = off)" << std::endl;
std::cout << " -P, --partiality <txt> Scaling/merge model fixed|rot3d (default: rot3d for rotation data, fixed for stills). rot3d = RotationScaleMerge (recompute partiality, 3D combine, scale-fulls, merge); fixed = per-image ScaleOnTheFly with the stored partiality" << std::endl;
std::cout << " --force-still-processing Scale a rotation dataset as independent stills (per-image ScaleOnTheFly, fixed partiality) instead of the default RotationScaleMerge (recompute partiality, 3D combine, scale-fulls, merge)" << std::endl;
std::cout << " -A, --anomalous Anomalous mode (don't merge Friedel pairs)" << std::endl;
std::cout << " -B, --refine-bfactor Refine per image B-factor" << std::endl;
std::cout << " --scaling-high-resolution <num> High resolution limit for spot finding (default: no limit)" << std::endl;
@@ -117,6 +117,7 @@ enum {
OPT_NO_SCALE_FULLS,
OPT_WRITE_PROCESS_H5,
OPT_PROCESS_AS_STILLS,
OPT_FORCE_STILL_PROCESSING,
OPT_AZIM_MIN_Q,
OPT_AZIM_MAX_Q,
OPT_AZIM_PHI_BINS
@@ -135,7 +136,7 @@ static option long_options[] = {
{"reference-column", required_argument, nullptr, OPT_REFERENCE_COLUMN},
{"dump-observations", required_argument, nullptr, OPT_DUMP_OBSERVATIONS},
{"space-group", required_argument, nullptr, 'S'},
{"partiality", required_argument, nullptr, 'P'},
{"force-still-processing", no_argument, nullptr, OPT_FORCE_STILL_PROCESSING},
{"anomalous", no_argument, nullptr, 'A'},
{"refine-bfactor", no_argument, nullptr, 'B'},
{"scale-merge", no_argument, nullptr, 'M'},
@@ -339,8 +340,7 @@ int main(int argc, char **argv) {
GeomRefinementAlgorithmEnum refinement_algorithm = GeomRefinementAlgorithmEnum::BeamCenter;
std::optional<IntensityFormat> intensity_format; // --scaling-output override; default lives in ScalingSettings (mmCIF)
PartialityModel partiality_model = PartialityModel::Fixed;
bool partiality_explicit = false; // true once -P is given, so the rotation/stills default does not override it
bool force_still_processing = false; // --force-still-processing: scale a rotation dataset as stills
bool combine_3d = false; // -P rot3d: weight-sum per-frame partials into fulls before merging
float d_min_spot_finding = 1.5;
@@ -357,7 +357,7 @@ int main(int argc, char **argv) {
int opt;
int option_index = 0;
const char *short_opts = "vo:N:s:e:t:R::X:C:z:FABS:MP:r:q:";
const char *short_opts = "vo:N:s:e:t:R::X:C:z:FABS:Mr:q:";
while ((opt = getopt_long(argc, argv, short_opts, long_options, &option_index)) != -1) {
switch (opt) {
@@ -501,19 +501,8 @@ int main(int argc, char **argv) {
case 'S':
space_group_number = atoi(optarg);
break;
case 'P':
if (strcmp(optarg, "fixed") == 0)
partiality_model = PartialityModel::Fixed;
else if (strcmp(optarg, "rot3d") == 0) {
partiality_model = PartialityModel::Rotation;
combine_3d = true;
}
else {
logger.Error("Invalid partiality mode: {}", optarg);
print_usage();
exit(EXIT_FAILURE);
}
partiality_explicit = true;
case OPT_FORCE_STILL_PROCESSING:
force_still_processing = true;
break;
case OPT_SPOT_SIGMA:
sigma_spot_finding = atof(optarg);
@@ -789,12 +778,10 @@ int main(int argc, char **argv) {
"indexing). Use --process-as-stills to treat it as stills.");
}
// Default partiality model: rot3d for rotation processing (Rotation partiality + 3D combine of the
// per-frame partials into fulls), fixed for stills. An explicit -P always wins.
if (!partiality_explicit && rotation_indexing) {
partiality_model = PartialityModel::Rotation;
combine_3d = true; // rot3d
}
// Rotation data goes through RotationScaleMerge (3D combine of the per-frame partials into fulls)
// unless --force-still-processing asks for per-image stills scaling instead.
if (rotation_indexing && !force_still_processing)
combine_3d = true;
// Configure Indexing
IndexingSettings indexing_settings;
@@ -815,7 +802,7 @@ int main(int argc, char **argv) {
const bool scale_fulls = scale_fulls_arg.value_or(combine_3d);
ScalingSettings scaling_settings;
scaling_settings.SetPartialityModel(partiality_model);
scaling_settings.ForceStillProcessing(force_still_processing);
scaling_settings.Combine3D(combine_3d);
scaling_settings.ScaleFulls(scale_fulls);
scaling_settings.SmoothGDegrees(smooth_g_deg_arg.value_or(combine_3d ? SMOOTH_G_DEFAULT_DEG : 0.0));