aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2020-04-01 14:36:17 +0200
committerThomas White <taw@physics.org>2020-07-29 18:42:57 +0200
commit6f9306896ab99acfbd2fb111449a98bea6dce5e5 (patch)
treefe14bd37c0d45fdf6bac1ee02bcdbd77c4015b5c
parent84cf3017548386058c2a788a065c7ddbad6f117e (diff)
Add DataTemplate to iargs
-rw-r--r--src/indexamajig.c11
-rw-r--r--src/process_image.h1
2 files changed, 11 insertions, 1 deletions
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];