aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2009-12-02 14:51:48 +0100
committerThomas White <taw@physics.org>2009-12-02 15:02:52 +0100
commit701693dd0501413469cca71b36885ce62ca2ea37 (patch)
tree1ab9972b8be7fc43c5dc73073743432a0815a2b0 /src
parente9fa516119d42e05c5a78d90b331fdc35acc6201 (diff)
Add --stop-after option
Diffstat (limited to 'src')
-rw-r--r--src/process_hkl.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/process_hkl.c b/src/process_hkl.c
index 4d17d520..62315981 100644
--- a/src/process_hkl.c
+++ b/src/process_hkl.c
@@ -45,7 +45,9 @@ static void show_help(const char *s)
" measurements.\n"
" -e, --output-every=<n> Analyse figures of merit after every n patterns.\n"
" -r, --rvsq Output lists of R vs |q| (\"Luzzatti plots\") when\n"
-" analysing figures of merit.\n");
+" analysing figures of merit.\n"
+" --stop-after=<n> Stop after processing n patterns (zero means)\n"
+" never stop).\n");
}
@@ -211,6 +213,7 @@ int main(int argc, char *argv[])
int config_maxonly = 0;
int config_every = 1000;
int config_rvsq = 0;
+ int config_stopafter = 0;
/* Long options */
const struct option longopts[] = {
@@ -219,6 +222,7 @@ int main(int argc, char *argv[])
{"max-only", 0, &config_maxonly, 1},
{"output-every", 1, NULL, 'e'},
{"rvsq", 0, NULL, 'r'},
+ {"stop-after", 1, NULL, 's'},
{0, 0, NULL, 0}
};
@@ -246,6 +250,11 @@ int main(int argc, char *argv[])
break;
}
+ case 's' : {
+ config_stopafter = atoi(optarg);
+ break;
+ }
+
case 0 : {
break;
}
@@ -300,6 +309,9 @@ int main(int argc, char *argv[])
n_patterns, mol->cell,
config_rvsq);
}
+
+ if ( n_patterns == config_stopafter ) break;
+
}
r = sscanf(line, "%i %i %i %i", &h, &k, &l, &intensity);