Skip to content
Snippets Groups Projects
Commit c563f8b2 authored by Hugo CHAUVET's avatar Hugo CHAUVET :bicyclist:
Browse files

Correct new position of ANDOR camera for data after april 2025

parent a50c45e6
No related branches found
No related merge requests found
...@@ -15,6 +15,7 @@ and launch it from the script editor by pressing F5. Or using the Run button. ...@@ -15,6 +15,7 @@ and launch it from the script editor by pressing F5. Or using the Run button.
@author: H. Chauvet (synchrotron-soleil) @author: H. Chauvet (synchrotron-soleil)
Used IJ plugins: Bio-Formats, BaSIC Used IJ plugins: Bio-Formats, BaSIC
VERSION: 02042025
""" """
...@@ -126,6 +127,16 @@ def getWidthHeight(metadata): ...@@ -126,6 +127,16 @@ def getWidthHeight(metadata):
return width, height return width, height
def getAcqDate(metadata):
"""
Get the acquisition date from metadata
"""
starttime = metadata['Summary']['StartTime'].split(' ')[0]
year, month, day = starttime.split('-')
return int(year), int(month), int(day)
def load_image_tiles_stack(images_dir): def load_image_tiles_stack(images_dir):
""" """
Fonction pour charge le stack d'images depuis Fonction pour charge le stack d'images depuis
...@@ -183,7 +194,7 @@ def load_image_tiles_stack(images_dir): ...@@ -183,7 +194,7 @@ def load_image_tiles_stack(images_dir):
regex_cpt_roi = None regex_cpt_roi = None
name_pattern = 'Default' name_pattern = 'Default'
# Save the base directory #Save the base directory
base_dir = os.path.abspath(d) base_dir = os.path.abspath(d)
if regex_cpt_roi is not None: if regex_cpt_roi is not None:
...@@ -870,7 +881,14 @@ def extract_tile_positions(metadata, selected_roi, tilesondisk, tilename='tile_' ...@@ -870,7 +881,14 @@ def extract_tile_positions(metadata, selected_roi, tilesondisk, tilename='tile_'
yt = [yt[i] for i in igood] yt = [yt[i] for i in igood]
if ANDOR: if ANDOR:
# Test the date of acquisition Their as been a rotation of the ANDOR Camera at the beginning of APRIL 2025
y, m, d = getAcqDate(metadata)
if y <= 2025 and m < 4:
IJ.log('Use the old position of the ANDOR camera')
xt = [-x for x in xt] xt = [-x for x in xt]
else:
IJ.log('Use the new position of the ANDOR camera after 01/04/2025')
yt = [-y for y in yt]
xt = map(lambda x: x/pix2um, xt) xt = map(lambda x: x/pix2um, xt)
yt = map(lambda x: x/pix2um, yt) yt = map(lambda x: x/pix2um, yt)
...@@ -878,6 +896,7 @@ def extract_tile_positions(metadata, selected_roi, tilesondisk, tilename='tile_' ...@@ -878,6 +896,7 @@ def extract_tile_positions(metadata, selected_roi, tilesondisk, tilename='tile_'
xt = map(lambda x: x-int(roiwidth/2), xt) xt = map(lambda x: x-int(roiwidth/2), xt)
yt = map(lambda x: x-int(roiwidth/2), yt) yt = map(lambda x: x-int(roiwidth/2), yt)
# minus the minimum (before it was minus the first position)
xt = [x-xt[0] for x in xt] xt = [x-xt[0] for x in xt]
yt = [y-yt[0] for y in yt] yt = [y-yt[0] for y in yt]
...@@ -912,7 +931,7 @@ if __name__ in ['__builtin__','__main__']: ...@@ -912,7 +931,7 @@ if __name__ in ['__builtin__','__main__']:
fwhite = fwhite.absolutePath fwhite = fwhite.absolutePath
# Start Log # Start Log
IJ.log("------- Start MOSAIC TELEMOS -------") IJ.log("------- Start MOSAIC TELEMOS (version: 02042025)-------")
IJ.log("Image stack: %s" % fdata) IJ.log("Image stack: %s" % fdata)
IJ.log("Dark stack: %s" % fdark) IJ.log("Dark stack: %s" % fdark)
IJ.log("Dark of white stack: %s" % fdarkwhite) IJ.log("Dark of white stack: %s" % fdarkwhite)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment