aboutsummaryrefslogtreecommitdiff
path: root/libcrystfel/src/peaks.c
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2012-06-07 14:49:28 +0200
committerThomas White <taw@physics.org>2012-06-07 14:49:28 +0200
commit53cf97428ebfc7f53fee5970342a836bf45017ec (patch)
tree76a6b7fa45ee479f837c01cd4095494508ddb5a9 /libcrystfel/src/peaks.c
parentb6e0b7972e3dbdace0034d439b992faf3ac8c454 (diff)
Use max_adu only for final integration
Saturated pixels seem to be OK during initial peak search
Diffstat (limited to 'libcrystfel/src/peaks.c')
-rw-r--r--libcrystfel/src/peaks.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/libcrystfel/src/peaks.c b/libcrystfel/src/peaks.c
index 477d9345..670e02bb 100644
--- a/libcrystfel/src/peaks.c
+++ b/libcrystfel/src/peaks.c
@@ -151,7 +151,8 @@ static int cull_peaks(struct image *image)
static int integrate_peak(struct image *image, int cfs, int css,
double *pfs, double *pss,
double *intensity, double *sigma,
- double ir_inn, double ir_mid, double ir_out)
+ double ir_inn, double ir_mid, double ir_out,
+ int use_max_adu)
{
signed int fs, ss;
double lim_sq, out_lim_sq, mid_lim_sq;
@@ -212,7 +213,7 @@ static int integrate_peak(struct image *image, int cfs, int css,
val = image->data[idx];
/* Veto peak if it contains saturation in bg region */
- if ( val > p->max_adu ) return 1;
+ if ( use_max_adu && (val > p->max_adu) ) return 1;
bg_tot += val;
bg_tot_sq += pow(val, 2.0);
@@ -263,7 +264,7 @@ static int integrate_peak(struct image *image, int cfs, int css,
val = image->data[idx] - bg_mean;
/* Veto peak if it contains saturation */
- if ( image->data[idx] > p->max_adu ) return 1;
+ if ( use_max_adu && (image->data[idx] > p->max_adu) ) return 1;
pk_counts++;
pk_total += val;
@@ -398,7 +399,7 @@ static void search_peaks_in_panel(struct image *image, float threshold,
/* Centroid peak and get better coordinates. */
r = integrate_peak(image, mask_fs, mask_ss,
&f_fs, &f_ss, &intensity, &sigma,
- ir_inn, ir_mid, ir_out);
+ ir_inn, ir_mid, ir_out, 0);
if ( r ) {
/* Bad region - don't detect peak */
@@ -656,7 +657,8 @@ void integrate_reflections(struct image *image, int use_closer, int bgsub,
}
r = integrate_peak(image, pfs, pss, &fs, &ss,
- &intensity, &sigma, ir_inn, ir_mid, ir_out);
+ &intensity, &sigma, ir_inn, ir_mid, ir_out,
+ 1);
/* Record intensity and set redundancy to 1 on success */
if ( r == 0 ) {