diff options
author | Thomas White <taw@physics.org> | 2010-05-26 15:13:36 +0200 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2010-05-26 15:13:36 +0200 |
commit | da99c2c265edb58af52b7b3042541df912c311e6 (patch) | |
tree | 5d1f962ea88f88d3107abacdf0bc0bb9379e90a7 /src/process_hkl.c | |
parent | 8d4aae9cbf11cd36cafa791f40804c586fc10b86 (diff) |
process_hkl: Read f0 from data stream
Diffstat (limited to 'src/process_hkl.c')
-rw-r--r-- | src/process_hkl.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/src/process_hkl.c b/src/process_hkl.c index 53638e7b..9a94769a 100644 --- a/src/process_hkl.c +++ b/src/process_hkl.c @@ -245,6 +245,7 @@ int main(int argc, char *argv[]) unsigned int *new_counts = NULL; unsigned int n_total_patterns; unsigned int *truecounts = NULL; + float f0; /* Long options */ const struct option longopts[] = { @@ -359,6 +360,7 @@ int main(int argc, char *argv[]) STATUS("There are %i patterns to process\n", n_total_patterns); n_patterns = 0; + f0 = -1.0; do { char line[1024]; @@ -382,10 +384,15 @@ int main(int argc, char *argv[]) model_counts, new_counts); } + if ( config_scale && (f0 == -1.0) ) { + ERROR("No f0 value.\n"); + f0 = 1.0; + } + /* Scale if requested */ if ( config_scale ) { scale_intensities(model, new_pattern, - model_counts, new_counts); + model_counts, new_counts, f0); } /* Start of second or later pattern */ @@ -409,6 +416,16 @@ int main(int argc, char *argv[]) progress_bar(n_patterns, n_total_patterns, "Merging"); + f0 = -1.0; + + } + + if ( strncmp(line, "f0 = ", 5) == 0 ) { + r = sscanf(line, "f0 = %f", &f0); + if ( r != 1 ) { + ERROR("Couldn't understand f0 line.\n"); + continue; + } } r = sscanf(line, "%i %i %i %f", &h, &k, &l, &intensity); |