SLIP.py 文件源码

python
阅读 18 收藏 0 点赞 0 评论 0

项目:DRIP-SLIP 作者: NASA-DEVELOP 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号