Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
pycalibration
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Model registry
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
calibration
pycalibration
Commits
bd43158f
Commit
bd43158f
authored
4 years ago
by
Andrey Samartsev
Browse files
Options
Downloads
Patches
Plain Diff
autopep formatting
parent
faee68c2
No related branches found
No related tags found
1 merge request
!432
Fix/da qoldformat corr
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
cal_tools/cal_tools/dssclib.py
+6
-6
6 additions, 6 deletions
cal_tools/cal_tools/dssclib.py
with
6 additions
and
6 deletions
cal_tools/cal_tools/dssclib.py
+
6
−
6
View file @
bd43158f
...
@@ -13,7 +13,7 @@ def get_pulseid_checksum(fname, h5path, h5path_idx):
...
@@ -13,7 +13,7 @@ def get_pulseid_checksum(fname, h5path, h5path_idx):
with
h5py
.
File
(
fname
,
"
r
"
)
as
infile
:
with
h5py
.
File
(
fname
,
"
r
"
)
as
infile
:
count
=
np
.
squeeze
(
infile
[
f
"
{
h5path_idx
}
/count
"
])
count
=
np
.
squeeze
(
infile
[
f
"
{
h5path_idx
}
/count
"
])
first
=
np
.
squeeze
(
infile
[
f
"
{
h5path_idx
}
/first
"
])
first
=
np
.
squeeze
(
infile
[
f
"
{
h5path_idx
}
/first
"
])
last_index
=
int
(
first
[
count
!=
0
][
-
1
]
+
count
[
count
!=
0
][
-
1
])
last_index
=
int
(
first
[
count
!=
0
][
-
1
]
+
count
[
count
!=
0
][
-
1
])
first_index
=
int
(
first
[
count
!=
0
][
0
])
first_index
=
int
(
first
[
count
!=
0
][
0
])
pulseids
=
infile
[
f
"
{
h5path
}
/pulseId
"
][
first_index
:
pulseids
=
infile
[
f
"
{
h5path
}
/pulseId
"
][
first_index
:
int
(
first
[
count
!=
0
][
1
])]
int
(
first
[
count
!=
0
][
1
])]
...
@@ -25,7 +25,7 @@ def get_pulseid_checksum(fname, h5path, h5path_idx):
...
@@ -25,7 +25,7 @@ def get_pulseid_checksum(fname, h5path, h5path_idx):
def
_extr_gainparam_conffilename
(
fileName
:
str
)
->
Tuple
[
int
]:
def
_extr_gainparam_conffilename
(
fileName
:
str
)
->
Tuple
[
int
]:
"""
extracts target gain from config filename, if provided.
"""
"""
extracts target gain from config filename, if provided.
"""
vals
=
re
.
search
(
"
.*_TG(?P<TG>\d+.?\d+)
"
,
fileName
)
vals
=
re
.
search
(
"
.*_TG(?P<TG>
\
\
d+.?
\
\
d+)
"
,
fileName
)
if
vals
:
if
vals
:
return
vals
.
group
(
'
TG
'
)
return
vals
.
group
(
'
TG
'
)
...
@@ -54,7 +54,7 @@ def get_dssc_ctrl_data(in_folder, slow_data_pattern,
...
@@ -54,7 +54,7 @@ def get_dssc_ctrl_data(in_folder, slow_data_pattern,
encodedGainAll
=
{}
encodedGainAll
=
{}
operatingFreqAll
=
{}
operatingFreqAll
=
{}
for
i
in
range
(
16
):
for
i
in
range
(
16
):
qm
=
'
Q{}M{}
'
.
format
(
i
//
4
+
1
,
i
%
4
+
1
)
qm
=
'
Q{}M{}
'
.
format
(
i
//
4
+
1
,
i
%
4
+
1
)
targetGainAll
[
qm
]
=
None
targetGainAll
[
qm
]
=
None
encodedGainAll
[
qm
]
=
None
encodedGainAll
[
qm
]
=
None
operatingFreqAll
[
qm
]
=
None
operatingFreqAll
[
qm
]
=
None
...
@@ -66,7 +66,7 @@ def get_dssc_ctrl_data(in_folder, slow_data_pattern,
...
@@ -66,7 +66,7 @@ def get_dssc_ctrl_data(in_folder, slow_data_pattern,
f
=
os
.
path
.
join
(
in_folder
,
quad_sd_pattern
)
f
=
os
.
path
.
join
(
in_folder
,
quad_sd_pattern
)
if
os
.
path
.
exists
(
f
):
if
os
.
path
.
exists
(
f
):
ctrlDataFiles
[
quadrant
+
1
]
=
f
ctrlDataFiles
[
quadrant
+
1
]
=
f
if
len
(
ctrlDataFiles
)
==
0
:
if
len
(
ctrlDataFiles
)
==
0
:
print
(
"
No Control Slow Data found!
"
)
print
(
"
No Control Slow Data found!
"
)
...
@@ -97,7 +97,7 @@ def get_dssc_ctrl_data(in_folder, slow_data_pattern,
...
@@ -97,7 +97,7 @@ def get_dssc_ctrl_data(in_folder, slow_data_pattern,
if
len
(
file
):
if
len
(
file
):
with
h5py
.
File
(
file
)
as
h5file
:
with
h5py
.
File
(
file
)
as
h5file
:
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
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,7 +106,7 @@ def get_dssc_ctrl_data(in_folder, slow_data_pattern,
...
@@ -106,7 +106,7 @@ 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
gainSettingsMap
=
{}
gainSettingsMap
=
{}
for
coarseParam
in
[
'
fcfEnCap
'
,
'
csaFbCap
'
,
'
csaResistor
'
]:
for
coarseParam
in
[
'
fcfEnCap
'
,
'
csaFbCap
'
,
'
csaResistor
'
]:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment