armatools.py 文件源码

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

项目:hydpy 作者: tyralla 项目源码 文件源码
def update_coefs(self):
        """(Re)calculate the MA coefficients based on the instantaneous
        unit hydrograph."""
        coefs = []
        sum_coefs = 0.
        for t in itertools.count(0., 1.):
            coef = integrate.quad(self.quad, 0., 1., args=(t,))[0]
            sum_coefs += coef
            if (sum_coefs > .9) and (coef < self.smallest_coeff):
                coefs = numpy.array(coefs)
                coefs /= numpy.sum(coefs)
                self.coefs = coefs
                break
            else:
                coefs.append(coef)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号