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

 

PyJEM: Static SADP
Function
A Python script to allow camera length to be changed in TEM/Diffraction mode without pattern movement.
Version
version:20220921, v1.0
Author
D. R. G. Mitchell
Acknowledgements
-
Comments

Unfortunately, JEOL TEMs do not typically have seperate memory registers for PLA values at each camera length. Despite the best mechanical alignment procedure, diffraction patterns will move a lot while changing camera length, even after running Lens Relaxation to remove hysteresis. Recentring the pattern with the Projector Lens Alignment shifts is trivial. However, if you are routinely recording patterns at two or more different camera lengths, then this becomes tiresome.

Every microscope will be different, due to the vagaries of lens mechanical alignments and tolerances. On my microscope, if I centre the SADP at 300mm, then change the camera length in the microscope interface to 1000mm, the (000) will move from the centre of the small screen to about 75% of the radius of the small screen. This is almost at the point at which it is outside the field of view of the binoculars. If I make the same change with this script, the spot is almost touching the black spot in the centre of the screen.

This script, in effect, creates sepearate memory registers for storing PLA shift values for all the camera lengths you select. When you change camera length through the script, it will apply the saved PLA values to centre the pattern. Lens Relaxation (Mag -> Diff schedule) must be run after each camera length change. Unfortunately, I have not found a way of running Lens Relaxation through script, so it must be done manually. If anyone does know how to use script to control the Lens Relaxation system, please let me know. Using this script it is possible to change the camera length over a very wide range of camera length values of practical interest, eg 100-800mm and keep the (000) on (or very near) to the black dot in the screen.

System Requirements

Written in Spyder in Anaconda3. Requires a PyJEM-equipped JEOL 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 appears 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 always open it. Python lives in the C://Anaconda3 folder. When you launch the script by double clicking on it, a Console window will also appear. The script will report diagnostic information in that Console. However, you do need to refer to this window during use. You can minimise the Console, but you must not close it. If you encounter any problems, the Console will tell you which operations were the last to be successfully completed before the script stopped.

You MUST configure this script to match your microscope hardware. This was set up on a JEOL F200. Even if you have this microscope, you will still need to calibrate the script, by recording the PLA settings which produce a centred SADP for each camera length of interest. Detailed instructions on configuring the script are provided at the start of the script.

Known Issues

Everytime you change a magnetic lens setting, then hysteresis effects will come into play. If you have a centred diffraction pattern at say 300mm, then change the camera length to say 500mm, change nothing, then set the camera length back to 300mm, the SADP will no longer be centred - due to hysteresis. For this reason, the degaussing function called Lens Relaxation must be run each time you change a camera length - if you wish the pattern position to be reproducible. The Lens Relaxation control panel has many different degaussing schedules designed for different microscope configuration changes. Prior to calibration or use of this script it is a good idea to run a major degauss of all lenses - such as provided by the STEM->TEM schedule. That way, any hystersis in the upper part of the column, which does not change during camera length changes, is removed and a consistent starting point is obtained. Thereafter, the Mag-Diff schedule, can be used after each camera length change. This is much quicker than the major degaussing schedules and it degausses only the lower half of the column, which is what changes with camera length.

Even with the use of this script, and lens relaxation, you may find that the spot position is not exactly in the centre of the screen - it may be just offset and barely touching the black spot. This is particularly so where large changes in camera length, from say 300mm to 1000mm or more are invoked. A second lens relaxation may help slightly, but this is simply a problem with magnetic lenses. Typically, I would imagine that this script might be used over a much narrower range of camera lengths, such as 200-500mm, and here the reproducibility is very good, and the beam stopper will cover the (000) reliably. You must always confirm that the (000) will be adquately covered by the beam stopper, before exposing a camera to it, otherwise camera damage could occur.

This script is provided in good faith. The author provides no warranty as to its fitness for purpose. Users of this script do so entirely at their own risk. The author accepts no responsibility for any losses or damages which may arise from its use. Users are advised to consult with their microscope manager before using PyJEM scripts.

Supported
Yes
Included Files
Main script file.
Source Code

zip archive containing the script.