Hi Juan,
Since I'm dealing with raw files from the camera I'd like to keep my pixel values in integers just like the source format. I multiplied the dumped values * 65535 but this does not result in whole numbers. Because the floats are truncated and I'm not sure how to change that I printed the raw mean values where they get put in the data array:
=> Reading mean sample values for region {200,200,200,200}
Reading FITS image: 16-bit integers, 1 channel(s), 4656x3520 pixels: done
0.005203575316703955
Reading FITS image: 16-bit integers, 1 channel(s), 4656x3520 pixels: done
0.005200042422321341
Reading FITS image: 16-bit integers, 1 channel(s), 4656x3520 pixels: done
0.005201757825855853
Reading FITS image: 16-bit integers, 1 channel(s), 4656x3520 pixels: done
0.005202179120371493
Reading FITS image: 16-bit integers, 1 channel(s), 4656x3520 pixels: done
0.005203593148093765
Multiplying those numbers times 65535 also does not result in whole integers, not even close. The mean of a single integer should be an integer, right? I know you are rescaling 16b int FITS into 0-1 float but that should be reversible.
Can you help me understand what is going on?