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
c606771a
Commit
c606771a
authored
3 years ago
by
David Hammer
Browse files
Options
Downloads
Patches
Plain Diff
Enable transposition from weird DAQ axis order on GPU
parent
39e35fea
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!12
Snapshot: field test deployed version as of end of run 202201
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/calng/JungfrauCorrection.py
+29
-4
29 additions, 4 deletions
src/calng/JungfrauCorrection.py
with
29 additions
and
4 deletions
src/calng/JungfrauCorrection.py
+
29
−
4
View file @
c606771a
...
@@ -3,6 +3,7 @@ import enum
...
@@ -3,6 +3,7 @@ import enum
import
cupy
import
cupy
import
numpy
as
np
import
numpy
as
np
from
karabo.bound
import
(
from
karabo.bound
import
(
BOOL_ELEMENT
,
DOUBLE_ELEMENT
,
DOUBLE_ELEMENT
,
KARABO_CLASSINFO
,
KARABO_CLASSINFO
,
OUTPUT_CHANNEL
,
OUTPUT_CHANNEL
,
...
@@ -98,10 +99,14 @@ class JungfrauGpuRunner(base_gpu.BaseGpuRunner):
...
@@ -98,10 +99,14 @@ class JungfrauGpuRunner(base_gpu.BaseGpuRunner):
def
_get_gain_map_for_preview
(
self
):
def
_get_gain_map_for_preview
(
self
):
return
self
.
input_gain_map_gpu
return
self
.
input_gain_map_gpu
def
load_data
(
self
,
image_data
,
input_gain_map
,
cell_table
):
def
load_data
(
self
,
image_data
,
input_gain_map
,
cell_table
,
daq_transpose
=
False
):
"""
Experiment: loading all three in one function as they are tied
"""
"""
Experiment: loading all three in one function as they are tied
"""
self
.
input_data_gpu
.
set
(
image_data
)
if
daq_transpose
:
self
.
input_gain_map_gpu
.
set
(
input_gain_map
)
self
.
input_data_gpu
[:]
=
cupy
.
asarray
(
image_data
).
transpose
()[
0
]
self
.
input_gain_map_gpu
[:]
=
cupy
.
asarray
(
input_gain_map
).
transpose
()[
0
]
else
:
self
.
input_data_gpu
.
set
(
image_data
)
self
.
input_gain_map_gpu
.
set
(
input_gain_map
)
if
self
.
burst_mode
:
if
self
.
burst_mode
:
self
.
cell_table_gpu
.
set
(
cell_table
)
self
.
cell_table_gpu
.
set
(
cell_table
)
...
@@ -253,6 +258,7 @@ class JungfrauCorrection(BaseCorrection):
...
@@ -253,6 +258,7 @@ class JungfrauCorrection(BaseCorrection):
_calcat_friend_class
=
JungfrauCalcatFriend
_calcat_friend_class
=
JungfrauCalcatFriend
_constant_enum_class
=
JungfrauConstants
_constant_enum_class
=
JungfrauConstants
_managed_keys
=
BaseCorrection
.
_managed_keys
.
copy
()
_managed_keys
=
BaseCorrection
.
_managed_keys
.
copy
()
_schema_cache_fields
=
BaseCorrection
.
_schema_cache_fields
.
copy
()
_image_data_path
=
"
data.adc
"
_image_data_path
=
"
data.adc
"
_cell_table_path
=
"
data.memoryCell
"
_cell_table_path
=
"
data.memoryCell
"
...
@@ -281,6 +287,22 @@ class JungfrauCorrection(BaseCorrection):
...
@@ -281,6 +287,22 @@ class JungfrauCorrection(BaseCorrection):
.
commit
(),
.
commit
(),
)
)
(
BOOL_ELEMENT
(
expected
)
.
key
(
"
dataFormat.daqTranspose
"
)
.
displayedName
(
"
Transpose axes from DAQ
"
)
.
description
(
"
Data on daqOutput channel has interesting axis order. In online
"
"
deployments, this means that a transpose is needed before correction.
"
)
.
assignmentOptional
()
.
defaultValue
(
True
)
.
reconfigurable
()
.
commit
(),
)
JungfrauCorrection
.
_schema_cache_fields
.
add
(
"
dataFormat.daqTranspose
"
)
JungfrauCorrection
.
_managed_keys
.
add
(
"
dataFormat.daqTranspose
"
)
(
(
OUTPUT_CHANNEL
(
expected
)
OUTPUT_CHANNEL
(
expected
)
.
key
(
"
preview.outputGainMap
"
)
.
key
(
"
preview.outputGainMap
"
)
...
@@ -341,7 +363,10 @@ class JungfrauCorrection(BaseCorrection):
...
@@ -341,7 +363,10 @@ class JungfrauCorrection(BaseCorrection):
cell_table
=
cell_table
[
np
.
newaxis
]
cell_table
=
cell_table
[
np
.
newaxis
]
try
:
try
:
self
.
kernel_runner
.
load_data
(
self
.
kernel_runner
.
load_data
(
image_data
,
data_hash
.
get
(
"
data.gain
"
),
cell_table
image_data
,
data_hash
.
get
(
"
data.gain
"
),
cell_table
,
daq_transpose
=
self
.
_schema_cache
[
"
dataFormat.daqTranspose
"
]
)
)
except
ValueError
as
e
:
except
ValueError
as
e
:
self
.
log_status_warn
(
f
"
Failed to load data:
{
e
}
"
)
self
.
log_status_warn
(
f
"
Failed to load data:
{
e
}
"
)
...
...
This diff is collapsed.
Click to expand it.
David Hammer
@hammerd
mentioned in commit
8d3ea1c8
·
3 years ago
mentioned in commit
8d3ea1c8
mentioned in commit 8d3ea1c89dfa945007a081e58445150b9e844e01
Toggle commit list
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