Scripting Resources for DigitalMicrograph™

banner

Dave Mitchell's DigitalMicrograph™ Scripting Website

Home | Scripts | Examples | Functions | Recent Updates | Tutorials | Resources | Publications | Consulting | Projects | Contact & Bio |PyJEM| Search

 

Drift Measurement
Function

Script which periodically captures CCD or STEM images and uses cross correlation to measure the specimen drift. A cross correlation image, a vector plot (showing the direction and magnitude of the drift) and a plot of the instantaneous drift rate is displayed.

Version
version:20200329, v2.2
Author
D. R. G. Mitchell
Acknowledgements
Thanks to VIncent Hou for showing how to run a background thread from within a dialog.
Comments

Use this script to quantify the drift performance of your microscope and see if it meets specification. Microscope engineers typically use this type of software at installation to check the stage performance. This is useful for identifying when a goniometer is not performing as it should. Typical rates for modern instruments are of the order of <1nm/min after 30mins or so of settling. The script may also be useful for troubleshooting other sources of drift such as fluctuations in chilled water temperature or air conditioning cycling.

Two versions of this script are provided in a zip archive. The original script (labelled TEM and STEM) is unchanged and is designed to enable either TEM or STEM-based measurements on microscopes which have both a Gatan CCD camera and a DigiScan scanning system attached. Attempting to run this script on a system which does not have DigiScan results in an error.

For users who do not have DigiScan but do have a Gatan camera, a second script labelled (TEM Only) is provided. This is designed to carry out drift measurements in TEM mode only.

System Requirements
Tested on GMS 2 running on a JEOL ARM200F with a Gatan Ultrascan camera and a DigiScan II under GMS 2.3 64bit and on a JEOL 2010 running a Gatan Orius camera. It will probably work with most types of Gatan CCD cameras. Ensure all work and DM settings have been saved before testing.
Known Issues

The script excises the largest 2^n x 2^n region from within the camera image (where n is an integer) to use for cross correlation. For non-square camera formats such as from an Orius - square images will be obtained. This script uses the newer Camera Manager functions. I am not sure when these were introduced, but compatibility with older CCD systems may be limited. Compatibility can be tested by simply having a live view image on the screen (to ensure camera communication is working), then start this script. If an error occurs or an image is not acquired, the script is not compatible with your system. It is trivial to swap out the new camera acquisition code for the older - more backwardly compatible - CCD acquisition commands. Contact the author if you encounter issues.

I find that theDigiScan II plugin software I have is very brittle. Even the Gatan demonstration code can cause DM to crash. It is recommended that you stick to STEM image sizes which are 2^n square (eg 512 x 512, 1024 x 1024 etc). The image exposure time is the total exposure time, so using large image sizes means very short dwells. Such images may become noisy and accuracy may suffer.

Supported
Yes
Included Files
Two versions of the script are supplied: one for TEM and STEM and the other for TEM only. Scripts are supplied in a zip archive.
Source Code

See attached zip archive.