Scripting Resources for DigitalMicrograph™


Dave Mitchell's DigitalMicrograph™ Scripting Website

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


Warp EELS Momentum-Energy Map
Warps an EELS Momentum-Energy map to remove the distorting effects of GIF aberrations about a horizontal centreline.
version:20160525, v1.0
D. R. G. Mitchell
Michael Huang for suggesting and testing the script.

Momentum-Energy loss maps consist of a series of diffraction spots along the y axis. Radiating from each of them along the x axis is an energy loss spectrum. Ideally, all such spectral stripes should be parallel, but GIF aberrations may make such lines sloped. This script requires that this distortion be identified by three line annotations applied to the map. The central line of the three must be horizontal. A warp is then applied either side of the centre line to make all three lines parallel. This script may also be useful for removing similar geometric distortions caused by such things as tilting.

System Requirements
Tested on GMS 2.x but should be compatible with all versions of GMS.
Known Issues

The central line of the three fiducial lines should identify the spectral line which radiates from the direct beam (lines either side identify spectra radiating from diffracted beams). This central line must be horizontal. If not, the script will rotate the image to bring the line to horizontal. The three fiducial lines will get copied across to the rotated image. However, they will need to be repositioned, and the script rerun on the rotated image. A thresholdangle parameter at the start of the Main Script section, can be used to specify the threshold angle. If the horizontal line lies outside this angular range, the option to rotate to horizontal is given.

The assumption is that the GIF distortion is linear both in terms of energy loss and as a function of q (distance along the diffraction axis). If all the EELS spectral stripes are straight lines, then this is probably a fair assumption. However, this script cannot correct non-linear distortion (bowed spectral lines).

Included Files
Source code
Source Code

See attached script.