msr_utility.py 文件源码

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

项目:geo-hpc 作者: itpir 项目源码 文件源码
def update(self, bounds, data):


        ileft = int(round(np.floor((bounds[0] - self.bounds[0]) * 100) / (self.pixel_size * 100)))
        itop = int(round(np.floor((self.bounds[3] - bounds[3]) * 100) / (self.pixel_size * 100)))

        iright = ileft + data.shape[1]
        ibottom = itop + data.shape[0]

        try:

            # add worker surf as slice to sum_mean_surf
            self.grid[itop:ibottom, ileft:iright] += data

        except:
            print "#####"
            print "master: shape ({0}) grid shape ({1}) bounds ({2})".format(self.shape, self.grid.shape, self.bounds)
            print "subset: shape({0} left,right,top,bot ({1})".format(self.grid[itop:ibottom, ileft:iright].shape, (ileft, iright, itop, ibottom))
            print "data: shape ({0}) bounds ({1})".format(data.shape, bounds)
            print "#####"

            raise
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号