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
87ba0340
Commit
87ba0340
authored
2 years ago
by
Karim Ahmed
Browse files
Options
Downloads
Patches
Plain Diff
Use as_single_value for all control parameters, except for bias_voltage.
parent
d09e3f59
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!652
[AGIPD] as_single_value instead of get_run_value
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/cal_tools/agipdlib.py
+10
-10
10 additions, 10 deletions
src/cal_tools/agipdlib.py
with
10 additions
and
10 deletions
src/cal_tools/agipdlib.py
+
10
−
10
View file @
87ba0340
...
@@ -27,6 +27,7 @@ from cal_tools.enums import AgipdGainMode, BadPixels, SnowResolution
...
@@ -27,6 +27,7 @@ from cal_tools.enums import AgipdGainMode, BadPixels, SnowResolution
from
cal_tools.h5_copy_except
import
h5_copy_except_paths
from
cal_tools.h5_copy_except
import
h5_copy_except_paths
from
cal_tools.tools
import
get_from_db
from
cal_tools.tools
import
get_from_db
class
AgipdCtrl
:
class
AgipdCtrl
:
def
__init__
(
def
__init__
(
self
,
self
,
...
@@ -88,7 +89,6 @@ class AgipdCtrl:
...
@@ -88,7 +89,6 @@ class AgipdCtrl:
# float.
# float.
# It is desired to loose precision here because the usage is
# It is desired to loose precision here because the usage is
# about bucketing the rate for managing meta-data.
# about bucketing the rate for managing meta-data.
return
round
(
float
(
self
.
run_dc
[
rep_rate_src
].
as_single_value
()),
1
)
return
round
(
float
(
self
.
run_dc
[
rep_rate_src
].
as_single_value
()),
1
)
train_pulses
=
np
.
squeeze
(
train_pulses
=
np
.
squeeze
(
...
@@ -129,11 +129,12 @@ class AgipdCtrl:
...
@@ -129,11 +129,12 @@ class AgipdCtrl:
return
return
if
"
gain.value
"
in
self
.
run_dc
.
keys_for_source
(
self
.
ctrl_src
):
if
"
gain.value
"
in
self
.
run_dc
.
keys_for_source
(
self
.
ctrl_src
):
return
self
.
run_dc
[
self
.
ctrl_src
,
"
gain.value
"
].
as_single_value
()
return
int
(
self
.
run_dc
[
self
.
ctrl_src
,
"
gain
"
].
as_single_value
())
setupr
=
self
.
run_dc
[
self
.
ctrl_src
,
"
setupr
.value
"
].
as_single_value
()
setupr
=
self
.
run_dc
[
self
.
ctrl_src
,
"
setupr
"
].
as_single_value
()
pattern_type_idx
=
self
.
run_dc
[
pattern_type_idx
=
self
.
run_dc
[
self
.
ctrl_src
,
"
patternTypeIndex
.value
"
].
as_single_value
()
self
.
ctrl_src
,
"
patternTypeIndex
"
].
as_single_value
()
if
(
setupr
==
0
and
pattern_type_idx
<
4
)
or
(
if
(
setupr
==
0
and
pattern_type_idx
<
4
)
or
(
setupr
==
32
and
pattern_type_idx
==
4
):
setupr
==
32
and
pattern_type_idx
==
4
):
...
@@ -162,9 +163,8 @@ class AgipdCtrl:
...
@@ -162,9 +163,8 @@ class AgipdCtrl:
"
gainModeIndex.value
"
in
self
.
run_dc
.
keys_for_source
(
"
gainModeIndex.value
"
in
self
.
run_dc
.
keys_for_source
(
self
.
ctrl_src
)
self
.
ctrl_src
)
):
):
return
AgipdGainMode
(
int
(
return
AgipdGainMode
(
int
(
self
.
run_dc
[
self
.
run_dc
.
get_run_value
(
self
.
ctrl_src
,
"
gainModeIndex
"
].
as_single_value
()))
self
.
ctrl_src
,
"
gainModeIndex.value
"
)))
return
AgipdGainMode
.
ADAPTIVE_GAIN
return
AgipdGainMode
.
ADAPTIVE_GAIN
...
@@ -210,7 +210,7 @@ class AgipdCtrl:
...
@@ -210,7 +210,7 @@ class AgipdCtrl:
# As HED_DET_AGIPD500K2G has a hardware issue that leads
# As HED_DET_AGIPD500K2G has a hardware issue that leads
# to storing arbitrary voltage values in the CONTROL source
# to storing arbitrary voltage values in the CONTROL source
# array. e.g. /gpfs/exfel/exp/HED/202230/p900248/raw
# array. e.g. /gpfs/exfel/exp/HED/202230/p900248/raw
return
int
(
self
.
run_dc
.
get_run_value
(
*
voltage_src
)
)
return
self
.
run_dc
.
get_run_value
(
*
voltage_src
)
else
:
else
:
# TODO: Validate if removing this and
# TODO: Validate if removing this and
# and using NB value for old RAW data.
# and using NB value for old RAW data.
...
@@ -237,8 +237,8 @@ class AgipdCtrl:
...
@@ -237,8 +237,8 @@ class AgipdCtrl:
'
integrationTime.value
'
in
self
.
run_dc
.
keys_for_source
(
'
integrationTime.value
'
in
self
.
run_dc
.
keys_for_source
(
self
.
ctrl_src
)
self
.
ctrl_src
)
):
):
return
int
(
self
.
run_dc
.
get_run_value
(
return
int
(
self
.
run_dc
[
self
.
ctrl_src
,
'
integrationTime
.
value
'
))
self
.
ctrl_src
,
'
integrationTime
'
].
as_single_
value
(
))
return
12
return
12
...
...
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