aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2014-06-20 10:54:39 +0200
committerThomas White <taw@physics.org>2014-06-20 10:58:27 +0200
commit7b14415fddc76710352a906c0e1a3e86273e9f08 (patch)
tree0892e47cf0ed0ae105a189a8ebf2418edf3a60cd
parent162b0c7a8a8a7c91a4c12e75577ec33aef03b1ce (diff)
indexamajig: Add --peak-radius
-rw-r--r--doc/man/indexamajig.16
-rw-r--r--src/indexamajig.c31
-rw-r--r--src/process_image.c6
-rw-r--r--src/process_image.h3
4 files changed, 41 insertions, 5 deletions
diff --git a/doc/man/indexamajig.1 b/doc/man/indexamajig.1
index b151438c..01c07330 100644
--- a/doc/man/indexamajig.1
+++ b/doc/man/indexamajig.1
@@ -210,6 +210,12 @@ Read the unit cell for comparison from the CRYST1 line of the PDB file called \f
Get the image data to display from \fIpath\fR inside the HDF5 file. For example: \fI/data/rawdata\fR. If this is not specified, the default behaviour is to use the first two-dimensional dataset with both dimensions greater than 64.
.PD 0
+.IP \fB--peak-radius=\fR\fIinner,middle,outer\fR
+.PD
+Set the inner, middle and outer radii for three-ring integration during the peak search. See the section about \fBPEAK INTEGRATION\fR, above, for details of how to determine
+these. The default is to use the same values as for \fB--int-radius\fR.
+
+.PD 0
.IP \fB--int-radius=\fR\fIinner,middle,outer\fR
.PD
Set the inner, middle and outer radii for three-ring integration. See the
diff --git a/src/indexamajig.c b/src/indexamajig.c
index 607e8b0c..d75e24be 100644
--- a/src/indexamajig.c
+++ b/src/indexamajig.c
@@ -124,6 +124,7 @@ static void show_help(const char *s)
" --min-snr=<n> Minimum signal-to-noise ratio for peaks.\n"
" Default: 5.\n"
" --check-hdf5-snr Check SNR for peaks from --peaks=hdf5.\n"
+" --peak-radius=<r> Integration radii for peak search.\n"
" --int-radius=<r> Set the integration radii. Default: 4,5,7.\n"
"-e, --image=<element> Use this image from the HDF5 file.\n"
" Example: /data/data0.\n"
@@ -192,6 +193,7 @@ int main(int argc, char *argv[])
int n_proc = 1;
struct index_args iargs;
char *intrad = NULL;
+ char *pkrad = NULL;
char *int_str = NULL;
char *tempdir = NULL;
char *int_diag = NULL;
@@ -215,6 +217,9 @@ int main(int argc, char *argv[])
iargs.element = NULL;
iargs.hdf5_peak_path = strdup("/processing/hitfinder/peakinfo");
iargs.copyme = NULL;
+ iargs.pk_inn = -1.0;
+ iargs.pk_mid = -1.0;
+ iargs.pk_out = -1.0;
iargs.ir_inn = 4.0;
iargs.ir_mid = 5.0;
iargs.ir_out = 7.0;
@@ -249,7 +254,7 @@ int main(int argc, char *argv[])
{"image", 1, NULL, 'e'},
/* Long-only options with no arguments */
- {"version", 0, NULL, 20},
+ {"version", 0, NULL, 99},
{"filter-noise", 0, &iargs.noisefilter, 1},
{"no-check-prefix", 0, &config_checkprefix, 0},
{"basename", 0, &config_basename, 1},
@@ -285,6 +290,7 @@ int main(int argc, char *argv[])
{"int-diag", 1, NULL, 18},
{"push-res", 1, NULL, 19},
{"res-push", 1, NULL, 19}, /* compat */
+ {"peak-radius", 1, NULL, 20},
{0, 0, NULL, 0}
};
@@ -299,7 +305,7 @@ int main(int argc, char *argv[])
show_help(argv[0]);
return 0;
- case 20 :
+ case 99 :
printf("CrystFEL: " CRYSTFEL_VERSIONSTRING "\n");
printf(CRYSTFEL_BOILERPLATE"\n");
return 0;
@@ -430,6 +436,10 @@ int main(int argc, char *argv[])
iargs.push_res *= 1e9; /* nm^-1 -> m^-1 */
break;
+ case 20 :
+ pkrad = strdup(optarg);
+ break;
+
case 0 :
break;
@@ -551,6 +561,23 @@ int main(int argc, char *argv[])
" probably not appropriate for your patterns.\n");
}
+ if ( pkrad != NULL ) {
+ int r;
+ r = sscanf(pkrad, "%f,%f,%f",
+ &iargs.pk_inn, &iargs.pk_mid, &iargs.pk_out);
+ if ( r != 3 ) {
+ ERROR("Invalid parameters for '--peak-radius'\n");
+ return 1;
+ }
+ free(pkrad);
+ }
+
+ if ( iargs.pk_inn < 0.0 ) {
+ iargs.pk_inn = iargs.ir_inn;
+ iargs.pk_mid = iargs.ir_mid;
+ iargs.pk_out = iargs.ir_out;
+ }
+
if ( iargs.det == NULL ) {
ERROR("You need to provide a geometry file (please read the"
" manual for more details).\n");
diff --git a/src/process_image.c b/src/process_image.c
index ba68021a..4751073b 100644
--- a/src/process_image.c
+++ b/src/process_image.c
@@ -127,8 +127,8 @@ void process_image(const struct index_args *iargs, struct pattern_args *pargs,
}
if ( !iargs->no_revalidate ) {
validate_peaks(&image, iargs->min_snr,
- iargs->ir_inn, iargs->ir_mid,
- iargs->ir_out, iargs->use_saturated,
+ iargs->pk_inn, iargs->pk_mid,
+ iargs->pk_out, iargs->use_saturated,
iargs->check_hdf5_snr);
}
break;
@@ -136,7 +136,7 @@ void process_image(const struct index_args *iargs, struct pattern_args *pargs,
case PEAK_ZAEF:
search_peaks(&image, iargs->threshold,
iargs->min_gradient, iargs->min_snr,
- iargs->ir_inn, iargs->ir_mid, iargs->ir_out,
+ iargs->pk_inn, iargs->pk_mid,iargs->pk_out,
iargs->use_saturated);
break;
diff --git a/src/process_image.h b/src/process_image.h
index b8ded1ed..1a8a9ff3 100644
--- a/src/process_image.h
+++ b/src/process_image.h
@@ -63,6 +63,9 @@ struct index_args
struct beam_params *beam;
char *element;
char *hdf5_peak_path;
+ float pk_inn;
+ float pk_mid;
+ float pk_out;
float ir_inn;
float ir_mid;
float ir_out;