#---------------------------------------------------- # # Fresnel Free Imaging Script # for PicoProbe Instrument # N. J. Zaluzec # Email: Zaluzec@microscopy.com # Version 20240820 # # this is free code to mitigate frensel fringes from the # condensor apeture in CTEM images # See the reference below # for details. # # Reference: # Fresnel Free Imaging Mode (FFIM) for Transmission # Electron Microscopy: A Computationally Mediated Solution # using Spatio-Temporal Functionalization of the Illumination Optics # Ref: Microscopy and Microanalysis, 30 (Suppl 1), 2024, 1634–1638 # # https://doi.org/10.1093/mam/ozae044.806 # # Note: Lines # 29,30,39,43,47,76,83 will be vendor specific # #---------------------------------------------------- # Import a connection to your microscope control system # this will be vendor specific python script calls # check with your instrument vendor for specifics. from Vendorscript_tem_connection_client import TemConnection from Vendorscript_tem_connection_client.allfunctions import * import time import math print("Starting FFIM - Code Courtesy of Nestor Zaluzec") # these lines will be vendor specific # define the instrument microscope = TemConnection() #connect to scope using a Network IP connection # these lines will bee vendor specific microscope.connect("192.168.0.1") # Get current beam size # these lines will bee vendor specific beam_size=microscope.beam_diameter print("Current Beam Diameter : " , beam_size) StartingBeamDiameter=beam_size # store this for recall # define a few parameters wait_time=0.001 time.sleep(wait_time) factor=1 multiplier=.15 #0.15 is default # this is a small loop that changes the beam diameter # the larger the number of loops the longer the # oscillations will loop and mitigate the fringes # numberofloops= 10 is a few seconds 100000 is a long time # try this with a 1 second detector exposure and then iterate # as needed to fit your experiment numberofloops=10; for jj in range(0,numberofloops): for j in range (1,20): if (factor>0): mfactor=1 + (j)*multiplier/20 if(factor<0): mfactor=1 + (multiplier - (j)*multiplier/20) # this changes the beam diameter a small amount microscope.beam_diameter=beam_size*(mfactor) #this just tells us that something is happening it can be deleted print("Iteration, factor, mfactor, Beam Diameter : ",jj, factor, mfactor, microscope.beam_diameter) factor=factor*-1 time.sleep(wait_time) # All done now restore original Beam diameter. microscope.beam_diameter=StartingBeamDiameter # we are done tell the world print ("Fresnel Free Done")