aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2010-06-30 16:29:09 +0200
committerThomas White <taw@physics.org>2012-02-22 15:26:52 +0100
commit16a0c203e0d4a043f41bd63d51dac42ff5ff15a7 (patch)
tree501e388cd77f155ef2ebee7632ab1c0ea2290698 /src
parent5bd5b1dbd1a82ab67eb30b0a435c1728ae0905bf (diff)
Read counts from reflection list as well
Diffstat (limited to 'src')
-rw-r--r--src/reflections.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/reflections.c b/src/reflections.c
index 1177c612..8a9ad163 100644
--- a/src/reflections.c
+++ b/src/reflections.c
@@ -115,12 +115,14 @@ double *read_reflections(const char *filename, unsigned int *counts,
char line[1024];
signed int h, k, l;
- float intensity, ph;
+ float intensity, ph, res;
char phs[1024];
int r;
+ int cts;
rval = fgets(line, 1023, fh);
- r = sscanf(line, "%i %i %i %f %s", &h, &k, &l, &intensity, phs);
+ r = sscanf(line, "%i %i %i %f %s %f %i",
+ &h, &k, &l, &intensity, phs, &res, &cts);
if ( r != 5 ) continue;
set_intensity(ref, h, k, l, intensity);
@@ -128,7 +130,13 @@ double *read_reflections(const char *filename, unsigned int *counts,
ph = atof(phs);
set_phase(phases, h, k, l, ph);
}
- if ( counts != NULL ) set_count(counts, h, k, l, 1);
+ if ( counts != NULL ) {
+ set_count(counts, h, k, l, cts);
+ /* In this case, the intensity must be multiplied up
+ * because other parts of the program will try to
+ * divide it down. */
+ set_intensity(ref, h, k, l, intensity*(double)cts);
+ }
} while ( rval != NULL );