def readTodayBands(path,row):
allFiles=sorted(glob.glob(os.path.join(getCurrentDirectory(),'Today',path,row,'*.TIF')))
allRasters=dict([])
fileNumber=1
percent=(fileNumber/len(allFiles))*100
for file in allFiles:
percent=(fileNumber/len(allFiles))*100
sys.stdout.write("\rReading today's bands...%d%%" % percent)
sys.stdout.flush()
bandName=file[file.rfind('_')+1:-4]
sys.stdout.write("\rReading today's bands...%d%%" % percent)
sys.stdout.flush()
allRasters[bandName]=gdal.Open(file,gdalconst.GA_ReadOnly)
fileNumber+=1
todayExtent = getRasterExtent(allRasters['B4'])#saves the extent of today's rasters (they'll match band 4) so that we can crop during the cloudmask backfill
print('')
return(allRasters,todayExtent)
#large function that will back-fill cloudy areas of most recent imagery using historic imagery
评论列表
文章目录