aboutsummaryrefslogtreecommitdiff
path: root/src/pattern_sim.c
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2010-07-14 17:58:55 +0200
committerThomas White <taw@physics.org>2012-02-22 15:26:53 +0100
commit6a5422356c15962726df2261aa53354b0ff12662 (patch)
treeb6c5ae80b837bda38957cef07816b511515ffdcb /src/pattern_sim.c
parent6a476e010468f27e02df6bb90a1ea197bd9d039d (diff)
Reduce the scope of "count"
Lists of counts had pervaded every corner of CrystFEL, being used as markers for the presence of reflections. Now we have a better way of doing this, the ReflItemList, and few parts of the suite apart from process_hkl have any business knowing how many observations were made of a particular reflection.
Diffstat (limited to 'src/pattern_sim.c')
-rw-r--r--src/pattern_sim.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/pattern_sim.c b/src/pattern_sim.c
index 5d59d71b..616eec2c 100644
--- a/src/pattern_sim.c
+++ b/src/pattern_sim.c
@@ -195,7 +195,6 @@ int main(int argc, char *argv[])
int n_images = 1; /* Generate one image by default */
int done = 0;
UnitCell *cell;
- unsigned int *counts;
/* Long options */
const struct option longopts[] = {
@@ -323,17 +322,19 @@ int main(int argc, char *argv[])
STATUS("reflection intensities (with --intensities).\n");
STATUS("I'll simulate a flat intensity distribution.\n");
intensities = NULL;
- counts = NULL;
phases = NULL;
} else {
- counts = new_list_count();
+ ReflItemList *items;
if ( grad == GRADIENT_PHASED ) {
phases = new_list_phase();
} else {
phases = NULL;
}
- intensities = read_reflections(intfile, counts, phases);
+ intensities = new_list_intensity();
+ phases = new_list_phase();
+ items = read_reflections(intfile, intensities, phases, NULL);
free(intfile);
+ delete_items(items);
}
/* Define image parameters */
@@ -401,12 +402,12 @@ int main(int argc, char *argv[])
if ( config_gpu ) {
if ( gctx == NULL ) {
gctx = setup_gpu(config_nosfac, &image,
- intensities, counts);
+ intensities);
}
get_diffraction_gpu(gctx, &image, na, nb, nc, cell);
} else {
- get_diffraction(&image, na, nb, nc, intensities, counts,
- phases, cell, !config_nowater, grad);
+ get_diffraction(&image, na, nb, nc, intensities, phases,
+ cell, !config_nowater, grad);
}
if ( image.data == NULL ) {
ERROR("Diffraction calculation failed.\n");