From 2d4c3d1fbcc8a27dbb14cfcd26c5fadd48fb9e3c Mon Sep 17 00:00:00 2001 From: Thomas White Date: Wed, 16 Mar 2011 11:15:23 +0100 Subject: cubeit: Use new stream format --- src/cubeit.c | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/cubeit.c b/src/cubeit.c index 608f0e48..2fc41698 100644 --- a/src/cubeit.c +++ b/src/cubeit.c @@ -3,7 +3,7 @@ * * "Full integration" of diffraction data * - * (c) 2006-2010 Thomas White + * (c) 2006-2011 Thomas White * * Part of CrystFEL - crystallography with a FEL * @@ -388,31 +388,36 @@ static void *get_image(void *qp) { struct sum_args *pargs; struct queue_args *qargs = qp; - UnitCell *cell; - char *filename; - double ph_ev; + struct image image; /* Get the next filename */ - if ( find_chunk(qargs->fh, &cell, &filename, &ph_ev) ) { + if ( read_chunk(qargs->fh, &image) == 1 ) { + ERROR("Failed to read chunk from the input stream.\n"); return NULL; } + /* Won't be needing these */ + image_feature_list_free(image.features); + image.features = NULL; + reflist_free(image.reflections); + + pargs = malloc(sizeof(struct sum_args)); if ( qargs->config_basename ) { char *tmp; - tmp = safe_basename(filename); - free(filename); - filename = tmp; + tmp = safe_basename(image.filename); + free(image.filename); + image.filename = tmp; } memcpy(&pargs->static_args, &qargs->static_args, sizeof(struct static_sum_args)); - pargs->cell = cell; + pargs->cell = image.indexed_cell; pargs->filename = malloc(1024); - snprintf(pargs->filename, 1023, "%s%s", qargs->prefix, filename); - free(filename); + snprintf(pargs->filename, 1023, "%s%s", qargs->prefix, image.filename); + free(image.filename); return pargs; } -- cgit v1.2.3