crosstalk_deprojection.py 文件源码

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

项目:atoolbox 作者: liweitianux 项目源码 文件源码
def interpolate(self, x=None, verbose=False):
        """
        Interpolate the ARF curve using `scipy.interpolate'

        If the requested point is outside of the data range, the
        fill value of *zero* is returned.

        Arguments:
          * x: points at which the interpolation to be calculated.

        Return:
          If x is None, then the interpolated function is returned,
          otherwise, the interpolated data are returned.
        """
        if not hasattr(self, "f_interp") or self.f_interp is None:
            arf = self.get_data(copy=False)
            if verbose:
                print("INFO: Interpolating ARF '%s' (may take a while) ..." %
                      self.filename)
            f_interp = scipy.interpolate.interp1d(
                self.energy, arf, kind="quadratic", bounds_error=False,
                fill_value=0.0, assume_sorted=True)
            self.f_interp = f_interp

        if x is not None:
            return self.f_interp(x)
        else:
            return self.f_interp
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号