aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2022-08-22 15:47:53 +0200
committerThomas White <taw@physics.org>2022-08-22 15:47:53 +0200
commit1179bed2ebc892dc918aae09dae586c516d0e36e (patch)
treef9d583ca2d4bb4987dda7602dd7e49fa4b3e147f
parent0046aebc2cd466fd4a7a3a01ddf82e04376de062 (diff)
image_create_dp_bad_sat: Initialise saturation array to infinity
-rw-r--r--libcrystfel/src/image.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libcrystfel/src/image.c b/libcrystfel/src/image.c
index 3593f52b..3448421e 100644
--- a/libcrystfel/src/image.c
+++ b/libcrystfel/src/image.c
@@ -764,6 +764,7 @@ int image_create_dp_bad_sat(struct image *image,
for ( i=0; i<dtempl->n_panels; i++ ) {
+ int j;
size_t nel = PANEL_WIDTH(&dtempl->panels[i]) * PANEL_HEIGHT(&dtempl->panels[i]);
image->dp[i] = malloc(nel*sizeof(float));
@@ -785,6 +786,10 @@ int image_create_dp_bad_sat(struct image *image,
return 1;
}
+ for ( j=0; j<nel; j++ ) {
+ image->sat[i][j] = INFINITY;
+ }
+
}
return 0;