When I open a raster stack with GDAL and call it as a numpy array, lines with 'no data values' also appear. Since I do not want to include these 'no data values' (mine is 128) in the calculations I will make, I am looking for a way to prevent.
Is there a way to prevent 'no data values' from getting into numpy arrays when opening the raster stack? Or what would you recommend?
My codes are here:
outvrt = ('result/raster_stack_vrt.tif')
outtif = ('result/raster_stack.tif')
tifs = glob.glob('data/*.tif')
outds = gdal.BuildVRT(outvrt, tifs, separate = True)
outds = gdal.Translate(outtif, outds)