block.py 文件源码

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

项目:bifrost 作者: ledatelescope 项目源码 文件源码
def __init__(self, test_array, complex_numbers=False):
        """Figure out data settings from the test array.
        @param[in] test_array A list or numpy array containing test data"""
        super(TestingBlock, self).__init__()
        if isinstance(test_array, np.ndarray):
            if test_array.dtype == np.complex64:
                complex_numbers = True
        if complex_numbers:
            self.test_array = np.array(test_array).astype(np.complex64)
            header = {
                'nbit': 64,
                'dtype': 'complex64',
                'shape': self.test_array.shape}
            self.dtype = np.complex64
        else:
            self.test_array = np.array(test_array).astype(np.float32)
            header = {
                'nbit': 32,
                'dtype': 'float32',
                'shape': self.test_array.shape}
            self.dtype = np.float32
        self.output_header = json.dumps(header)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号