Commit 4bb162be authored by Marin Collonge's avatar Marin Collonge
Browse files

DAQ: get_synced_data_stages function added with coarse and fine stages data split

parent abddd5e9
......@@ -280,6 +280,28 @@ class daq():
synced_data[i] = 8*coarse + fine
return synced_data
def get_synced_data_stages(self, channel=0, words_per_FE=3750):
synced_data_bytewise = self.get_synced_data_bytewise(channel, words_per_FE+1)
if(self.bytes_per_fe == 2):
high_byte = synced_data_bytewise[0:self.bytes_per_fe*self.NB_FES*words_per_FE:2]
low_byte = synced_data_bytewise[1::2]
high_byte_mask_coarse = 0b00001111
low_byte_mask_coarse = 0b11000000
low_byte_mask_fine = 0b00111111
coarse_data = np.zeros(len(high_byte))
fine_data = np.zeros(len(high_byte))
for i in np.arange(len(high_byte)):
low_byte_coarse = (int(low_byte[i]) & low_byte_mask_coarse)>>6
high_byte_coarse = (int(high_byte[i]) & high_byte_mask_coarse)<<2
coarse = high_byte_coarse + low_byte_coarse
low_byte_fine = int(low_byte[i+self.NB_FES]) & low_byte_mask_fine
fine = low_byte_fine
coarse_data[i] = coarse
fine_data[i] = fine
return coarse_data, fine_data
def calcAvgsForAllFEs(self, data):
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment