aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2011-11-14 14:21:08 +0100
committerThomas White <taw@physics.org>2012-02-22 15:27:39 +0100
commit42e6b6387fc6e166bd493360ec89dda83ed9c2c6 (patch)
treeb1fcf1384ac4258b56c8ee2692dddc59e5239a32 /src
parent69632c5f4c08a255507a76f081c2fbb05c6a2184 (diff)
indexamajig: Pass the beam parameters properly
Diffstat (limited to 'src')
-rw-r--r--src/indexamajig.c9
-rw-r--r--src/peaks.c10
2 files changed, 17 insertions, 2 deletions
diff --git a/src/indexamajig.c b/src/indexamajig.c
index 26ea158d..e78eff02 100644
--- a/src/indexamajig.c
+++ b/src/indexamajig.c
@@ -231,7 +231,7 @@ static void process_image(void *pp, int cookie)
int config_verbose = pargs->static_args.config_verbose;
int config_polar = pargs->static_args.config_polar;
IndexingMethod *indm = pargs->static_args.indm;
- const struct beam_params *beam = pargs->static_args.beam;
+ struct beam_params *beam = pargs->static_args.beam;
image.features = NULL;
image.data = NULL;
@@ -241,6 +241,13 @@ static void process_image(void *pp, int cookie)
image.filename = filename;
image.det = copy_geom(pargs->static_args.det);
image.copyme = pargs->static_args.copyme;
+ image.beam = beam;
+
+ if ( beam == NULL ) {
+ ERROR("Warning: no beam parameters file.\n");
+ ERROR("I'm going to assume 1 ADU per photon, which is almost");
+ ERROR(" certainly wrong. Peak sigmas will be incorrect.\n");
+ }
pargs->indexable = 0;
diff --git a/src/peaks.c b/src/peaks.c
index 3d90861b..f1a58d23 100644
--- a/src/peaks.c
+++ b/src/peaks.c
@@ -157,7 +157,15 @@ int integrate_peak(struct image *image, int cfs, int css,
int pixel_counts = 0;
double noise_mean = 0.0;
double noise_meansq = 0.0;
- const double aduph = image->beam->adu_per_photon;
+ 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;