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
aeb03f6a
Commit
aeb03f6a
authored
3 years ago
by
David Hammer
Browse files
Options
Downloads
Patches
Plain Diff
Add override to ignore strange input axis order
parent
cd39e039
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
+29
-6
29 additions, 6 deletions
src/calng/AgipdCorrection.py
src/calng/base_correction.py
+1
-1
1 addition, 1 deletion
src/calng/base_correction.py
with
30 additions
and
7 deletions
src/calng/AgipdCorrection.py
+
29
−
6
View file @
aeb03f6a
...
...
@@ -35,16 +35,26 @@ class AgipdCorrection(BaseCorrection):
_gpu_runner_class
=
AgipdGpuRunner
_calcat_friend_class
=
AgipdCalcatFriend
_constant_enum_class
=
AgipdConstants
_managed_keys
=
BaseCorrection
.
_managed_keys
[:]
_managed_keys
=
BaseCorrection
.
_managed_keys
[:]
+
[
"
overrideInputAxisOrder
"
]
# this is just extending (not mandatory)
_schema_cache_fields
=
BaseCorrection
.
_schema_cache_fields
|
{
"
sendGainMap
"
}
_schema_cache_fields
=
BaseCorrection
.
_schema_cache_fields
|
{
"
sendGainMap
"
,
"
overrideInputAxisOrder
"
,
}
@staticmethod
def
expectedParameters
(
expected
):
super
(
AgipdCorrection
,
AgipdCorrection
).
expectedParameters
(
expected
)
expected
.
setDefaultValue
(
"
dataFormat.memoryCells
"
,
352
)
(
BOOL_ELEMENT
(
expected
)
.
key
(
"
overrideInputAxisOrder
"
)
.
displayedName
(
"
Override input axis order
"
)
.
assignmentOptional
()
.
defaultValue
(
False
)
.
reconfigurable
()
.
commit
(),
STRING_ELEMENT
(
expected
)
.
key
(
"
gainMode
"
)
.
displayedName
(
"
Gain mode
"
)
...
...
@@ -188,10 +198,10 @@ class AgipdCorrection(BaseCorrection):
@property
def
input_data_shape
(
self
):
return
(
self
.
get
(
"
dataFormat.memoryCells
"
)
,
self
.
_schema_cache
[
"
dataFormat.memoryCells
"
]
,
2
,
self
.
get
(
"
dataFormat.pixelsX
"
)
,
self
.
get
(
"
dataFormat.pixelsY
"
)
,
self
.
_schema_cache
[
"
dataFormat.pixelsX
"
]
,
self
.
_schema_cache
[
"
dataFormat.pixelsY
"
]
,
)
def
__init__
(
self
,
config
):
...
...
@@ -269,6 +279,14 @@ class AgipdCorrection(BaseCorrection):
and
self
.
_schema_cache
[
"
preview.enable
"
]
)
if
self
.
_schema_cache
[
"
overrideInputAxisOrder
"
]:
expected_shape
=
self
.
input_data_shape
if
expected_shape
!=
image_data
.
shape
:
self
.
log
.
INFO
(
f
"
Overriding input data order from
{
image_data
.
shape
}
to
{
expected_shape
}
"
)
image_data
.
shape
=
expected_shape
with
self
.
_buffer_lock
:
# cell_table = cell_table[self.pulse_filter]
pulse_table
=
np
.
squeeze
(
data
.
get
(
"
image.pulseId
"
))
# [self.pulse_filter]
...
...
@@ -280,7 +298,12 @@ class AgipdCorrection(BaseCorrection):
"
corrected.
"
)
self
.
gpu_runner
.
load_data
(
image_data
)
try
:
self
.
gpu_runner
.
load_data
(
image_data
)
except
ValueError
as
e
:
self
.
log_status_warn
(
f
"
Failed to load data:
{
e
}
"
)
return
buffer_handle
,
buffer_array
=
self
.
_shmem_buffer
.
next_slot
()
self
.
gpu_runner
.
load_cell_table
(
cell_table
)
self
.
gpu_runner
.
correct
(
self
.
_correction_flag_enabled
)
...
...
This diff is collapsed.
Click to expand it.
src/calng/base_correction.py
+
1
−
1
View file @
aeb03f6a
...
...
@@ -57,8 +57,8 @@ class BaseCorrection(PythonDevice):
]
# subclass must extend this and put it in schema
_schema_cache_fields
=
{
"
doAnything
"
,
"
dataFormat.memoryCells
"
,
"
constantParameters.memoryCells
"
,
"
dataFormat.memoryCells
"
,
"
dataFormat.pixelsX
"
,
"
dataFormat.pixelsY
"
,
"
dataFormat.outputAxisOrder
"
,
...
...
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