Skip to content
Snippets Groups Projects
Commit 94178854 authored by Andrey Samartsev's avatar Andrey Samartsev
Browse files

pep8 formatting

parent 142ca1a7
No related branches found
No related tags found
1 merge request!432Fix/da qoldformat corr
......@@ -71,28 +71,24 @@ def get_dssc_ctrl_data(in_folder, slow_data_pattern,
if len(ctrlDataFiles) == 0:
print("No Control Slow Data found!")
return targetGainAll, encodedGainAll, operatingFreqAll
print(ctrlDataFiles)
daq_format = ''
ctrlloc = None
filename = next(iter(ctrlDataFiles.values()))
print("filename: ", filename)
ctlrh5file = h5py.File(filename, 'r')
if '/METADATA/dataSources/deviceId' in ctlrh5file:
ctrlloc = ctlrh5file['/METADATA/dataSources/deviceId'][0]
daq_format = ctlrh5file['/METADATA/dataFormatVersion'][0].decode("utf-8")
daq_format = ctlrh5file['/METADATA/dataFormatVersion'][0].decode(
"utf-8")
elif '/METADATA/deviceId' in ctlrh5file:
ctrlloc = ctlrh5file['/METADATA/deviceId'][0]
else:
print("No Slow Control Data found in files!")
return targetGainAll, encodedGainAll, operatingFreqAll
ctrlloc = ctrlloc.decode("utf-8")
ctrlloc = ctrlloc[:ctrlloc.find('/')]
print("ctrlloc: ", ctrlloc)
tGain = {}
encodedGain = {}
......@@ -100,14 +96,15 @@ def get_dssc_ctrl_data(in_folder, slow_data_pattern,
for quadrant, file in ctrlDataFiles.items():
if len(file):
h5file = h5py.File(file)
if daq_format != '':
if daq_format != '':
epcConfig = h5file[f'/RUN/{ctrlloc}/FPGA/PPT_Q{quadrant}/epcRegisterFilePath/value'][0]\
.decode("utf-8")
epcConfig = epcConfig[epcConfig.rfind('/') + 1:]
print(f"EPC configuration: {epcConfig}")
targGain = _extr_gainparam_conffilename(epcConfig)
tGain[quadrant] = float(targGain) if targGain is not None else 0.0
tGain[quadrant] = float(
targGain) if targGain is not None else 0.0
# 0.0 is default value for TG
else:
tGain[quadrant] = 0.0
......@@ -127,8 +124,6 @@ def get_dssc_ctrl_data(in_folder, slow_data_pattern,
gainSettingsMap['trimmed'] = np.int64(
1) if irampSettings == "Various" else np.int64(0)
print('trimmed: ', gainSettingsMap['trimmed'])
encodedGain[quadrant] = _get_gain_encoded_val(gainSettingsMap)
......@@ -140,7 +135,10 @@ def get_dssc_ctrl_data(in_folder, slow_data_pattern,
else:
print(f"no slow data for quadrant {quadrant} is found")
for varpair in [(targetGainAll, tGain), (encodedGainAll, encodedGain), (operatingFreqAll, operatingFreqs)]:
for varpair in [
(targetGainAll, tGain),
(encodedGainAll, encodedGain),
(operatingFreqAll, operatingFreqs)]:
for quadrant, value in varpair[1].items():
for module in range(1, 5):
qm = f'Q{quadrant}M{module}'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment