modisread.py 文件源码

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

项目:modis-mpf 作者: anjaroesel 项目源码 文件源码
def read_band(fileObj,key,b,d):
    '''reads MODIS data,scale them with the Solar Zenith and returns one band'''
    print 'read image '+str(b)+' from dataset '+str(key) +'... '
    dsObj=fileObj.select(key)
    B=sp.array(dsObj.get(),sp.float32) # float32
    attr=dsObj.attributes()
    scale=attr['reflectance_scales'][b]
    offset=attr['reflectance_offsets'][b]
    dn=B[b,:,:]
    bad_ind=(dn>=32767).nonzero() # Bit16 zeigt fehlerhafte Messungen an
    band=(scale*(dn-offset))/sp.cos(d['SolarZenith'])
    band[bad_ind]=0
    print ' done'
    return band
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号