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
e59c9fc3
Commit
e59c9fc3
authored
1 year ago
by
Thomas Kluyver
Browse files
Options
Downloads
Patches
Plain Diff
Test module numbers & qm_names
parent
02b94a30
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!885
Revised CalCat API
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/test_calcat_interface2.py
+10
-8
10 additions, 8 deletions
tests/test_calcat_interface2.py
with
10 additions
and
8 deletions
tests/test_calcat_interface2.py
+
10
−
8
View file @
e59c9fc3
...
@@ -4,10 +4,10 @@ from cal_tools.calcat_interface2 import (
...
@@ -4,10 +4,10 @@ from cal_tools.calcat_interface2 import (
CalibrationData
,
AGIPDConditions
,
SingleConstantVersion
,
CalibrationData
,
AGIPDConditions
,
SingleConstantVersion
,
)
)
@pytest.mark.requires_gpfs
@pytest.mark.requires_gpfs
def
test_AGIPD_CalibrationData_metadata
():
def
test_AGIPD_CalibrationData_metadata
():
"""
Test CalibrationData with AGIPD condition
"""
Test CalibrationData with AGIPD condition
"""
"""
cond
=
AGIPDConditions
(
cond
=
AGIPDConditions
(
# From: https://in.xfel.eu/calibration/calibration_constants/5754#condition
# From: https://in.xfel.eu/calibration/calibration_constants/5754#condition
sensor_bias_voltage
=
300
,
# V
sensor_bias_voltage
=
300
,
# V
...
@@ -40,23 +40,25 @@ def test_AGIPD_CalibrationData_metadata_SPB():
...
@@ -40,23 +40,25 @@ def test_AGIPD_CalibrationData_metadata_SPB():
source_energy
=
9.2
,
source_energy
=
9.2
,
gain_mode
=
0
,
gain_mode
=
0
,
gain_setting
=
0
,
gain_setting
=
0
,
)
)
agipd_cd
=
CalibrationData
.
from_condition
(
agipd_cd
=
CalibrationData
.
from_condition
(
cond
,
cond
,
"
SPB_DET_AGIPD1M-1
"
,
"
SPB_DET_AGIPD1M-1
"
,
event_at
=
"
2020-01-07 13:26:48.00
"
,
event_at
=
"
2020-01-07 13:26:48.00
"
,
)
)
assert
'
Offset
'
in
agipd_cd
assert
"
Offset
"
in
agipd_cd
assert
set
(
agipd_cd
[
'
Offset
'
].
constants
)
==
{
f
'
AGIPD
{
i
:
02
}
'
for
i
in
range
(
16
)}
assert
set
(
agipd_cd
[
"
Offset
"
].
constants
)
==
{
f
"
AGIPD
{
i
:
02
}
"
for
i
in
range
(
16
)}
assert
isinstance
(
agipd_cd
[
'
Offset
'
].
constants
[
'
AGIPD00
'
],
SingleConstantVersion
)
assert
agipd_cd
[
"
Offset
"
].
module_nums
==
list
(
range
(
16
))
assert
agipd_cd
[
"
Offset
"
].
qm_names
==
[
f
"
Q
{
(
i
//
4
)
+
1
}
M
{
(
i
%
4
)
+
1
}
"
for
i
in
range
(
16
)
]
assert
isinstance
(
agipd_cd
[
"
Offset
"
].
constants
[
"
AGIPD00
"
],
SingleConstantVersion
)
@pytest.mark.xfail
@pytest.mark.xfail
@pytest.mark.requires_gpfs
@pytest.mark.requires_gpfs
def
test_AGIPD_CalibrationData_report
():
def
test_AGIPD_CalibrationData_report
():
"""
Test CalibrationData with AGIPD condition
"""
Test CalibrationData with data from report
"""
"""
# Report ID: https://in.xfel.eu/calibration/reports/3757
# Report ID: https://in.xfel.eu/calibration/reports/3757
agipd_cd
=
CalibrationData
.
from_report
(
3757
)
agipd_cd
=
CalibrationData
.
from_report
(
3757
)
assert
set
(
agipd_cd
)
==
{
'
Offset
'
,
'
Noise
'
,
'
ThresholdsDark
'
,
'
BadPixelsDark
'
}
assert
set
(
agipd_cd
)
==
{
'
Offset
'
,
'
Noise
'
,
'
ThresholdsDark
'
,
'
BadPixelsDark
'
}
...
...
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