test_fdmt.py 文件源码

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

项目:bifrost 作者: ledatelescope 项目源码 文件源码
def on_data(self, ispan):
        """Process data from from ispans to ospans and return the number of
        frames to commit for each output (or None to commit complete spans)."""
        data = ispan.data
        print "PgmWriterBlock.on_data()"
        # HACK TESTING
        if data.dtype != np.uint8:
            data = (data - data.min()) / (data.max() - data.min()) * 255
            #data = np.clip(data, 0, 255)
            data = data.astype(np.uint8)
            #data = data.astype(np.uint16)
        if self.outfile is None:
            return

        data.tofile(self.outfile)
        # HACK TESTING only write the first gulp
        self.outfile.close()
        self.outfile = None
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号