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
Merge requests
!186
Improved BOZ flat field
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Improved BOZ flat field
boz_flat_field
into
master
Overview
0
Commits
23
Pipelines
0
Changes
1
Merged
Loïc Le Guyader
requested to merge
boz_flat_field
into
master
2 years ago
Overview
0
Commits
23
Pipelines
0
Changes
1
Expand
adds low and high threshold on product and ratio of ROIs to calculate flat field correction
adds default flat field guess for the fit as parameters
implement hexagonal lattice for DSSC pixels
breaks left/right symmetry for flat field fitting since zone plate can be slightly rotated
implements a refine fit with regularization for flat field calculation
implements dask auto rechunking
Closes
#53 (closed)
#55 (closed)
Edited
2 years ago
by
Loïc Le Guyader
0
0
Merge request reports
Viewing commit
a0996f77
Show latest version
1 file
+
9
−
8
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
a0996f77
Flat field mean regularization computed on ratio
· a0996f77
Loïc Le Guyader
authored
2 years ago
src/toolbox_scs/routines/boz.py
+
9
−
8
Options
@@ -1054,16 +1054,17 @@ def ff_refine_crit(p, alpha, params, arr_dark, arr, tid, rois,
# drop saturated shots
d
=
data
.
where
(
data
[
'
sat_sat
'
]
==
False
,
drop
=
True
)
rn
=
xas
(
d
,
40
,
Iokey
=
'
0
'
,
Itkey
=
'
n
'
,
nrjkey
=
'
0
'
)
rp
=
xas
(
d
,
40
,
Iokey
=
'
0
'
,
Itkey
=
'
p
'
,
nrjkey
=
'
0
'
)
rd
=
xas
(
d
,
40
,
Iokey
=
'
p
'
,
Itkey
=
'
n
'
,
nrjkey
=
'
0
'
)
rn
=
xas
(
d
,
40
,
Iokey
=
'
0
'
,
Itkey
=
'
n
'
,
nrjkey
=
'
0
'
,
fluorescence
=
True
)
rp
=
xas
(
d
,
40
,
Iokey
=
'
0
'
,
Itkey
=
'
p
'
,
nrjkey
=
'
0
'
,
fluorescence
=
True
)
rd
=
xas
(
d
,
40
,
Iokey
=
'
p
'
,
Itkey
=
'
n
'
,
nrjkey
=
'
0
'
,
fluorescence
=
True
)
err
=
np
.
nansum
(
rn
[
'
sigmaA
'
])
+
np
.
nansum
(
rp
[
'
sigmaA
'
])
+
np
.
nansum
(
rd
[
'
sigmaA
'
])
mean
=
((
1.0
-
np
.
nanmean
(
rn
[
'
muA
'
]))
**
2
+
(
1.0
-
np
.
nanmean
(
rp
[
'
muA
'
]))
**
2
+
(
1.0
-
np
.
nanmean
(
rd
[
'
muA
'
]))
**
2
)
err_sigma
=
(
np
.
nansum
(
rn
[
'
sigmaA
'
])
+
np
.
nansum
(
rp
[
'
sigmaA
'
])
+
np
.
nansum
(
rd
[
'
sigmaA
'
]))
err_mean
=
((
1.0
-
np
.
nanmean
(
rn
[
'
muA
'
]))
**
2
+
(
1.0
-
np
.
nanmean
(
rp
[
'
muA
'
]))
**
2
+
(
1.0
-
np
.
nanmean
(
rd
[
'
muA
'
]))
**
2
)
return
1e3
*
(
err
*
alpha
+
(
1
-
alpha
)
*
mean
)
return
1e3
*
(
alpha
*
err_sigma
+
(
1
-
alpha
)
*
err_
mean
)
def
ff_refine_fit
(
params
):
Loading