Aperture selection through tem controller » History » Version 4
Anchi Cheng, 04/24/2020 04:19 PM
| 1 | 1 | Anchi Cheng | h1. Aperture selection through tem controller |
|---|---|---|---|
| 2 | |||
| 3 | This feature allows selection of aperture of TFS microscopes with automated apertures. The current implementation uses AutoIt Scripting and reads the configuration from c:\Program Files (x86)\myami\fei.cfg |
||
| 4 | |||
| 5 | h2. Setup |
||
| 6 | |||
| 7 | h3. compile autoit script |
||
| 8 | |||
| 9 | The script is pyscope/autoit/ApertureSelection.au3 |
||
| 10 | 2 | Anchi Cheng | Use AutoIt suite to compile it. Either 32 or 64-bit version works as far as I know. Save the executable at the place you plan to specify in fei.cfg |
| 11 | 1 | Anchi Cheng | |
| 12 | h3. Setup pyscope fei.cfg |
||
| 13 | |||
| 14 | Copy from pyscope/fei.cfg.template these lines to fei.cfg used on your scope. In standard installation, this should be "c:\Program Files (x86)\myami\fei.cfg" |
||
| 15 | |||
| 16 | Modify these settings according to your scope. |
||
| 17 | |||
| 18 | <pre> |
||
| 19 | [aperture] |
||
| 20 | # Disable control of auto apertures if not working or not available |
||
| 21 | # not all versions of microscope software allows auto aperture control |
||
| 22 | # from scripting level. |
||
| 23 | USE_AUTO_APERTURE = False |
||
| 24 | # AutoIt Automation |
||
| 25 | AUTOIT_APERTURE_SELECTION_EXE_PATH = c:\Users\supervisor\Desktop\Anchi\AutoItScripts\ApertureSelection.exe |
||
| 26 | # Does the Titan column has automated c3 aperture ? This affects the id of the |
||
| 27 | # gui button for AutoIt script. |
||
| 28 | HAS_AUTO_C3 = True |
||
| 29 | # Individual aperture selections. If retractable, add open at the end of the list |
||
| 30 | 2 | Anchi Cheng | # List these in the order of what appears in the TUI |
| 31 | 1 | Anchi Cheng | # Note: can not handle multiple apertures of the same name. |
| 32 | CONDENSER_2 = 150, 100, 50, 20 |
||
| 33 | OBJECTIVE = 100, 70, 50, open |
||
| 34 | # Optional selected area aperture control. comment or remove the line to deactivate it. |
||
| 35 | SELECTED_AREA = 200,100, 40, 10, open |
||
| 36 | 2 | Anchi Cheng | |
| 37 | </pre> |
||
| 38 | |||
| 39 | h2. Testing |
||
| 40 | |||
| 41 | h3. Testing the AutoIt executable |
||
| 42 | |||
| 43 | # Open TEM user interface. |
||
| 44 | # Retract the objective aperture. |
||
| 45 | # Double click Autoit executable to run. |
||
| 46 | If this works right, it should insert the 100 um aperture. |
||
| 47 | |||
| 48 | h3. Testing in with python command from pyscope |
||
| 49 | |||
| 50 | <pre> |
||
| 51 | from pyscope import fei |
||
| 52 | f=fei.Krios() # Change this to match your instrument class |
||
| 53 | |||
| 54 | f.getApertureSelections('objective') # This should give you the list you specified in fei.cfg |
||
| 55 | '100', '70', '50' , 'open' |
||
| 56 | |||
| 57 | f.getApertureSelection('objective') # The returned value should be the current aperture position as a string |
||
| 58 | '100' |
||
| 59 | |||
| 60 | f.setApertureSelection('objective', '50') # This should insert the 50 um aperture |
||
| 61 | |||
| 62 | f.retractApertureMechanism('objective') # This should retract the aperture as if you click on the Activate/Deactivate aperture button to disable it. |
||
| 63 | 1 | Anchi Cheng | |
| 64 | </pre> |
||
| 65 | 3 | Anchi Cheng | |
| 66 | h2. Use it in Leginon |
||
| 67 | |||
| 68 | 4 | Anchi Cheng | The most likely usage of this is in [[TEM_Controller|TEM controller]] (aliased as TEM_Remote in MSI application). |