3

I have a set of about 25 rasters whose descriptive statistics I have been examining. The data in the rasters were calculated in Python and the rasters were created using Python-GDAL.

In all but one raster, the mean, std. dev., minimum and maximum seem correct. In one raster, however, the minimum and maximum values are correct (4.842 and 9.458 respectively) but the mean and standard deviation are -1 if I take a look in ArcCatalog and -1.#IND in QGIS.

I opened the raster in Python via GDAL and calculated the minimum and maximum using data[data>band.GetNoDataValue()].min() and data[data>band.GetNoDataValue()].max() respectively, and the values these functions returned were correct (as above). But the mean value via data[data>band.GetNoDataValue()].mean() was 2.905, which is clearly nonsense as this value does not occur within the minimum and maximum value limits for this raster. Any ideas as to what's going wrong?

  • Is there a .aux.xml file associated with the file? If so delete it and run gdalinfo -stats again. What file format? – user10353 Oct 11 '13 at 16:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.