I am trying to perform a simple contrast stretch with python skimage on the image opened with gdal as array of type float32. I first calculate the percentile with:
p2, p98 = np.percentile(arrayF, (P1, P2))
and then try to perform the stretch with:
img_rescale = exposure.rescale_intensity(arrayF, in_range=(p2, p98))
The returned image written to .tiff with GDAL contains only 'ones' and nodata. The cause of the problem might be in data range. For this arrayF it is between 0,0352989 and 1,03559. The script Works fine when stretching the array with values 0 - 255.