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
632a1228
Commit
632a1228
authored
2 years ago
by
Karim Ahmed
Browse files
Options
Downloads
Patches
Plain Diff
Read bias_voltage for AGIPD at SPB and MID from RUN source
parent
ea1b0f06
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!647
[AGIPD] Read bias_voltage for AGIPD at SPB and MID from RUN source
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/cal_tools/agipdlib.py
+18
-9
18 additions, 9 deletions
src/cal_tools/agipdlib.py
with
18 additions
and
9 deletions
src/cal_tools/agipdlib.py
+
18
−
9
View file @
632a1228
...
...
@@ -173,30 +173,39 @@ class AgipdCtrl:
karabo_id_control
:
str
,
module
:
Optional
[
int
]
=
0
)
->
int
:
"""
Read the voltage information from the
FPGA devi
ce of module 0.
"""
Read the voltage information from the
RUN sour
ce of module 0.
Different modules may operate at different voltages.
In practice, they all operate at the same voltage.
As such, it is okay to read a single module
'
s value.
If the FPGA module source is not available, 300 will be returned.
300 is the default bias_voltage value before adding it to slow data.
If the FPGA/PSC RUN source is not available, 300 will be returned.
300 was the default bias_voltage value for
MID_DET_AGIPD1M-1 and SPB_DET_AGIPD1M-1.
:param karabo_id_control: The
detector karabo id,
for the
control
device.
:param karabo_id_control: The
karabo deviceId
for the
CONTROL
device.
:param module: defaults to module 0
:return: voltage, a uint16
"""
voltage_src
=
(
f
"
{
karabo_id_control
}
/FPGA/M_
{
module
}
"
,
"
highVoltage.actual.value
"
)
# TODO: Add a breaking fix by passing the source and key through
# get_bias_voltage arguments.
if
"
AGIPD1M
"
in
karabo_id_control
:
voltage_src
=
(
f
"
{
karabo_id_control
[
:
-
1
]
}
/PSC/HV
"
,
f
"
channels.U
{
module
}
.measurmentSenseVoltage.value
"
)
else
:
# AGIPD500K
voltage_src
=
(
f
"
{
karabo_id_control
}
/FPGA/M_
{
module
}
"
,
"
highVoltage.actual.value
"
)
if
(
voltage_src
[
0
]
in
self
.
run_dc
.
all_sources
and
voltage_src
[
1
]
in
self
.
run_dc
.
keys_for_source
(
voltage_src
[
0
])
):
return
self
.
run_dc
[
voltage_src
].
as_single_value
(
atol
=
1
,
reduce_by
=
'
max
'
)
return
int
(
self
.
run_dc
.
get_run_value
(
*
voltage_src
))
else
:
# TODO: Validate if removing this and
# and using NB value for old RAW data.
print
(
"
WARNING: Unable to read bias_voltage from
"
f
"
{
voltage_src
[
0
]
}
/
{
voltage_src
[
1
].
replace
(
'
.
'
,
'
/
'
)
}
"
...
...
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