block.py 文件源码

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

项目:bifrost 作者: ledatelescope 项目源码 文件源码
def main(self, input_rings, output_rings):
        """
        @param[in] input_rings First ring in this list will be used for
            data
        @param[out] output_rings First ring in this list will be used for
            data output."""
        data_accumulate = None
        for ispan in self.iterate_ring_read(input_rings[0]):
            if self.nbit < 8:
                unpacked_data = unpack(ispan.data_view(self.dtype), self.nbit)
            else:
                unpacked_data = ispan.data_view(self.dtype)
            if data_accumulate is not None:
                data_accumulate = np.concatenate((data_accumulate, unpacked_data[0]))
            else:
                data_accumulate = unpacked_data[0]
        if self.shape != [1, 1]:
            data_accumulate = np.reshape(data_accumulate, (self.shape[0], -1))
        data_accumulate = data_accumulate.astype(np.complex64)
        self.out_gulp_size = data_accumulate.nbytes
        outspan_generator = self.iterate_ring_write(output_rings[0])
        ospan = outspan_generator.next()
        result = np.fft.fft(data_accumulate).astype(np.complex64)
        ospan.data_view(np.complex64)[0] = result.ravel()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号