Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
onlineXPCS
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
Package Registry
Model registry
Operate
Environments
Terraform modules
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
dataAnalysis
onlineXPCS
Commits
dde9ab6f
Commit
dde9ab6f
authored
11 months ago
by
Jakobsen, Mads Bregenholt
Browse files
Options
Downloads
Patches
Plain Diff
added photonization via photon energy
parent
ed15b532
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
xpcs/src/xpcs/xpcs.py
+22
-3
22 additions, 3 deletions
xpcs/src/xpcs/xpcs.py
with
22 additions
and
3 deletions
xpcs/src/xpcs/xpcs.py
+
22
−
3
View file @
dde9ab6f
...
...
@@ -13,6 +13,8 @@ class Xpcs(BaseCorrectionAddon):
def
__init__
(
self
,
config
):
self
.
_ttcdata
=
TTCdata
()
self
.
_mask_path
=
config
[
"
mask_path
"
]
self
.
_photon_energy
=
config
.
get
(
"
photonEnergy
"
)
self
.
_module_no
=
None
self
.
_current_image_mean
=
0
...
...
@@ -20,6 +22,7 @@ class Xpcs(BaseCorrectionAddon):
self
.
_sparse_array
=
None
self
.
_cal_mask
=
None
global
cupy
import
cupy
...
...
@@ -41,6 +44,18 @@ class Xpcs(BaseCorrectionAddon):
.
defaultValue
(
""
)
.
reconfigurable
()
.
commit
(),
# value of the photon energy. used for the photonization step
DOUBLE_ELEMENT
(
schema
)
.
key
(
f
"
{
prefix
}
.photonEnergy
"
)
.
tags
(
"
managed
"
)
.
assignmentOptional
()
.
defaultValue
(
8.0
)
.
reconfigurable
()
.
commit
(),
)
@staticmethod
...
...
@@ -72,6 +87,10 @@ class Xpcs(BaseCorrectionAddon):
self
.
_mask_path
=
changed_config
[
"
mask_path
"
]
self
.
set_mask
()
if
changed_config
.
has
(
"
photonEnergy
"
):
self
.
_photon_energy
=
changed_config
[
"
photonEnergy
"
]
def
post_correction
(
self
,
data
,
cell_table
,
pulse_table
,
output_hash
):
global
cupy
...
...
@@ -79,11 +98,11 @@ class Xpcs(BaseCorrectionAddon):
data
[
0
]
=
0
# Photonize
# print(f"Unphotonized mean ({data.shape}): {np.nanmean(data)}")
start
=
time
.
time
()
data
/=
10
data
[
data
<
0
]
=
0
data
/=
self
.
_photon_energy
np
.
around
(
data
,
out
=
data
)
# print(f"Photonized mean: {np.nanmean(data)}")
# Sparsify
...
...
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