New answers tagged

0

I would like to create a new raster that contains the sum of all pixelvalues of the raster contained in a folder. Is it possible? os.chdir(r'C:/TifFolder') li_rasters = [raster for raster in os.listdir(os.getcwd()) if os.path.splitext(raster)[-1] == '.tiff'] #print (li_rasters) #final_band=(r'C:/Users/KIFF/Desktop/These/data/Results/result.tiff') for ...


0

i am using an hyperspectral image with 158 bands. I want to calculate raster. but i get import gdal # Import GDAL library bindings from osgeo.gdalnumeric import * from osgeo.gdalconst import * import pylab as plt import numpy as np import xlrd # The file that we shall be using # Needs to be on current directory filename = ('C:/Users/KIFF/Desktop/These/data/...


0

To resolve this matter after I loaded the new scene using newscn.load([filename_S8]) where filename_S8 = 'S8_in' as I want to read the the thermal band 8 from the Sentinel 3 data product. Then I used this line to access the (76, 76) image array as a numpy array: Arr = newscn[filename_S8] S3_BT = Arr.compute().data print(S3_BT)


0

needed_values = band2.ReadAsArray() needed_values[np.isnan(needed_values)] = -99 needed_values[((needed_values[:, ] <= start_number) | (needed_values[:, ] >= stop_number))] = -99 band2.WriteArray(needed_values) band2.SetNoDataValue(-99)


6

numpy.transpose is one way of doing this. import numpy as np zyx = np.ones((1, 2, 3)) # 1 band, 2 rows, 3 cols yxz = np.transpose(zyx, (1,2,0)) print(yxz.shape) # (2, 3, 1)


Top 50 recent answers are included