From 897f86654afe36f57b7000a25c4489e1e534eede Mon Sep 17 00:00:00 2001 From: Thomas White Date: Sun, 21 Oct 2012 18:08:53 -0700 Subject: hdfsee: Rationalise colour scale calculation, ignore max_adu --- src/hdfsee-render.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/hdfsee-render.c b/src/hdfsee-render.c index 2a7e4d86..c78aa677 100644 --- a/src/hdfsee-render.c +++ b/src/hdfsee-render.c @@ -65,12 +65,14 @@ static float *get_binned_panel(struct image *image, int binning, data = malloc(w*h*sizeof(float)); + *max = 0.0; for ( x=0; x p->max_adu ) tbad = 1; - if ( in_bad_region(image->det, fs, ss) ) tbad = 1; if ( image->flags != NULL ) { @@ -104,17 +104,19 @@ static float *get_binned_panel(struct image *image, int binning, } - if ( !tbad ) { - if ( v > *max ) *max = v; - } if ( tbad ) bad = 1; } } - data[x+w*y] = total / ((double)binning * (double)binning); + val = total / ((double)binning * (double)binning); - if ( bad ) data[x+w*y] = -INFINITY; + if ( bad ) { + data[x+w*y] = -INFINITY; + } else { + data[x+w*y] = val; + if ( val > *max ) *max = val; + } } } -- cgit v1.2.3