Scripting Resources for DigitalMicrograph™ |
PyJEM Example: Controlling Microscope Detectors | |
Function |
An example Python script which will insert/retract the HAADF detector and raise/lower the microscope screen. |
Version |
version:20220907, v1.0 |
Author |
D. R. G. Mitchell |
Acknowledgements |
- |
Comments |
This script should be run at the microscope. It makes use of the Detector3 module. It will source the current position of the HAADF detector. If it is inserted, then it will be retracted and if retracted it will be inserted. It will also source the position of the large screen. If it is currently lowered then it will be raised and vice versa. |
System Requirements |
Written in Spyder in Anaconda3. Requires a PyJEM-equipped microscope. The script can be opened in Spyder and run from there. Alternatively, double clicking on the script will run it in Python. If the downloaded script as a generic grey file icon it does not have Python set as the default application to open it. Right click on it and set Python to open it. Python lives in the Anaconda3 folder. |
Known Issues |
The microscope will take care of the position the small insertable fluorescent screen automically in response to changes in the large screen position, ie you do not have to retract the small screen (in script) prior to raising the large screen, the microscope will do it for you in firmware. Remember that detector and screen movements take time, so delays must be included in the script, to give them time to finish responding. Sending commands to the microscope while it is busy, will generate beeps and error messages will apear in the microscope interface and the offending command will not be enacted. |
Supported |
Yes |
Included Files |
Main script file. |
Source Code |
zip archive containing the script. |