aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2018-07-26 11:19:08 +0200
committerThomas White <taw@physics.org>2018-07-26 11:19:08 +0200
commitdac777332aa8bbdd7ea0f08e241aa31262d9092c (patch)
tree57e7b409dfc594537b2b283a8b08f23716bb9a90
parent777766d6eb122f009fabd75753771e10977b8e62 (diff)
partialator: Add --min-res
-rw-r--r--doc/man/partialator.15
-rw-r--r--src/partialator.c15
2 files changed, 20 insertions, 0 deletions
diff --git a/doc/man/partialator.1 b/doc/man/partialator.1
index 3f8fef09..9ce641cc 100644
--- a/doc/man/partialator.1
+++ b/doc/man/partialator.1
@@ -98,6 +98,11 @@ Disable the polarisation correction.
Include reflections only if their peak values were less than \fIn\fR. That means, \fIn\fR is the saturation value of the detector. The default is infinity, i.e. no cutoff.
.PD 0
+.IP \fB--min-res=\fR\fIn\fR
+.PD
+Merge crystals only if they diffract to beyond \fIn\fR Angstroms resolution. The default is infinity, i.e. all crystals are included. The resolution is taken from the diffraction_resolution_limit line in the stream.
+
+.PD 0
.IP \fB--min-measurements=\fR\fIn\fR
.PD
Include a reflection in the output only if it appears at least least \fIn\fR times. The default is \fB--min-measurements=2\fR.
diff --git a/src/partialator.c b/src/partialator.c
index e152db7c..1d0881f3 100644
--- a/src/partialator.c
+++ b/src/partialator.c
@@ -322,6 +322,7 @@ static void show_help(const char *s)
" --min-measurements=<n> Minimum number of measurements to require.\n"
" --no-polarisation Disable polarisation correction.\n"
" --max-adu=<n> Saturation value of detector.\n"
+" --min-res=<n> Merge only crystals which diffract above <n> A.\n"
" --push-res=<n> Merge higher than apparent resolution cutoff.\n"
" -j <n> Run <n> analyses in parallel.\n"
" --no-free Disable cross-validation (testing only).\n"
@@ -875,6 +876,7 @@ int main(int argc, char *argv[])
double force_radius = -1.0;
char *audit_info;
int scaleflags = 0;
+ double min_res = 0.0;
/* Long options */
const struct option longopts[] = {
@@ -901,6 +903,7 @@ int main(int argc, char *argv[])
{"operator", 1, NULL, 9},
{"force-bandwidth", 1, NULL, 10},
{"force-radius", 1, NULL, 11},
+ {"min-res", 1, NULL, 12},
{"no-scale", 0, &no_scale, 1},
{"no-Bscale", 0, &no_Bscale, 1},
@@ -1059,6 +1062,16 @@ int main(int argc, char *argv[])
force_radius *= 1e9;
break;
+ case 12 :
+ errno = 0;
+ min_res = strtod(optarg, &rval);
+ if ( *rval != '\0' ) {
+ ERROR("Invalid value for --min-res.\n");
+ return 1;
+ }
+ min_res = 1e10/min_res;
+ break;
+
case 0 :
break;
@@ -1251,6 +1264,8 @@ int main(int argc, char *argv[])
n_crystals_seen++;
if ( n_crystals_seen <= start_after ) continue;
+ if ( crystal_get_resolution_limit(cur.crystals[i]) < min_res ) continue;
+
crystals_new = realloc(crystals,
(n_crystals+1)*sizeof(Crystal *));
if ( crystals_new == NULL ) {