From 6a5422356c15962726df2261aa53354b0ff12662 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Wed, 14 Jul 2010 17:58:55 +0200 Subject: 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. --- src/pattern_sim.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'src/pattern_sim.c') 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"); -- cgit v1.2.3