aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2015-02-11 17:23:48 +0100
committerThomas White <taw@physics.org>2015-02-12 12:55:56 +0100
commit0572dad2b5d1657090b266a8955f7f06cc8dd5d1 (patch)
treebd22df0514f764aaed4cafc747ffca2629aa1f79 /src
parent80436c5dfb94c27af3a382a7f49ee3c002792ec9 (diff)
indexamajig: Add --fix-{profile-radius,bandwidth,divergence}
Diffstat (limited to 'src')
-rw-r--r--src/indexamajig.c36
-rw-r--r--src/process_image.c65
-rw-r--r--src/process_image.h7
3 files changed, 86 insertions, 22 deletions
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;
};