From d94e9bfa02bc1ee2f0e14132ea9f5f9d2689c757 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Wed, 19 Aug 2020 12:27:18 +0200 Subject: Make Stream responsible for its own DataTemplate It makes no sense for a different DataTemplate to be used for every frame in a stream. And this way makes everything much easier for users ot the API. --- src/process_hkl.c | 23 ++++------------------- 1 file changed, 4 insertions(+), 19 deletions(-) (limited to 'src/process_hkl.c') diff --git a/src/process_hkl.c b/src/process_hkl.c index 352bea4a..812903a2 100644 --- a/src/process_hkl.c +++ b/src/process_hkl.c @@ -397,7 +397,7 @@ static void display_progress(int n_images, int n_crystals, int n_crystals_used) } -static int merge_all(Stream *st, DataTemplate *dtempl, +static int merge_all(Stream *st, RefList *model, RefList *reference, const SymOpList *sym, double **hist_vals, signed int hist_h, @@ -431,7 +431,7 @@ static int merge_all(Stream *st, DataTemplate *dtempl, int i; /* Get data from next chunk */ - image = stream_read_chunk(st, dtempl, + image = stream_read_chunk(st, STREAM_REFLECTIONS | STREAM_UNITCELL); if ( image == NULL ) break; @@ -517,8 +517,6 @@ int main(int argc, char *argv[]) int hist_i; int space_for_hist = 0; char *histo_params = NULL; - const char *geom_str; - DataTemplate *dtempl; struct polarisation polarisation = {.fraction = 1.0, .angle = 0.0, .disable = 0}; @@ -730,19 +728,6 @@ int main(int argc, char *argv[]) return 1; } - geom_str = stream_geometry_file(st); - if ( geom_str == NULL ) { - ERROR("No geometry file found in stream\n"); - stream_close(st); - return 1; - } - - dtempl = data_template_new_from_string(geom_str); - if ( dtempl == NULL ) { - stream_close(st); - return 1; - } - model = reflist_new(); if ( histo != NULL ) { @@ -799,7 +784,7 @@ int main(int argc, char *argv[]) if ( config_scale ) twopass = 1; hist_i = 0; - r = merge_all(st, dtempl, model, NULL, sym, + r = merge_all(st, model, NULL, sym, &hist_vals, hist_h, hist_k, hist_l, &hist_i, polarisation, min_measurements, min_snr, max_adu, start_after, stop_after, min_res, push_res, @@ -834,7 +819,7 @@ int main(int argc, char *argv[]) hist_i = 0; } - r = merge_all(st, dtempl, model, reference, sym, &hist_vals, + r = merge_all(st, model, reference, sym, &hist_vals, hist_h, hist_k, hist_l, &hist_i, polarisation, min_measurements, min_snr, max_adu, start_after, stop_after, min_res, -- cgit v1.2.3