diff options
-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); |