diff options
-rw-r--r-- | doc/man/indexamajig.1 | 11 | ||||
-rw-r--r-- | src/indexamajig.c | 36 | ||||
-rw-r--r-- | src/process_image.c | 65 | ||||
-rw-r--r-- | src/process_image.h | 7 |
4 files changed, 96 insertions, 23 deletions
diff --git a/doc/man/indexamajig.1 b/doc/man/indexamajig.1 index b46b663b..f0431d0d 100644 --- a/doc/man/indexamajig.1 +++ b/doc/man/indexamajig.1 @@ -1,7 +1,7 @@ .\" .\" indexamajig man page .\" -.\" Copyright © 2012-2014 Deutsches Elektronen-Synchrotron DESY, +.\" Copyright © 2012-2015 Deutsches Elektronen-Synchrotron DESY, .\" a research centre of the Helmholtz Association. .\" .\" Part of CrystFEL - crystallography with a FEL @@ -326,6 +326,15 @@ When \fBrescut\fR is in the integration method, integrate \fIn\fR nm^-1 higher t Mark all pixels on the detector higher than \fIn\fR Angstroms as bad. This might be useful when you have noisy patterns and don't expect any signal above a certain resolution. +.PD 0 +.IP \fB--fix-profile-radius=\fIn\fR +.IP \fB--fix-bandwidth=\fIn\fR +.IP \fB--fix-divergence=\fIn\fR +.PD +Fix the beam and crystal paramters to the given values. The profile radius is given in m^-1, the bandwidth as a decimal fraction and the divergence in radians (full angle). The default is to set the divergence to zero, the bandwidth to a very small value, and then to automatically determine the profile radius. +.IP +You do not have to use all three of these options together. For example, if the automatic profile radius determination is not working well for your data set, you could fix that alone and continue using the default values for the other parameters (which might be automatically determined in future versions of CrystFEL, but are not currently). + .SH IDENTIFYING SINGLE PATTERNS IN THE INPUT FILE By default indexamajig processes all diffraction patterns ("events") in each of the data files listed in the input list. It is however, possible, to only process single events in a multi-event file, by adding in the list an event description string after the data filename. The event description always includes a first section with alphanumeric strings separated by forward slashes ("/") and a second section with integer numbers also separated by forward slashes. The two sections are in turn separated by a double forward slash ('//'). Any of the two sections can be empty, but the double forward slash separator must always be present. Indexamajig matches the strings and the numbers in the event description with the event placeholders ('%') present respectively in the 'data' and 'dim' properties defined in the geometry file, and tries to retrieve the full HDF path to the event data and the the its location in a multi-dimensional data space. Consider the following examples: diff --git a/src/indexamajig.c b/src/indexamajig.c index 44f067e2..4f28aec5 100644 --- a/src/indexamajig.c +++ b/src/indexamajig.c @@ -3,13 +3,13 @@ * * Index patterns, output hkl+intensity etc. * - * Copyright © 2012-2014 Deutsches Elektronen-Synchrotron DESY, + * Copyright © 2012-2015 Deutsches Elektronen-Synchrotron DESY, * a research centre of the Helmholtz Association. * Copyright © 2012 Richard Kirian * Copyright © 2012 Lorenzo Galli * * Authors: - * 2010-2014 Thomas White <taw@physics.org> + * 2010-2015 Thomas White <taw@physics.org> * 2011 Richard Kirian * 2012 Lorenzo Galli * 2012 Chunhong Yoon @@ -127,6 +127,10 @@ static void show_help(const char *s) " --int-radius=<r> Set the integration radii. Default: 4,5,7.\n" " --push-res=<n> Integrate higher than apparent resolution cutoff.\n" " --highres=<n> Absolute resolution cutoff in Angstroms.\n" +" --fix-profile-radius Fix the reciprocal space profile radius for spot\n" +" prediction (default: automatically determine.\n" +" --fix-bandwidth Set the bandwidth for spot prediction.\n" +" --fix-divergence Set the divergence (full angle) for spot prediction.\n" "\n" "\nFor time-resolved stuff, you might want to use:\n\n" " --copy-hdf5-field <f> Copy the value of field <f> into the stream. You\n" @@ -238,6 +242,9 @@ int main(int argc, char *argv[]) iargs.int_meth = integration_method("rings-nocen", NULL); iargs.push_res = 0.0; iargs.highres = +INFINITY; + iargs.fix_profile_r = -1.0; + iargs.fix_bandwidth = -1.0; + iargs.fix_divergence = -1.0; /* Long options */ const struct option longopts[] = { @@ -293,6 +300,9 @@ int main(int argc, char *argv[]) {"res-push", 1, NULL, 19}, /* compat */ {"peak-radius", 1, NULL, 20}, {"highres", 1, NULL, 21}, + {"fix-profile-radius", 1, NULL, 22}, + {"fix-bandwidth", 1, NULL, 23}, + {"fix-divergence", 1, NULL, 24}, {0, 0, NULL, 0} }; @@ -440,6 +450,28 @@ int main(int argc, char *argv[]) iargs.highres = 1.0 / (iargs.highres/1e10); break; + case 22 : + if ( sscanf(optarg, "%f", &iargs.fix_profile_r) != 1 ) { + ERROR("Invalid value for " + "--fix-profile-radius\n"); + return 1; + } + break; + + case 23 : + if ( sscanf(optarg, "%f", &iargs.fix_bandwidth) != 1 ) { + ERROR("Invalid value for --fix-bandwidth\n"); + return 1; + } + break; + + case 24 : + if ( sscanf(optarg, "%f", &iargs.fix_divergence) != 1 ) { + ERROR("Invalid value for --fix-divergence\n"); + return 1; + } + break; + case 0 : break; diff --git a/src/process_image.c b/src/process_image.c index 84c3e996..2f6aa70f 100644 --- a/src/process_image.c +++ b/src/process_image.c @@ -279,31 +279,60 @@ void process_image(const struct index_args *iargs, struct pattern_args *pargs, crystal_set_image(image.crystals[i], &image); } - /* Default parameters */ - image.div = 0.0; - image.bw = 0.00000001; - for ( i=0; i<image.n_crystals; i++ ) { - crystal_set_profile_radius(image.crystals[i], 0.01e9); - crystal_set_mosaicity(image.crystals[i], 0.0); /* radians */ + /* Set beam/crystal parameters */ + if ( iargs->fix_divergence >= 0.0 ) { + image.div = iargs->fix_divergence; + } else { + image.div = 0.0; + } + if ( iargs->fix_bandwidth >= 0.0 ) { + image.bw = iargs->fix_bandwidth; + } else { + image.bw = 0.00000001; + } + if ( iargs->fix_profile_r >= 0.0 ) { + for ( i=0; i<image.n_crystals; i++ ) { + crystal_set_profile_radius(image.crystals[i], + iargs->fix_profile_r); + crystal_set_mosaicity(image.crystals[i], 0.0); + } + } else { + for ( i=0; i<image.n_crystals; i++ ) { + crystal_set_profile_radius(image.crystals[i], 0.01e9); + crystal_set_mosaicity(image.crystals[i], 0.0); + } } /* Integrate all the crystals at once - need all the crystals so that * overlaps can be detected. */ - integrate_all_4(&image, iargs->int_meth, PMODEL_SCSPHERE, iargs->push_res, - iargs->ir_inn, iargs->ir_mid, iargs->ir_out, - INTDIAG_NONE, 0, 0, 0, results_pipe); + if ( iargs->fix_profile_r < 0.0 ) { - for ( i=0; i<image.n_crystals; i++ ) { - refine_radius(image.crystals[i], image.features); - reflist_free(crystal_get_reflections(image.crystals[i])); - } + integrate_all_4(&image, iargs->int_meth, PMODEL_SCSPHERE, + iargs->push_res, + iargs->ir_inn, iargs->ir_mid, iargs->ir_out, + INTDIAG_NONE, 0, 0, 0, results_pipe); + + for ( i=0; i<image.n_crystals; i++ ) { + refine_radius(image.crystals[i], image.features); + reflist_free(crystal_get_reflections(image.crystals[i])); + } - integrate_all_4(&image, iargs->int_meth, PMODEL_SCSPHERE, + integrate_all_4(&image, iargs->int_meth, PMODEL_SCSPHERE, iargs->push_res, - iargs->ir_inn, iargs->ir_mid, iargs->ir_out, - iargs->int_diag, iargs->int_diag_h, - iargs->int_diag_k, iargs->int_diag_l, - results_pipe); + iargs->ir_inn, iargs->ir_mid, iargs->ir_out, + iargs->int_diag, iargs->int_diag_h, + iargs->int_diag_k, iargs->int_diag_l, + results_pipe); + } else { + + integrate_all_4(&image, iargs->int_meth, PMODEL_SCSPHERE, + iargs->push_res, + iargs->ir_inn, iargs->ir_mid, iargs->ir_out, + iargs->int_diag, iargs->int_diag_h, + iargs->int_diag_k, iargs->int_diag_l, + results_pipe); + + } ret = write_chunk(st, &image, hdfile, iargs->stream_peaks, iargs->stream_refls, diff --git a/src/process_image.h b/src/process_image.h index a0bd6a83..53e2c66a 100644 --- a/src/process_image.h +++ b/src/process_image.h @@ -3,11 +3,11 @@ * * The processing pipeline for one image * - * Copyright © 2012-2014 Deutsches Elektronen-Synchrotron DESY, + * Copyright © 2012-2015 Deutsches Elektronen-Synchrotron DESY, * a research centre of the Helmholtz Association. * * Authors: - * 2010-2014 Thomas White <taw@physics.org> + * 2010-2015 Thomas White <taw@physics.org> * 2014 Valerio Mariani * * This file is part of CrystFEL. @@ -83,6 +83,9 @@ struct index_args signed int int_diag_l; float push_res; float highres; + float fix_profile_r; + float fix_bandwidth; + float fix_divergence; }; |