Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
ToolBox
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
SCS
ToolBox
Commits
92cb6a1f
Commit
92cb6a1f
authored
2 years ago
by
Hampus Wikmark Kreuger
Browse files
Options
Downloads
Patches
Plain Diff
Allow load_dark to load an array of dark images
parent
bd45362a
No related branches found
Branches containing commit
No related tags found
2 merge requests
!195
Commented centroid
,
!188
P2866 updates
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/toolbox_scs/detectors/hrixs.py
+10
-2
10 additions, 2 deletions
src/toolbox_scs/detectors/hrixs.py
with
10 additions
and
2 deletions
src/toolbox_scs/detectors/hrixs.py
+
10
−
2
View file @
92cb6a1f
...
@@ -5,7 +5,7 @@ import matplotlib.pyplot as plt
...
@@ -5,7 +5,7 @@ import matplotlib.pyplot as plt
from
scipy.optimize
import
leastsq
from
scipy.optimize
import
leastsq
from
scipy.optimize
import
curve_fit
from
scipy.optimize
import
curve_fit
from
scipy.signal
import
fftconvolve
from
scipy.signal
import
fftconvolve
import
xarray
as
xr
import
toolbox_scs
as
tb
import
toolbox_scs
as
tb
...
@@ -323,7 +323,15 @@ class hRIXS:
...
@@ -323,7 +323,15 @@ class hRIXS:
return
data
return
data
def
load_dark
(
self
,
runNB
,
proposal
=
None
):
def
load_dark
(
self
,
runNB
,
proposal
=
None
):
data
=
self
.
from_run
(
runNB
,
proposal
)
try
:
# Checks to see if runNB can be iterated over (is list-like)
data_list
=
[]
for
run
in
runNB
:
data_list
.
append
(
self
.
from_run
(
run
,
proposal
))
data
=
xr
.
concat
(
data_list
,
dim
=
'
trainId
'
)
except
TypeError
:
# If runNB cannot be iterated over, we assume it's a single run
data
=
self
.
from_run
(
runNB
,
proposal
)
self
.
dark_image
=
data
[
'
hRIXS_det
'
].
mean
(
dim
=
'
trainId
'
)
self
.
dark_image
=
data
[
'
hRIXS_det
'
].
mean
(
dim
=
'
trainId
'
)
self
.
USE_DARK
=
True
self
.
USE_DARK
=
True
...
...
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