I am confused about why if I open a band with GDAL I get, for example,
band.GetMaximun(): 1000, but if I do
ReadAsArray I get
myArray.max(): 1200 (the same if I do
np.max(myArray)). Does someone knows why this difference?
The difference is most likely due to outdated statistics in your GeoTiff.
band.GetMaximum() will read the value from the precomputed statistics, which are included in the GeoTiff.
If you want to update the statistics you can either use
gdalinfo -stats or do it with the Python bindings, provided you have write access to the file.
from osgeo import gdal ds = gdal.Open("myGeo.tif", gdal.GA_Update) ds.GetRasterBand(1).ComputeStatistics()