def unpack(self,data): word_width = int(32/self.ants_per_word) mask = (2**word_width)-1 data_list = [np.array(s.unpack('>%dB'%(self.depth/4*self.ants_per_word),data[fn])) for fn in range(self.n_fpgas)] ret_data = np.array([]) for fn in range(self.n_fpgas): ret_data = np.append(ret_data,bitOperations.uint2cplx(data_list[fn],word_width)) return ret_data
def unpack(self,data): word_width = int(32/self.ants_per_word) r_i_width = int(word_width/2) mask = (2**word_width)-1 data_list = [np.array(s.unpack('>%dL'%(self.depth/4),data[fn])) for fn in range(self.n_fpgas)] ret_data_all_fpgas = np.array([]) for fn in range(self.n_fpgas): ret_data = np.array([]) for i in range(self.ants_per_word): ret_data = np.append(ret_data,bitOperations.uint2cplx((data_list[fn]&(mask<<((self.ants_per_word-1-i)*word_width)))>>((self.ants_per_word-1-i)*word_width),r_i_width)) ret_data_all_fpgas = np.append(ret_data_all_fpgas,ret_data) return ret_data_all_fpgas