From 3fcc518b7efc9fb4e2e6fe95c0bdbf2d1bab035b Mon Sep 17 00:00:00 2001 From: Thomas White Date: Mon, 16 Feb 2015 10:56:45 +0100 Subject: indexamajig: --peaks=cxi instead of --peaks=hdf5 --cxi-hdf5-peaks --- src/indexamajig.c | 8 +++----- src/process_image.c | 18 ++++++++++++++---- src/process_image.h | 2 +- 3 files changed, 18 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/indexamajig.c b/src/indexamajig.c index 4f28aec5..627dfa67 100644 --- a/src/indexamajig.c +++ b/src/indexamajig.c @@ -97,11 +97,9 @@ static void show_help(const char *s) " zaef : Use Zaefferer (2000) gradient detection.\n" " This is the default method.\n" " hdf5 : Get from a table in HDF5 file.\n" +" cxi : Get from CXI format HDF5 file.\n" " --hdf5-peaks=

Find peaks table in HDF5 file here.\n" " Default: /processing/hitfinder/peakinfo\n" -" --cxi-hdf5-peaks Peaks in the HDF5 file are in CXI file format.\n" -" Only used in conjunction with the --hdf5-peaks,\n" -" ignored otherwise." " --integration= Perform final pattern integration using .\n" "\n\n" "For more control over the process, you might need:\n\n" @@ -219,7 +217,6 @@ int main(int argc, char *argv[]) iargs.peaks = PEAK_ZAEF; iargs.beam = &beam; iargs.hdf5_peak_path = strdup("/processing/hitfinder/peakinfo"); - iargs.cxi_hdf5_peaks = 0; iargs.copyme = NULL; iargs.pk_inn = -1.0; iargs.pk_mid = -1.0; @@ -271,7 +268,6 @@ int main(int argc, char *argv[]) {"no-use-saturated", 0, &iargs.use_saturated, 0}, {"no-revalidate", 0, &iargs.no_revalidate, 1}, {"check-hdf5-snr", 0, &iargs.check_hdf5_snr, 1}, - {"cxi-hdf5-peaks", 0, &iargs.cxi_hdf5_peaks, 1}, /* Long-only options which don't actually do anything */ {"no-sat-corr", 0, &iargs.satcorr, 0}, @@ -513,6 +509,8 @@ int main(int argc, char *argv[]) iargs.peaks = PEAK_ZAEF; } else if ( strcmp(speaks, "hdf5") == 0 ) { iargs.peaks = PEAK_HDF5; + } else if ( strcmp(speaks, "cxi") == 0 ) { + iargs.peaks = PEAK_CXI; } else { ERROR("Unrecognised peak detection method '%s'\n", speaks); return 1; diff --git a/src/process_image.c b/src/process_image.c index d5133a0c..847cc9f4 100644 --- a/src/process_image.c +++ b/src/process_image.c @@ -225,10 +225,7 @@ void process_image(const struct index_args *iargs, struct pattern_args *pargs, switch ( iargs->peaks ) { case PEAK_HDF5: - /* Get peaks from HDF5 */ - - if ( get_peaks(&image, hdfile, iargs->hdf5_peak_path, - iargs->cxi_hdf5_peaks, pargs->filename_p_e) ) { + if ( get_peaks(&image, hdfile, iargs->hdf5_peak_path) ) { ERROR("Failed to get peaks from HDF5 file.\n"); } if ( !iargs->no_revalidate ) { @@ -239,6 +236,19 @@ void process_image(const struct index_args *iargs, struct pattern_args *pargs, } break; + case PEAK_CXI: + if ( get_peaks_cxi(&image, hdfile, iargs->hdf5_peak_path, + pargs->filename_p_e) ) { + ERROR("Failed to get peaks from CXI file.\n"); + } + if ( !iargs->no_revalidate ) { + validate_peaks(&image, iargs->min_snr, + iargs->pk_inn, iargs->pk_mid, + iargs->pk_out, iargs->use_saturated, + iargs->check_hdf5_snr); + } + break; + case PEAK_ZAEF: search_peaks(&image, iargs->threshold, iargs->min_gradient, iargs->min_snr, diff --git a/src/process_image.h b/src/process_image.h index 53e2c66a..68254485 100644 --- a/src/process_image.h +++ b/src/process_image.h @@ -41,6 +41,7 @@ enum { PEAK_ZAEF, PEAK_HDF5, + PEAK_CXI, }; @@ -63,7 +64,6 @@ struct index_args float tols[4]; struct beam_params *beam; char *hdf5_peak_path; - int cxi_hdf5_peaks; float pk_inn; float pk_mid; float pk_out; -- cgit v1.2.3