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
1f9899fd
Commit
1f9899fd
authored
6 months ago
by
Hugo chauvet
Browse files
Options
Downloads
Patches
Plain Diff
correct bug in multi emission filter and multi exposure
parent
086b44c8
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
ditb/exposure/darkwhite_correction.py
+20
-6
20 additions, 6 deletions
ditb/exposure/darkwhite_correction.py
with
20 additions
and
6 deletions
ditb/exposure/darkwhite_correction.py
+
20
−
6
View file @
1f9899fd
...
...
@@ -346,6 +346,9 @@ def correct_dark_white(images: str, dark: str = '', white: str = '' ,
# find the position in the white of this excitation
i_white_ex
=
all_white_ex_wavelength
.
index
(
img_ex_wavelengths
)
# Print the paired
print
(
f
'
for channel
{
img_ch_names
[
chan
]
}
pos
{
chan
}
in data use white position
{
i_white_ex
}
'
)
# Put the white (corrected from the dark of white) value at the good place in the new_white
n_white
[
0
,
0
,
chan
,
0
]
=
final_white
[
0
,
0
,
i_white_ex
,
0
]
...
...
@@ -367,17 +370,28 @@ def correct_dark_white(images: str, dark: str = '', white: str = '' ,
diff_im_darks
[
diff_im_darks
<
0
]
=
0
if
version
==
2
:
powerEallfilter
=
np
.
copy
(
powerEstimation
)
# Need to check all wavelength in the dataset
powerEallfilter
=
np
.
ones
(
images
.
shape
[
2
])
# Check if the white has the same number of filter that the images
if
diff_im_darks
.
shape
[
2
]
!=
len
(
powerEstimation
):
# If not Need to find the visible to put it's power to one
i_vis
=
0
for
chan
in
range
(
diff_im_darks
.
shape
[
2
]):
if
'
vis
'
in
img_ch_names
[
chan
].
lower
():
i_vis
=
chan
break
print
(
f
'
Visible power set to 1 on position
{
i_vis
}
'
)
powerEallfilter
=
np
.
insert
(
powerEstimation
,
i_vis
,
1.0
)
if
'
vis
'
not
in
img_ch_names
[
chan
].
lower
():
# get the excitation wavelength of the image for this channel
img_ex_wavelengths
=
get_mono_position
(
meta
,
chan
)
# find the position in the white of this excitation
i_white_ex
=
all_white_ex_wavelength
.
index
(
img_ex_wavelengths
)
# Print the paired
print
(
f
'
for channel
{
img_ch_names
[
chan
]
}
pos
{
chan
}
in data use the power estimation position
{
i_white_ex
}
'
)
powerEallfilter
[
chan
]
=
powerEstimation
[
i_white_ex
]
else
:
print
(
f
'
Power estimation set to 1 for channel
{
img_ch_names
[
chan
]
}
pos
{
chan
}
'
)
# divide the data by the power estimation
diff_im_darks
=
diff_im_darks
/
powerEallfilter
[
None
,
None
,
:,
None
,
None
,
None
]
...
...
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