aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas White <taw@bitwiz.org.uk>2010-03-27 12:48:38 +0100
committerThomas White <taw@bitwiz.org.uk>2010-03-27 12:48:38 +0100
commita6e064b18ed513d341d8793acbc485d7bc291827 (patch)
treebc91ee2b3b91de5f50ff97b879c941432052e8f4 /src
parent7a54ba94e7586c1ccaff1fd7d048fabd5ea128cf (diff)
Fix reading of reflection lists
Diffstat (limited to 'src')
-rw-r--r--src/detector.c2
-rw-r--r--src/reflections.c12
2 files changed, 8 insertions, 6 deletions
diff --git a/src/detector.c b/src/detector.c
index 6fb36b7d..e8eade98 100644
--- a/src/detector.c
+++ b/src/detector.c
@@ -87,7 +87,7 @@ void record_image(struct image *image, int do_poisson)
ERROR("Infinity at %i,%i\n", x, y);
}
if ( intensity < 0.0 ) {
- ERROR("Infinity at %i,%i\n", x, y);
+ ERROR("Negative at %i,%i\n", x, y);
}
if ( isnan(intensity) ) {
ERROR("NaN at %i,%i\n", x, y);
diff --git a/src/reflections.c b/src/reflections.c
index 90f8b116..deba0f8d 100644
--- a/src/reflections.c
+++ b/src/reflections.c
@@ -55,7 +55,7 @@ void write_reflections(const char *filename, unsigned int *counts,
for ( l=-INDMAX; l<INDMAX; l++ ) {
int N;
- double F, s;
+ double intensity, s;
if ( counts ) {
N = lookup_count(counts, h, k, l);
@@ -65,7 +65,7 @@ void write_reflections(const char *filename, unsigned int *counts,
}
if ( zone_axis && (l != 0) ) continue;
- F = lookup_intensity(ref, h, k, l) / N;
+ intensity = lookup_intensity(ref, h, k, l) / N;
if ( cell != NULL ) {
s = 2.0*resolution(cell, h, k, l);
@@ -74,7 +74,8 @@ void write_reflections(const char *filename, unsigned int *counts,
}
/* h, k, l, I, sigma(I), s */
- fprintf(fh, "%3i %3i %3i %f %f %f\n", h, k, l, F, 0.0, s/1.0e9);
+ fprintf(fh, "%3i %3i %3i %f %f %f\n", h, k, l, intensity,
+ 0.0, s/1.0e9);
}
}
@@ -100,11 +101,12 @@ double *read_reflections(const char *filename)
do {
char line[1024];
- signed int h, k, l, intensity;
+ signed int h, k, l;
+ float intensity;
int r;
rval = fgets(line, 1023, fh);
- r = sscanf(line, "%i %i %i %i", &h, &k, &l, &intensity);
+ r = sscanf(line, "%i %i %i %f", &h, &k, &l, &intensity);
if ( r != 4 ) continue;
set_intensity(ref, h, k, l, intensity);