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)
评论列表
文章目录