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
b9b26f8a
Commit
b9b26f8a
authored
7 months ago
by
Philipp Schmidt
Browse files
Options
Downloads
Patches
Plain Diff
Apply padding to more AGIPD constants when loading
parent
997710c1
Branches
fix/pad-more-constants
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!113
Apply padding to more AGIPD constants when loading
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/calng/corrections/AgipdCorrection.py
+4
-7
4 additions, 7 deletions
src/calng/corrections/AgipdCorrection.py
with
4 additions
and
7 deletions
src/calng/corrections/AgipdCorrection.py
+
4
−
7
View file @
b9b26f8a
...
@@ -470,9 +470,6 @@ class AgipdBaseRunner(base_kernel_runner.BaseKernelRunner):
...
@@ -470,9 +470,6 @@ class AgipdBaseRunner(base_kernel_runner.BaseKernelRunner):
else
:
else
:
self
.
md_additional_offset
.
fill
(
0
)
self
.
md_additional_offset
.
fill
(
0
)
elif
constant
is
Constants
.
SlopesFF
:
elif
constant
is
Constants
.
SlopesFF
:
# Always has 352 cells, so allocating the right size in
# rel_gain_map fixes the shape problems here.
# constant shape: y, x, memory cell
# constant shape: y, x, memory cell
if
constant_data
.
shape
[
2
]
==
2
:
if
constant_data
.
shape
[
2
]
==
2
:
# TODO: remove support for old format
# TODO: remove support for old format
...
@@ -486,9 +483,9 @@ class AgipdBaseRunner(base_kernel_runner.BaseKernelRunner):
...
@@ -486,9 +483,9 @@ class AgipdBaseRunner(base_kernel_runner.BaseKernelRunner):
self
.
_constant_memory_cells
,
self
.
_constant_memory_cells
,
),
),
)
)
self
.
xray_gain_map
[:]
=
self
.
_xp
.
asarray
(
self
.
xray_gain_map
[:]
=
self
.
_pad_constant
(
self
.
_xp
.
asarray
(
constant_data
.
transpose
(),
dtype
=
np
.
float32
constant_data
.
transpose
(),
dtype
=
np
.
float32
)[:
self
.
_constant_memory_cells
]
),
value
=
1.0
)[:
self
.
_constant_memory_cells
]
else
:
else
:
assert
constant
in
bad_pixel_constants
assert
constant
in
bad_pixel_constants
if
(
if
(
...
@@ -507,7 +504,7 @@ class AgipdBaseRunner(base_kernel_runner.BaseKernelRunner):
...
@@ -507,7 +504,7 @@ class AgipdBaseRunner(base_kernel_runner.BaseKernelRunner):
):
):
# BadPixelsFF is not per gain stage - broadcasting along gain
# BadPixelsFF is not per gain stage - broadcasting along gain
constant_data
=
self
.
_xp
.
broadcast_to
(
constant_data
=
self
.
_xp
.
broadcast_to
(
constant_data
.
transpose
()[
self
.
_pad_constant
(
constant_data
.
transpose
()
)
[
:
self
.
_constant_memory_cells
,
...,
np
.
newaxis
:
self
.
_constant_memory_cells
,
...,
np
.
newaxis
],
],
self
.
_gm_map_shape
,
self
.
_gm_map_shape
,
...
@@ -518,7 +515,7 @@ class AgipdBaseRunner(base_kernel_runner.BaseKernelRunner):
...
@@ -518,7 +515,7 @@ class AgipdBaseRunner(base_kernel_runner.BaseKernelRunner):
):
):
# old BadPixelsPC have different axis order
# old BadPixelsPC have different axis order
constant_data
=
self
.
_xp
.
broadcast_to
(
constant_data
=
self
.
_xp
.
broadcast_to
(
constant_data
.
transpose
((
0
,
2
,
1
))[
self
.
_pad_constant
(
constant_data
.
transpose
((
0
,
2
,
1
))
)
[
:
self
.
_constant_memory_cells
,
...,
np
.
newaxis
:
self
.
_constant_memory_cells
,
...,
np
.
newaxis
],
],
self
.
_gm_map_shape
,
self
.
_gm_map_shape
,
...
...
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