aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw@bitwiz.org.uk>2013-02-06 20:39:01 +0100
committerThomas White <taw@bitwiz.org.uk>2013-02-06 20:39:01 +0100
commitd9fc791021317d6823078a3f3779a79aa3bc84b4 (patch)
tree44da17fe9ae28a63541c7c43b0eec1d94287047d
parenta1ee07e0887bd23491218301ad440a4ad2efb24f (diff)
Fix process_hkl
-rw-r--r--libcrystfel/src/stream.c4
-rw-r--r--src/partial_sim.c5
-rw-r--r--src/process_hkl.c2
3 files changed, 9 insertions, 2 deletions
diff --git a/libcrystfel/src/stream.c b/libcrystfel/src/stream.c
index fbcbaf2e..877a1824 100644
--- a/libcrystfel/src/stream.c
+++ b/libcrystfel/src/stream.c
@@ -431,6 +431,10 @@ int read_chunk(Stream *st, struct image *image)
} while ( 1 );
+ if ( !feof(st->fh) ) {
+ ERROR("Error reading stream.\n");
+ }
+
return 1; /* Either error or EOF, don't care because we will complain
* on the terminal if it was an error. */
}
diff --git a/src/partial_sim.c b/src/partial_sim.c
index 502e7028..e48c51fa 100644
--- a/src/partial_sim.c
+++ b/src/partial_sim.c
@@ -287,6 +287,8 @@ static void run_job(void *vwargs, int cookie)
/* Give a slightly incorrect cell in the stream */
mess_up_cell(cr, qargs->cnoise);
+
+ image_add_crystal(&wargs->image, cr);
}
@@ -523,8 +525,11 @@ int main(int argc, char *argv[])
image.lambda = ph_en_to_lambda(eV_to_J(beam->photon_energy));
image.div = beam->divergence;
image.bw = beam->bandwidth;
+ image.beam = beam;
image.filename = malloc(256);
image.copyme = NULL;
+ image.crystals = NULL;
+ image.n_crystals = 0;
if ( random_intensities ) {
full = reflist_new();
diff --git a/src/process_hkl.c b/src/process_hkl.c
index e9a8daa5..4ba901e6 100644
--- a/src/process_hkl.c
+++ b/src/process_hkl.c
@@ -327,8 +327,6 @@ static int merge_all(Stream *st, RefList *model, RefList *reference,
} while ( rval == 0 );
- if ( rval ) return 1;
-
for ( refl = first_refl(model, &iter);
refl != NULL;
refl = next_refl(refl, iter) )