from osgeo import gdal, gdal_array from scipy import stats import numpy dataset=gdal.Open(someraster) x=dataset.GetRasterBand(1).ReadAsArray() func = stats.norm.pdf(x, loc=m, scale=(s)) #you need to define m & s sqrtx = numpy.sqrt(x) #Write the result out - see http://www.gdal.org/formats_list.html for formats you can write to newdataset=gdal_array.SaveArray(sqrtx,newrasterpath,'GTIFF',prototype=dataset) newdataset.SetProjection(dataset.GetProjectionRef()) newdataset.SetGeoTransform(dataset.GetGeoTransform())
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.