Skip to content
Snippets Groups Projects

Fix/da qoldformat corr

Merged Andrey Samartsev requested to merge fix/DAQoldformatCorr into master
4 unresolved threads
1 file
+ 14
14
Compare changes
  • Side-by-side
  • Inline
@@ -69,10 +69,10 @@ def get_dssc_ctrl_data(in_folder, slow_data_pattern,
@@ -69,10 +69,10 @@ def get_dssc_ctrl_data(in_folder, slow_data_pattern,
ctrlDataFiles[quadrant + 1] = f
ctrlDataFiles[quadrant + 1] = f
if len(ctrlDataFiles) == 0:
if len(ctrlDataFiles) == 0:
print("No Control Slow Data found!")
print("ERROR: no Control Slow Data found!")
return targetGainAll, encodedGainAll, operatingFreqAll
return targetGainAll, encodedGainAll, operatingFreqAll
daq_format = ''
daq_format = None
ctrlloc = None
ctrlloc = None
filename = next(iter(ctrlDataFiles.values()))
filename = next(iter(ctrlDataFiles.values()))
@@ -93,11 +93,18 @@ def get_dssc_ctrl_data(in_folder, slow_data_pattern,
@@ -93,11 +93,18 @@ def get_dssc_ctrl_data(in_folder, slow_data_pattern,
tGain = {}
tGain = {}
encodedGain = {}
encodedGain = {}
operatingFreqs = {}
operatingFreqs = {}
for quadrant, file in ctrlDataFiles.items():
for quadrant in slow_data_aggregators.keys():
if len(file):
if quadrant in ctrlDataFiles.keys():
with h5py.File(file) as h5file:
file = ctrlDataFiles[quadrant]
 
with h5py.File(file) as h5file:
 
iramp_path = f'/RUN/{ctrlloc}/FPGA/PPT_Q{quadrant}/gain/irampFineTrm/value
if not daq_format:
if not daq_format:
tGain[quadrant] = 0.0 # 0.0 is default value for TG
tGain[quadrant] = 0.0 # 0.0 is default value for TG
 
 
if iramp_path in h5file:
 
irampSettings = h5file[iramp_path][0]
 
else:
 
irampSettings = "Various
else:
else:
epcConfig = h5file[f'/RUN/{ctrlloc}/FPGA/PPT_Q{quadrant}/epcRegisterFilePath/value'][0]\
epcConfig = h5file[f'/RUN/{ctrlloc}/FPGA/PPT_Q{quadrant}/epcRegisterFilePath/value'][0]\
.decode("utf-8")
.decode("utf-8")
@@ -106,21 +113,14 @@ def get_dssc_ctrl_data(in_folder, slow_data_pattern,
@@ -106,21 +113,14 @@ def get_dssc_ctrl_data(in_folder, slow_data_pattern,
print(f"EPC configuration: {epcConfig}")
print(f"EPC configuration: {epcConfig}")
targGain = _extr_gainparam_conffilename(epcConfig)
targGain = _extr_gainparam_conffilename(epcConfig)
tGain[quadrant] = float(
tGain[quadrant] = float(
targGain) if targGain is not None else 0.0
targGain) if targGain is not None else 0.0
 
irampSettings = h5file[iramp_path][0].decode("utf-8")
gainSettingsMap = {}
gainSettingsMap = {}
for coarseParam in ['fcfEnCap', 'csaFbCap', 'csaResistor']:
for coarseParam in ['fcfEnCap', 'csaFbCap', 'csaResistor']:
gainSettingsMap[coarseParam] = int(
gainSettingsMap[coarseParam] = int(
h5file[f'/RUN/{ctrlloc}/FPGA/PPT_Q{quadrant}/gain/{coarseParam}/value'][0])
h5file[f'/RUN/{ctrlloc}/FPGA/PPT_Q{quadrant}/gain/{coarseParam}/value'][0])
iramp_path = f'/RUN/{ctrlloc}/FPGA/PPT_Q{quadrant}/gain/irampFineTrm/value'
if daq_format != '':
irampSettings = h5file[iramp_path][0].decode("utf-8")
elif iramp_path in h5file:
irampSettings = h5file[iramp_path][0]
else:
irampSettings = "Various"
gainSettingsMap['trimmed'] = np.int64(
gainSettingsMap['trimmed'] = np.int64(
1) if irampSettings == "Various" else np.int64(0)
1) if irampSettings == "Various" else np.int64(0)
Loading