geco_overlay_plots.py 文件源码

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

项目:geco_data 作者: stefco 项目源码 文件源码
def __init__(self, channel, timeseries=None, stats=None, n=None):
        """If timeseries is None, then we are manually initializing with custom
        stat values. Otherwise, calculate stat values from the timeseries.
        Input is assumed to be a GWpy timeseries."""
        self.channel = channel
        if timeseries is None:
            self.n = n
            self.stats = stats
        else:
            self.n = 1
            # wrap the end of the second onto the start of that same second.
            # obviously this is only okay with quasi periodic signals!
            zero_crossing = np.concatenate((timeseries.value[DUOTONE_START:],
                                            timeseries.value[:DUOTONE_END]))
            self.stats = {
                "sum": zero_crossing,
                "sum_sq": np.square(zero_crossing),
                "mean": zero_crossing,
                "sigma": zero_crossing * 0., # i.e. zeros
                "max": zero_crossing,
                "min": zero_crossing
            }
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号