Skip to content
Snippets Groups Projects
Commit 63101c18 authored by Hugo chauvet's avatar Hugo chauvet
Browse files

add a test to better detect excitation scanning mode

parent 14cd839e
Branches
No related tags found
No related merge requests found
......@@ -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
......
......@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
[project]
name = "DITB"
version = "20240526rc1"
version = "20240526rc2"
readme = "README.md"
requires-python = ">=3.11"
authors = [{ name = "Hugo Chauvet", email = "hugo.chauvet@synchrotron-soleil.fr" }]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment