-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAutomated_Alignment.py
More file actions
35 lines (27 loc) · 2.84 KB
/
Automated_Alignment.py
File metadata and controls
35 lines (27 loc) · 2.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
from output_logging import Logger, signal_handler
import Automated_Alignment_Code
import pyautogui
import datetime
import signal
import sys
if '..' not in sys.path:
sys.path.append('..')
if __name__ == "__main__":
# Program Inputs
objective, DiLL = '63x', False # Specify the microscope objective being used as '63x', '25x', or '10x'. Set DiLL to True if printing in DiLL mode, set it to False if printing in oil immersion mode.
angle, Y_south = 31.317, False # Angle Y-Axis value obtained from NanoWrite. Set Y_south to False if the alignment marker's +Y arrow points upward, set it to True if the +Y arrow points downward.
jobs = 1 # If you have more than one unique job file to print, set jobs to the number of different job files you have, otherwise set jobs = 1.
rows, columns = 2, 3 # Number of rows and columns (set rows = 1 and columns = 1 if you only have one structure to print on).
array_spacing_X = 150 # Horizontal center-to-center distance (in microns) between the array positions.
array_spacing_Y = 200 # Vertical center-to-center distance (in microns) between the array positions.
move_to_find_interface = 100 # Distance (in microns) the stage moves away in the +Y direction from the printed structure(s) for interface finding.
square_side_length = 40 # Side length (in microns) of the square formed by the four alignment markers.
detection_params = 'default' # Check circle_detection.py to look at the possible set of circle detection parameters (i.e. recipes) that can be used (the one to select depends on the resin and substrate you are printing with as well as the marker diameter).
sys.stdout = Logger() # Starts logging the python console output to a .txt file with the date and time.
signal.signal(signal.SIGINT, signal_handler) # Saves the console output to the .txt file even if the program was aborted (does not work if the program is aborted while it was waiting for a .gwl file to finish executing).
start_time = datetime.datetime.now() # Logs the time the program is executed.
Automated_Alignment_Code.main(objective, DiLL, angle, Y_south, jobs, rows, columns, array_spacing_X, array_spacing_Y, move_to_find_interface, square_side_length, detection_params) # Executes the main automated alignment code.
end_time = datetime.datetime.now() # Logs the time the program finishes executing.
print(f'\nAutomated_Alignment.py has finished.\nTime taken: {end_time - start_time}') # Prints out the total time taken by the program.
sys.stdout.flush() # Stops the logging and saves the .txt file with the console output.
pyautogui.alert(text='Automated_Alignment.py has finished.', title='Automated_Alignment.py', button='OK') # Displays a message box stating that the program finished executing.