diff options
author | Thomas White <taw@bitwiz.org.uk> | 2009-12-16 03:44:35 -0800 |
---|---|---|
committer | Thomas White <taw@bitwiz.org.uk> | 2009-12-16 03:50:40 -0800 |
commit | 5ee02bbd3e86bb6b83a457009ed0a4b5d864dec9 (patch) | |
tree | ac8d3b940e8e6429b38bd472a7ff436e4bd8dec7 /src/hdf5-file.c | |
parent | a97808a51b9e15df23307115ca889e01c604c0dc (diff) |
Fix binning
Diffstat (limited to 'src/hdf5-file.c')
-rw-r--r-- | src/hdf5-file.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/hdf5-file.c b/src/hdf5-file.c index 379bd14e..94845025 100644 --- a/src/hdf5-file.c +++ b/src/hdf5-file.c @@ -127,13 +127,13 @@ static void *hdfile_bin(uint16_t *in, int inw, int inh, for ( xb=0; xb<binning; xb++ ) { for ( yb=0; yb<binning; yb++ ) { - total += in[inh*(binning*x+xb)+((inh-binning*y)+yb)]; + total += in[inh*(binning*x+xb)+binning*y+yb]; } } - data[x+w*y] = total / (binning * binning); - if ( data[x+w*y] > max ) max = data[x+w*y]; + data[y+h*(w-1-x)] = total / (binning * binning); + if ( data[y+h*(w-1-x)] > max ) max = data[y+h*(w-1-x)]; } } |