Managing Files

Gwyddion uses its internal data format (.gwy) to store data. The main advantage of this format is fact, that it stores complete state of processing of concrete data, including selections and other tool and processing function settings. It can also store more channels and graphs that have any relation in one single file. Therefore we recommned to use this format for saving processed files. If you open our example files, you can see that each one is plotted in different false color palette. This is direct consequence of the fact that Gwyddion stores full state of the data window including its palette.

Other data file formats can be handled with appropriate loading and saving modules or plugins. Beside several file formats used in microscopy, graphical file types (JPEG, PNG, PPM, TIFF, BMP) and raw binary and ASCII data can be imported too.

We expect that more file IO modules and plugins will be written, depending on demands and file format specifications available. We encourage you to write IO module or plugin for your instrument-specific data file format, or, at least, to send us your format specifications.

Table 3.1. Supported file formats

File FormatExtensionsSupported ByReadWrite
APE Research.datapefile moduleYesNo
ASCII data (raw) rawfile, asciiexport modulesYes Yes [a]
Assing AFM.afmassing-afm moduleYesYes
Image Metrology BCR, BCRF.bcr, .bcrfbcrfile moduleYesNo
Binary data (raw) rawfile moduleYesNo
Burleigh v2.1.imgburleigh moduleYesNo
Createc.datcreatec moduleYesNo
DME Rasterscope.imgdmefile moduleYesNo
ECS.imgecsfile moduleYesNo
FRT MicroProf.txtmicroprof moduleYesNo
Gwyddion native.gwygwyfile moduleYesYes
PSI HDF4.hdfhdf4file moduleYesNo
Hitachi AFM.afmhitachi-afm moduleYesNo
Intematix SDF.sdfintematix moduleYesNo
JEOL SPM.tifjeol moduleYesNo
JPK Instruments.jpkjpkscan moduleYesNo
Zygo binary MetroPro.datmetropro moduleYesNo
Molecular Imaging MI.mimifile moduleYesNo
Molecular Imaging STP.stpstpfile moduleYesNo
Nanonis.sxmnanonis moduleYesNo
Nanoscope  nanoscope, nanoscope-ii modules [b] YesNo
Nanosurf.ezd, .nidezdfile moduleYesNo
Nanotop.spmnanotop moduleYesNo
GXSM netCDF.ncnetcdf moduleYesNo
NT-MDT.mdtnt-mdt moduleYesNo
Omicron Scala.par + dataomicron moduleYesNo
Pacific Nanotechnology PNI.pnipnifile moduleYesNo
Pixmap images .png, .jpeg, .ppm, .tga, .bmp [c] pixmap moduleYes Yes [d]
PSIA.tiffpsia moduleYesNo
RHK Technology SPM32.sm2rhk-spm32 moduleYesNo
RHK Technology SM3.sm3rhk-sm3 moduleYesNo
Seiko.xqdseiko moduleYesNo
Scanning Probe Microscopy Markup Langugae.xmlspml moduleYesNo
Surfstand Surface Data File.sdfsdfile moduleYes Yes [e]
CSM Surf.sursurffile moduleYesNo
Surface Imaging Systems.sissis moduleYesNo
Veeco Instruments.zfr, .tfr, .zfp, …spmlab moduleYesNo
STMPRG stmprg moduleYesNo
Unisoku.hdr + .datunisoku moduleYesNo
WITec.witwitfile moduleYesNo
WSxM (Nanotec).tom, .stpwsxmfile moduleYesNo

[a] Only a simple data-matrix format si currently supported.

[b] Nanoscope II and Nanoscope III (and newer) are two distinct file formats, nanoscope loads the newer files while nanoscope-ii loads the old version II files.

[c] And others, namely for import. The exact list depends on formats supported by libraries on the particular platform.

[d] Alhough this is usually lossy. Export to pixmap graphics is intended for presentational purpose mainly.

[e] Only the text variant can be exported at present.


File Loading

By default, Gwyddion detects the file format automatically based on file contents (i.e. file names and extensions are irrelevant). This usually works well and you will hopefully never need to change it. See Raw Data File Import for details of import of data from unsupported formats and from pixmap images.

If the automatic detection fails it is possible to enforce an attempt to load the file as a particular format by expanding the File type selector and choosing a file type. However, if the file format is not detected automatically it is very unlikely the file can be loaded at all.

By enabling Show only loadable files of selected type the file list can be limited only to the selected type. The file type label then indicates the filtering by appending (filtered) to the end. In the case of Automatically detected file type this means the list to files is limited to those Gwyddion thinks it can load. This can be very convenient, on the other hand it can slow down listing of directories with many files.

Once a file type is selected it remains selected even in subsequent file open dialog invocations. If you seem to be suddenly unable to load a file, check the file type is set to the corresponding type, or to Automatically detected.

Figure 3.3.  File open dialog with expanded file type options and channel preview.

File open dialog with expanded file type options and channel preview.

File Merging

File merging is similar to normal file loading, except that the selected file (or files) is merged into the current open file. In other words, channels, graphs and spectra, together with all their settings and properties are added to those already present in the current file.

File Saving

Much of the previous paragraphs applies to file saving too. One of the differences is the reliability of automatic file type determination. While loading can and does examine the file contents, saving depends on file name and extension. Combined with the large number of different file types using the same extension such as .img, .afm or .dat it leads to ambiguities. Select the file type explicitly before saving if you are unsure.

Since the only file type able to fully represent Gwyddion data structures is its native data format, saving to a .gwy file is the only actual saving. Saving to other file formats essentially consists of exporting of a limited subset of the data, typically only the active channel (without masks and presentations). Therefore it does not change the file name of the current file to the just saved file name.

Document History

The history of recently opened files can be accessed with FileOpen Recent. The submenu contains the last 10 recently used files for quick recalling, extensive recent file history is accessed with the last item Document History.

Document history lists the files sorted by the last access time (the most recently accessed at the top), with previews and some additional information about a selected channel. The function of the bottom row of buttons is following:

Prune
Removes history entries of files that have been deleted or are no longer accessible for other reasons.
Close
Closes the document history window.
Open
Opens the selected file. This can be also achieved by activating the selected row, either by double-clicking or with the keyboard.

The history can be searched/filtered by file name using the filter controls above the buttons. The filter is activated by pressing Enter in the filter pattern entry. To display all history entries, clear the entry and activate it. The filter pattern is interpreted in two ways:

  • If the pattern contains wildcards, i.e. * or ?, it is interpreted as file glob. This means ? represents a signle arbitrary character, * represents an arbitrary sequence of zero or more characters, and the file name has to precisely match the pattern. Note directory separators (/ or \) are not treated specially, therefore in the pattern *.sis the initial * matches all leading directory components. The pattern syntax is described in GPatternSpec documentation.
  • If the pattern does not contain any wildcards, it is directly searched as a part of the file name.

Search case sensitivity, controlled by option Case sensitive, is useful mainly on systems distinguishing letter case in file names, such as Unix. On systems that do not distinguish the case themselves it is recommended to keep the setting on case insensitive.