From b832e3564f7e019dfb3c275621ea4cfdae925375 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Fri, 9 Mar 2012 16:15:26 +0100 Subject: Updates for ADU per eV --- libcrystfel/src/peaks.c | 10 ++-------- tests/integration_check.c | 3 +-- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/libcrystfel/src/peaks.c b/libcrystfel/src/peaks.c index 88497db5..a5b0e907 100644 --- a/libcrystfel/src/peaks.c +++ b/libcrystfel/src/peaks.c @@ -169,20 +169,14 @@ int integrate_peak(struct image *image, int cfs, int css, double bg_mean, bg_var; double bg_tot_sq = 0.0; double var; - struct beam_params *beam; double aduph; - beam = image->beam; - if ( beam != NULL ) { - aduph = image->beam->adu_per_photon; - } else { - aduph = 1.0; - } - p = find_panel(image->det, cfs, css); if ( p == NULL ) return 1; if ( p->no_index ) return 1; + aduph = p->adu_per_eV * ph_lambda_to_eV(image->lambda); + lim = p->integr_radius; mid_lim = 3.0 + lim; out_lim = 6.0 + lim; diff --git a/tests/integration_check.c b/tests/integration_check.c index 80a214d1..57bb3589 100644 --- a/tests/integration_check.c +++ b/tests/integration_check.c @@ -321,8 +321,7 @@ int main(int argc, char *argv[]) image.height = 128; memset(image.data, 0, 128*128*sizeof(float)); - image.beam = calloc(1, sizeof(struct beam_params)); - image.beam->adu_per_photon = 100.0; + image.beam = NULL; /* First check: no intensity -> zero intensity and bg */ integrate_peak(&image, 64, 64, &fsp, &ssp, &intensity, &sigma); -- cgit v1.2.3