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

changes after Karim's revision

parent bd43158f
No related branches found
No related tags found
1 merge request!432Fix/da qoldformat corr
......@@ -69,10 +69,10 @@ def get_dssc_ctrl_data(in_folder, slow_data_pattern,
ctrlDataFiles[quadrant + 1] = f
if len(ctrlDataFiles) == 0:
print("No Control Slow Data found!")
print("ERROR: no Control Slow Data found!")
return targetGainAll, encodedGainAll, operatingFreqAll
daq_format = ''
daq_format = None
ctrlloc = None
filename = next(iter(ctrlDataFiles.values()))
......@@ -93,11 +93,18 @@ def get_dssc_ctrl_data(in_folder, slow_data_pattern,
tGain = {}
encodedGain = {}
operatingFreqs = {}
for quadrant, file in ctrlDataFiles.items():
if len(file):
with h5py.File(file) as h5file:
for quadrant in slow_data_aggregators.keys():
if quadrant in ctrlDataFiles.keys():
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:
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:
epcConfig = h5file[f'/RUN/{ctrlloc}/FPGA/PPT_Q{quadrant}/epcRegisterFilePath/value'][0]\
.decode("utf-8")
......@@ -106,21 +113,14 @@ def get_dssc_ctrl_data(in_folder, slow_data_pattern,
print(f"EPC configuration: {epcConfig}")
targGain = _extr_gainparam_conffilename(epcConfig)
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 = {}
for coarseParam in ['fcfEnCap', 'csaFbCap', 'csaResistor']:
gainSettingsMap[coarseParam] = int(
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(
1) if irampSettings == "Various" else np.int64(0)
......
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