From 6f9306896ab99acfbd2fb111449a98bea6dce5e5 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Wed, 1 Apr 2020 14:36:17 +0200 Subject: Add DataTemplate to iargs --- src/indexamajig.c | 11 ++++++++++- src/process_image.h | 1 + 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/indexamajig.c b/src/indexamajig.c index a03955ba..620026ad 100644 --- a/src/indexamajig.c +++ b/src/indexamajig.c @@ -65,6 +65,7 @@ #include "taketwo.h" #include "im-sandbox.h" #include "image.h" +#include "datatemplate.h" static void add_geom_beam_stuff_to_field_list(struct imagefile_field_list *copyme, @@ -861,7 +862,7 @@ int main(int argc, char *argv[]) return 1; } - /* Load detector geometry */ + /* Load detector geometry (old API) */ args.iargs.det = get_detector_geometry_2(args.geom_filename, args.iargs.beam, &args.iargs.hdf5_peak_path); @@ -873,6 +874,14 @@ int main(int argc, char *argv[]) add_geom_beam_stuff_to_field_list(args.iargs.copyme, args.iargs.det, args.iargs.beam); + /* Load data template (new API) */ + args.iargs.dtempl = data_template_new_from_file(args.geom_filename); + if ( args.iargs.dtempl == NULL ) { + ERROR("Failed to read detector geometry from '%s'" + " (for new API)\n", args.geom_filename); + return 1; + } + /* If no peak path from geometry file, use these (but see later) */ if ( args.iargs.hdf5_peak_path == NULL ) { if ( args.iargs.peaks == PEAK_HDF5 ) { diff --git a/src/process_image.h b/src/process_image.h index a54d9224..debae92e 100644 --- a/src/process_image.h +++ b/src/process_image.h @@ -59,6 +59,7 @@ struct index_args float min_snr; int check_hdf5_snr; struct detector *det; + const DataTemplate *dtempl; IndexingPrivate *ipriv; enum peak_search_method peaks; float tols[6]; -- cgit v1.2.3