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


Batch Export Spectra as Tabbed Text
Exports either the front-most or all the currently displayed 1D profiles (intensity profiles, EELS spectra etc) as tabbed text, saving each file to disc. The data are in two columns: x and y. These can then be imported into Excel or other plotting/analysis packages. X axis values can be exported in either calibrated units (eg nm, eV etc) or as pixel values. Any 2D or 3D images open at the same time are ignored.
version:20140322, v3.2
D. R. G. Mitchell

At least one 1D profile must be displayed.

Update in v3.2: Previously only the base slice was exported. Now each spectrum is interrogated. If only one slice is present, the spectrum is exported with the filename. If more than one slice is present, eg fitted backgrounds, edges, overlaid spectra etc, then each slice is exported with the filename, appended to which is the slicename.

System Requirements
Should be compatible with all GMS 1 and 2.
Known Issues
The extension of the saved files is .s, which is a DM script file. This is just plain text, so anything will open it.
Included Files
Main script file.
Source Code

See attached script.