Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
D
DITB
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Issue analytics
Insights
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
DISCO Beamline
DITB
Commits
63101c18
Commit
63101c18
authored
Jun 26, 2024
by
Hugo chauvet
Browse files
Options
Downloads
Patches
Plain Diff
add a test to better detect excitation scanning mode
parent
14cd839e
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
ditb/exposure/darkwhite_correction.py
+11
-20
11 additions, 20 deletions
ditb/exposure/darkwhite_correction.py
pyproject.toml
+1
-1
1 addition, 1 deletion
pyproject.toml
with
12 additions
and
21 deletions
ditb/exposure/darkwhite_correction.py
+
11
−
20
View file @
63101c18
...
...
@@ -69,8 +69,12 @@ def correct_dark_white(images: str, dark: str = '', white: str = '' ,
# check if we do excitation scanning or not
focus_motor
=
meta_white
[
'
Roi1/Tile0
'
][
0
,
0
,
0
][
'
metadata
'
][
'
Core-Focus
'
]
# Add a test on the name of the channels
# If the channels starts with DM.... it's probably and excitation scanning
# If the channels starts with EX... it's sure that it's a multi-excitation-position
channels_start_with_DM
=
all
([
a
.
startswith
(
'
DM
'
)
for
a
in
meta
[
'
Summary
'
][
'
ChNames
'
]])
if
'
IHR
'
in
focus_motor
and
images
.
shape
[
3
]
==
white
.
shape
[
3
]:
if
'
IHR
'
in
focus_motor
and
channels_start_with_DM
and
images
.
shape
[
3
]
==
white
.
shape
[
3
]:
print
(
'
Excitation scanning normalisation
'
)
# Normalise the white (between min_ratio and 1)
...
...
@@ -214,7 +218,7 @@ def correct_dark_white(images: str, dark: str = '', white: str = '' ,
# Compute the transfert function
if
correct_LM_excitation
:
# The excitation of the white is not flat
print
(
'
Use the transfer function from the excitation spectra of the LM
'
)
print
(
'
WARNING:
Use the transfer function from the excitation spectra of the LM
, this is buggy
'
)
xlm
,
ylm
=
load_excitation_LM
()
# Interpolate the excitation spectra of the white
...
...
@@ -342,20 +346,7 @@ def correct_dark_white(images: str, dark: str = '', white: str = '' ,
diff_im_darks
[
diff_im_darks
<
0
]
=
0
# Compute the transfert function
if
correct_LM_excitation
:
# The excitation of the white is not flat
print
(
'
Use the transfer function from the excitation spectra of the LM
'
)
xlm
,
ylm
=
load_excitation_LM
()
# Interpolate the excitation spectra of the white
ylmi
=
np
.
interp
(
all_white_ex_wavelength
,
xlm
,
ylm
)
# Normalise this profile by it's maximum
ylmi_norm
=
ylmi
/
ylmi
.
max
()
# the transfert function is the excitation of the white divided by the normed white
tf
=
ylmi_norm
/
n_white
else
:
# The transfer function is just the inverse of the white
# (i.e. the excitation spectra of the white is flat)
tf
=
1
/
n_white
...
...
This diff is collapsed.
Click to expand it.
pyproject.toml
+
1
−
1
View file @
63101c18
...
...
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
[project]
name
=
"DITB"
version
=
"20240526rc
1
"
version
=
"20240526rc
2
"
readme
=
"README.md"
requires-python
=
">
=
3.11
"
authors
=
[
{
name
=
"Hugo Chauvet"
,
email
=
"hugo.chauvet@synchrotron-soleil.fr"
}
]
...
...
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