Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
calng
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository 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
calng
Commits
7e9d9579
Commit
7e9d9579
authored
3 years ago
by
David Hammer
Browse files
Options
Downloads
Patches
Plain Diff
Select cell ID to preview instead of pulse
parent
15fb4726
No related branches found
No related tags found
2 merge requests
!12
Snapshot: field test deployed version as of end of run 202201
,
!3
Base correction device, CalCat interaction, DSSC and AGIPD devices
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/calng/AgipdCorrection.py
+8
-7
8 additions, 7 deletions
src/calng/AgipdCorrection.py
src/calng/base_correction.py
+3
-2
3 additions, 2 deletions
src/calng/base_correction.py
with
11 additions
and
9 deletions
src/calng/AgipdCorrection.py
+
8
−
7
View file @
7e9d9579
...
@@ -315,19 +315,20 @@ class AgipdCorrection(BaseCorrection):
...
@@ -315,19 +315,20 @@ class AgipdCorrection(BaseCorrection):
if
do_generate_preview
:
if
do_generate_preview
:
if
self
.
_correction_flag_enabled
!=
self
.
_correction_flag_preview
:
if
self
.
_correction_flag_enabled
!=
self
.
_correction_flag_preview
:
self
.
gpu_runner
.
correct
(
self
.
_correction_flag_preview
)
self
.
gpu_runner
.
correct
(
self
.
_correction_flag_preview
)
# WARNING: actually looking for cell ID at the request of SPB
preview_slice_index
=
self
.
_schema_cache
[
"
preview.pulse
"
]
preview_slice_index
=
self
.
_schema_cache
[
"
preview.pulse
"
]
if
preview_slice_index
>=
0
:
if
preview_slice_index
>=
0
:
# look at
pulse
_table to find which index this pulse ID is in
# look at
cell
_table to find which index this pulse ID is in
pulse
_id_found
=
np
.
where
(
pulse
_table
==
preview_slice_index
)[
0
]
cell
_id_found
=
np
.
where
(
cell
_table
==
preview_slice_index
)[
0
]
if
len
(
pulse
_id_found
)
==
0
:
if
len
(
cell
_id_found
)
==
0
:
pulse
_found_instead
=
pulse
_table
[
0
]
cell
_found_instead
=
cell
_table
[
0
]
self
.
log_status_info
(
self
.
log_status_info
(
f
"
Pulse
{
preview_slice_index
}
not found, arbitrary
pulse
"
f
"
Cell
{
preview_slice_index
}
not found, arbitrary
cell
"
f
"
{
pulse
_found_instead
}
will be shown instead.
"
f
"
{
cell
_found_instead
}
will be shown instead.
"
)
)
preview_slice_index
=
0
preview_slice_index
=
0
else
:
else
:
preview_slice_index
=
pulse
_id_found
[
0
]
preview_slice_index
=
cell
_id_found
[
0
]
preview_raw
,
preview_corrected
=
self
.
gpu_runner
.
compute_preview
(
preview_raw
,
preview_corrected
=
self
.
gpu_runner
.
compute_preview
(
preview_slice_index
preview_slice_index
)
)
...
...
This diff is collapsed.
Click to expand it.
src/calng/base_correction.py
+
3
−
2
View file @
7e9d9579
...
@@ -338,9 +338,10 @@ class BaseCorrection(PythonDevice):
...
@@ -338,9 +338,10 @@ class BaseCorrection(PythonDevice):
.
defaultValue
(
True
)
.
defaultValue
(
True
)
.
reconfigurable
()
.
reconfigurable
()
.
commit
(),
.
commit
(),
# TODO: Split into AGIPD-specific or see if others like cell ID over pulse ID
INT32_ELEMENT
(
expected
)
INT32_ELEMENT
(
expected
)
.
key
(
"
preview.pulse
"
)
.
key
(
"
preview.pulse
"
)
.
displayedName
(
"
Pulse
(or stat) for preview
"
)
.
displayedName
(
"
Cell
(or stat) for preview
"
)
.
description
(
.
description
(
"
If this value is ≥ 0, the corresponding index from data will be
"
"
If this value is ≥ 0, the corresponding index from data will be
"
"
sliced for the preview. If this value is ≤ 0, preview will be one of
"
"
sliced for the preview. If this value is ≤ 0, preview will be one of
"
...
@@ -603,7 +604,7 @@ class BaseCorrection(PythonDevice):
...
@@ -603,7 +604,7 @@ class BaseCorrection(PythonDevice):
# TODO: allow sending *all* frames for commissioning (request: Jola)
# TODO: allow sending *all* frames for commissioning (request: Jola)
preview_hash
=
Hash
()
preview_hash
=
Hash
()
preview_hash
.
set
(
"
image.trainId
"
,
train_id
)
preview_hash
.
set
(
"
image.trainId
"
,
train_id
)
preview_hash
.
set
(
"
image.
pulse
Id
"
,
self
.
_schema_cache
[
"
preview.pulse
"
])
preview_hash
.
set
(
"
image.
cell
Id
"
,
self
.
_schema_cache
[
"
preview.pulse
"
])
# note: have to construct because setting .tid after init is broken
# note: have to construct because setting .tid after init is broken
timestamp
=
Timestamp
(
Epochstamp
(),
Trainstamp
(
train_id
))
timestamp
=
Timestamp
(
Epochstamp
(),
Trainstamp
(
train_id
))
...
...
This diff is collapsed.
Click to expand it.
David Hammer
@hammerd
mentioned in commit
3566342d
·
2 years ago
mentioned in commit
3566342d
mentioned in commit 3566342d031db1bb435b6430f100afdbaaa6c4bf
Toggle commit list
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