aboutsummaryrefslogtreecommitdiff
path: root/libcrystfel/src/peaks.c
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2012-11-28 16:31:19 +0100
committerThomas White <taw@physics.org>2012-11-29 12:01:20 +0100
commit483e3d5883461f0572a181211b6aa306fd2bfdc0 (patch)
tree2ff96dfecc0e82aab5ad6dc231d37798cedc43dc /libcrystfel/src/peaks.c
parent1d7ab9644999e4ec44bd90fdd249515bf05770b3 (diff)
indexamajig: Add --integrate-saturated
Diffstat (limited to 'libcrystfel/src/peaks.c')
-rw-r--r--libcrystfel/src/peaks.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/libcrystfel/src/peaks.c b/libcrystfel/src/peaks.c
index bf6a92f0..f13c7245 100644
--- a/libcrystfel/src/peaks.c
+++ b/libcrystfel/src/peaks.c
@@ -293,10 +293,9 @@ static int integrate_peak(struct image *image, int cfs, int css,
val = image->data[idx];
- /* Veto peak if it contains saturation in bg region */
+ /* Check if peak contains saturation in bg region */
if ( use_max_adu && (val > p->max_adu) ) {
if ( saturated != NULL ) *saturated = 1;
- return 1;
}
bg_tot += val;
@@ -353,10 +352,9 @@ static int integrate_peak(struct image *image, int cfs, int css,
val = image->data[idx] - bg_mean;
- /* Veto peak if it contains saturation */
+ /* Check if peak contains saturation */
if ( use_max_adu && (val > p->max_adu) ) {
if ( saturated != NULL ) *saturated = 1;
- return 1;
}
pk_counts++;
@@ -697,7 +695,8 @@ static struct integr_ind *sort_reflections(RefList *list, UnitCell *cell,
/* Integrate the list of predicted reflections in "image" */
void integrate_reflections(struct image *image, int use_closer, int bgsub,
double min_snr,
- double ir_inn, double ir_mid, double ir_out)
+ double ir_inn, double ir_mid, double ir_out,
+ int integrate_saturated)
{
struct integr_ind *il;
int n, i;
@@ -794,7 +793,10 @@ void integrate_reflections(struct image *image, int use_closer, int bgsub,
&intensity, &sigma, ir_inn, ir_mid, ir_out,
1, bgMasks[pnum], &saturated);
- if ( saturated ) image->n_saturated++;
+ if ( saturated ) {
+ image->n_saturated++;
+ if ( !integrate_saturated ) r = 1;
+ }
/* I/sigma(I) cutoff */
if ( intensity/sigma < min_snr ) r = 1;