diff options
author | Thomas White <taw@physics.org> | 2024-06-25 10:16:33 +0200 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2024-06-25 10:39:34 +0200 |
commit | 407215ad190dcdfb8f7263acbbaa725d19a667d1 (patch) | |
tree | 1dc529b081b96029e07c29e785d9f5c7c33967c8 /src | |
parent | 3a321852d73ab153a5ccff850f175d1a2af8bbc0 (diff) |
process_hkl: Don't accidentally skip crystals in first pattern
There was a truly ancient bug here, which has existed for as long as
CrystFEL has supported multi-crystal indexing (version 0.5.0, 11 years
ago!). See 1e03ed982741fdc576ec5a915da120450df20499.
Previously, when using process_hkl --even-only (without --start-after),
if the first image contained multiple crystals, they would all be
skipped. The correct behaviour is for second, fourth, sixth etc
crystals to be merged, if they exist.
If the first image contained exactly two crystals, this glitch would put
the alternating sequence one step out of sync, such that the only
difference between --odd-only and --even-only was the inclusion of the
very first crystal. Fortunately, it was obvious when this happened,
because the two merged files would be practically identical.
Diffstat (limited to 'src')
-rw-r--r-- | src/process_hkl.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/process_hkl.c b/src/process_hkl.c index 39df362f..89943aa8 100644 --- a/src/process_hkl.c +++ b/src/process_hkl.c @@ -446,7 +446,7 @@ static int merge_stream(Stream *st, if ( r == 0 ) n_crystals_used++; } - if ( n_crystals_used == stop_after ) break; + if ( (stop_after>0) && (n_crystals_used == stop_after) ) break; } |