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

 

SI Dismantler
Function
Dismantles a spectrum image into its component spectra.
Version
version:20200423, v2.0
Author
D. R. G. Mitchell
Acknowledgements
Thanks to Billy Murdoch for testing this script
Comments

This scipt will dismantle a spectrum image into its component spectra. These can be either displayed on the screen or saved to disk directly as .dm4 files or as tab-delimited text files. If a rectangular region of interest (ROI) is present on the SI, then only the spectra in that sub-area will be extracted. Note: on a 1D spectrum image (line profile), if the ROI does not run to the left and right hand edges of the SI, the extracted spectra will have a truncated energy range.

Updated in v2.0 to include the option to bin the SI on the fly. Binning will only work when the SI y (1D SI) or x and y (2D SI) dimensions are divisible by the binning value. No energy binning is carried out. A Clear All button allows convenient deletion of all spectra displayed with this script. Formatting options for outputting the spectral data as text are also included to make it possible to export Gatan SI data into CasaXPS.

System Requirements
Should be compatible with all recent versions of DigitalMicrograph.
Known Issues

There is a user-settable alert threshold which will warn you if you are about to display more than this number of spectra. SIs can contain many hundreds of spectra and displaying these may overwhelm DigitalMicrograph. The saving of spectra as .dm4 files is very quick. However, the export of tab-delimited text files takes about 0.7s per spectrum, so for large SIs set it running and grab a cup of coffee, or use the binning function.

Supported
Yes
Included Files
Main script file.
Source Code

see attached script.