aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2016-08-10 12:09:33 +0200
committerThomas White <taw@physics.org>2016-08-10 12:09:33 +0200
commitdd5d51821a47a822a3c707143ff3979e566cfbbb (patch)
tree801edd7e95df6e93ae7d1319171c024e8e047bd5 /src
parent838283a04af3338799acdd5eba79ce3b3042635a (diff)
Allow peak table location to be given in geometry file
Diffstat (limited to 'src')
-rw-r--r--src/indexamajig.c30
1 files changed, 20 insertions, 10 deletions
diff --git a/src/indexamajig.c b/src/indexamajig.c
index 9b32900f..a1997b9e 100644
--- a/src/indexamajig.c
+++ b/src/indexamajig.c
@@ -200,6 +200,7 @@ int main(int argc, char *argv[])
int have_push_res = 0;
int len;
int no_refine = 0;
+ char *command_line_peak_path = NULL;
/* Defaults */
iargs.cell = NULL;
@@ -394,8 +395,8 @@ int main(int argc, char *argv[])
break;
case 9 :
- free(iargs.hdf5_peak_path);
- iargs.hdf5_peak_path = strdup(optarg);
+ free(command_line_peak_path);
+ command_line_peak_path = strdup(optarg);
break;
case 10 :
@@ -549,13 +550,6 @@ int main(int argc, char *argv[])
return 1;
}
free(speaks);
- if ( iargs.hdf5_peak_path == NULL ) {
- if ( iargs.peaks == PEAK_HDF5 ) {
- iargs.hdf5_peak_path = strdup("/processing/hitfinder/peakinfo");
- } else if ( iargs.peaks == PEAK_CXI ) {
- iargs.hdf5_peak_path = strdup("/entry_1/result_1");
- }
- }
/* Check prefix (if given) */
if ( prefix == NULL ) {
@@ -573,7 +567,8 @@ int main(int argc, char *argv[])
}
/* Load detector geometry */
- iargs.det = get_detector_geometry(geom_filename, iargs.beam);
+ iargs.det = get_detector_geometry_2(geom_filename, iargs.beam,
+ &iargs.hdf5_peak_path);
if ( iargs.det == NULL ) {
ERROR("Failed to read detector geometry from '%s'\n",
geom_filename);
@@ -581,6 +576,21 @@ int main(int argc, char *argv[])
}
add_geom_beam_stuff_to_copy_hdf5(iargs.copyme, iargs.det, iargs.beam);
+ /* If no peak path from geometry file, use these (but see later) */
+ if ( iargs.hdf5_peak_path == NULL ) {
+ if ( iargs.peaks == PEAK_HDF5 ) {
+ iargs.hdf5_peak_path = strdup("/processing/hitfinder/peakinfo");
+ } else if ( iargs.peaks == PEAK_CXI ) {
+ iargs.hdf5_peak_path = strdup("/entry_1/result_1");
+ }
+ }
+
+ /* If an HDF5 peak path was given on the command line, use it */
+ if ( command_line_peak_path != NULL ) {
+ free(iargs.hdf5_peak_path);
+ iargs.hdf5_peak_path = command_line_peak_path;
+ }
+
/* Parse indexing methods */
if ( indm_str == NULL ) {