From 3405b5cf407927f648cee59d5e746211888b104b Mon Sep 17 00:00:00 2001 From: Thomas White Date: Thu, 10 Dec 2015 09:25:17 +0100 Subject: Fix integration tests for new saturation map --- libcrystfel/src/integration.c | 6 +++++- tests/integration_check.c | 1 + tests/prof2d_check.c | 1 + 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/libcrystfel/src/integration.c b/libcrystfel/src/integration.c index b3bee120..ce996db7 100644 --- a/libcrystfel/src/integration.c +++ b/libcrystfel/src/integration.c @@ -846,7 +846,11 @@ static int check_box(struct intcontext *ic, struct peak_box *bx, int *sat) } /* Per-pixel saturation value */ - lsat = ic->image->sat[bx->pn][fs + bx->p->w*ss]; + if ( ic->image->sat != NULL ) { + lsat = ic->image->sat[bx->pn][fs + bx->p->w*ss]; + } else { + lsat = INFINITY; + } if ( (bx->bm[p+ic->w*q] != BM_IG) && (bx->bm[p+ic->w*q] != BM_BH) && ((boxi(ic, bx, p, q) > bx->p->max_adu) diff --git a/tests/integration_check.c b/tests/integration_check.c index 2acd0f34..10989cbb 100644 --- a/tests/integration_check.c +++ b/tests/integration_check.c @@ -101,6 +101,7 @@ int main(int argc, char *argv[]) image.bad = malloc(sizeof(int *)); image.bad[0] = malloc(w*h*sizeof(int)); memset(image.bad[0], 0, w*h*sizeof(int)); + image.sat = NULL; image.n_crystals = 0; image.crystals = NULL; diff --git a/tests/prof2d_check.c b/tests/prof2d_check.c index f66b6513..e0534710 100644 --- a/tests/prof2d_check.c +++ b/tests/prof2d_check.c @@ -120,6 +120,7 @@ int main(int argc, char *argv[]) memset(image.dp[0], 0, w*h*sizeof(float)); image.bad[0] = malloc(w*h*sizeof(int)); memset(image.bad[0], 0, w*h*sizeof(int)); + image.sat = NULL; cell = cell_new(); cell_set_lattice_type(cell, L_CUBIC); -- cgit v1.2.3