modisread.py 文件源码

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

项目:modis-mpf 作者: anjaroesel 项目源码 文件源码
def bowtie_py(modis_img,p,cs):
    print 'removie bowtie effect from image... '
    stripwidth=10000/cs
    #Loop over every x coordinate of the image
    for x in sp.arange(modis_img.shape[1]):
        #Loop over every sanning strip
        overlap=sp.polyval(p,x).round() #get the overlap from the polynom
        if overlap > 0:
            for y in sp.arange(stripwidth,modis_img.shape[0],stripwidth):
                #cut out the current part:
                strippart=modis_img[y:y+stripwidth,x]
                #delete the upper and lower few pixels of the strippart:
                strippart=strippart[int(overlap/2.):-int(round(overlap/2.))]
                #Interpolat to stipwidth length
                f=interp1d(sp.arange(0,len(strippart)),strippart)
                strippart=f(sp.linspace(0,len(strippart)-1,stripwidth))
                #replace the current sick part in the image by the new healthy one
                modis_img[y:y+stripwidth,x]=strippart
    print 'done'
    return modis_img
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号