Various bits of data, e.g. false color maps or raw file import presets, are stored in standalone files that are collectively called resource files. Gwyddion looks for resources in two different locations: system and user-specific.
System resources are installed along with the program and they are not
modifiable. Typically, they are located under a directory such as
(MS Windows) or other directory determined by
User resources are located in a user's directory, this usually means under
~/.gwyddion (Unix) or
Documents and Settings\gwyddion (MS Windows).
All resource files are simple text files that can be easily examined and modified by text editors or sent to other users (if they are copied or created manually Gwyddion needs to be restarted to notice them). In most cases only characters of the ASCII can appear in the files. If international text can appear there it must be in the UTF-8 encoding. Numerical values are represented in the standard POSIX format, i.e. with decimal point, independently on what decimal separator is usual in the user's language.
Resources are organized in subdirectories according to their kind, e.g.
color gradients reside in the subdirectory
The name of the file determines the resource name – gradient Gray is found
gradients/Gray. Modules can define their
own resource types; the types described here are the most important types
but the list may not be comprehensive.
Every resource file has the same structure. It starts with a line identifying the resource type:
Gwyddion resource GwyGradient
where GwyGradient is the type name in the type system (which is quite a low-level detail but so it is), followed by named parameters in the form
and resource data. Some resource types may contain only named parameters, other may contain only data.
Gradients, i.e. false color maps, reside in directory
gradients, they are identified by
GwyGradient and contain only data. They can be edited in
the application using the
The gradient data consists of rows corresponding to individual points in the gradient:
The position determines where the color defined by
components is placed in the interval
[0, 1] where 0 corresponds to the
gradient start, 1 corresponds to the end. The color is interpolated
linearly between the specified points.
The positions must form an increasing sequence from 0 to 1 (i.e. the minimum number of color points is two). The range of the color components is also [0, 1]. Note the alpha value, corresponding to opacity, is unused and must be given as 1 (fully opaque).
For instance, the standard gradient Red going from black (0 0 0) to red (1 0 0) to white (1 1 1) is defined as follows:
Gwyddion resource GwyGradient 0.0 0 0 0 1 0.5 1 0 0 1 1.0 1 1 1 1
OpenGL materials reside in directory
they are identified by GwyGLMaterial and contain
only data. They can be edited in the application using the
OpenGL material editor.
The material data consists of four RGBA lines, similar to gradients that correspond in to the four OpenGL material components in the following order:
See section OpenGL Material Editor for explanation of the components. They are followed by a line containing the shininess, again as a number from the interval [0, 1].
Note the emission component, while read and written by Gwyddion, is presently unused by the 3D view. It is recommended to set it to 0 0 0 1, i.e. black.
For instance, the standard material Red-Rubber with very dark red ambient color, grayish diffuse reflection, red specular reflection and low shininess is defined as follows:
Gwyddion resource GwyGLMaterial 0.05 0.0 0.0 1.0 0.5 0.4 0.4 1.0 0.7 0.04 0.04 1.0 0.0 0.0 0.0 1.0 .078125
Grain values reside in directory
they are identified by GwyGrainValue and contain
only named parameters. They can be used to define additional grain
quantities, derived from the built-in quantities, that appear under
User group in
grain analysis functions.
At the time of writing this, there is no editor in the application, new
quantities must be created manually.
The named parameters are summarized in the following table:
|required||identifier||Identifier to use in other expressions (but see below). It must be a valid identifier of ASCII letters, numbers and underscores, starting with a letter.|
|required||free-form||Formula for calculation of this quantity from other grain quantities. The general expression syntax is described in section Expressions.|
Fancy symbol that can include Greek letters or subscripts
and superscripts expressed with the
Pango markup language.
It is used for presentation in the application so, while it
is optional, it is recommended to at least define it
identically to |
|optional||integer||The power in which the lateral dimensions appear in the quantity. For instance, this is 1 for grain dimensions, 2 for areas and volumes. The default value is 0.|
|optional||integer||The power in which the “height” dimension appears in the quantity. For instance, this is 1 for values and volumes, 0 for dimensions and areas. The default value is 0.|
|optional||0 or 1||Given as 1 if the quantity makes sense only for lateral and “height” dimensions being the same physical quantities. For instance, this is required for the surface area. The default is 0.|
|optional||0 or 1||
Given as 1 if the quantity is an angle. The expression should
calculate angles in radians. However, if
At present, user-defined grain quantities cannot depend on other user-defined grain quantities to avoid circular dependencies. The built-in grain quantities are listed below:
|Position||Center x position|
|Position||Center y position|
|Value||Minimum value on boundary|
|Value||Maximum value on boundary|
|Area||Equivalent square side|
|Area||Equivalent disc radius|
|Area||Area above half-height|
|Area||Area of convex hull|
|Volume||Zero basis volume|
|Volume||Grain minimum basis volume|
|Volume||Laplacian background basis volume|
|Boundary||Projected boundary length|
|Boundary||Minimum bounding size|
|Boundary||Minimum bounding direction|
|Boundary||Maximum bounding size|
|Boundary||Maximum bounding direction|
|Boundary||Maximum inscribed disc radius|
|Boundary||Maximum inscribed disc center x position|
|Boundary||Maximum inscribed disc center y position|
|Boundary||Minimum circumcircle radius|
|Boundary||Minimum circumcircle center x position|
|Boundary||Minimum circumcircle center y position|
|Curvature||Curvature center x position|
|Curvature||Curvature center y position|
|Curvature||Curvature center z value|
|Curvature||Curvature angle 1|
|Curvature||Curvature angle 2|
|Moment||Major semiaxis of equivalent ellipse|
|Moment||Minor semiaxis of equivalent ellipse|
|Moment||Orientation of equivalent ellipse|
For instance, a new grain value Height, measuring the grain height as the difference between the maximum and minimum value, can be defined as follows:
Gwyddion resource GwyGrainValue symbol dz symbol_markup Δz power_xy 0 power_z 1 expression z_max - z_min
Raw file presents reside in directory
they are identified by GwyRawFilePreset and contain
only named parameters. They are normally created and edited by the
preset editor in the
raw file import module.
The named parameters in the resource files correspond closely to the parameters in the user interface explained in detail in section Raw Data File Import. Hence, they will be described only briefly here.
|integer||horizontal and vertical size|
physical dimensions, in units given by
|multiple of 3||
power of 10 to multiply |
base units of |
|number||unit step in values|
|multiple of 3||
power of 10 to multiply |
base units of |
|0 or 1||0 means missing value handling is disabled, 1 means it is enabled|
|number||the special subsitute value that denotes missing data|
|0 or 1||0 means binary, 1 means text|
|integer||built-in data format id, see below|
|integer||data offset in file, in bytes|
|integer||data value size, in bits|
|integer||number of bits to skip after each value|
|integer||number of additional bits to skip after each row|
|0 or 1||0 means unsigned, 1 means signed|
|0 or 1||1 means reverse bits in values|
|0 or 1||1 means reverse bits in bytes|
|integer||byte swap pattern|
|integer||lines to skip before starting to read the data|
|integer||fields to skip at the start of each line|
|string||field delimiter, empty string means arbitrary whitespace|
|0 or 1||1 if decimal separator is comma, 0 for dot|
Note the choice of a built-in binary format, i.e. nonzero
builtin, implies the binary format to some extent.
This means the options
are ignored as they are used only for detailed specification of user
formats. The available formats are listed in the following table:
|1||signed 8bit integer|
|2||unsigned 8bit integer|
|3||signed 16bit integer|
|4||unsigned 16bit integer|
|5||signed 32bit integer|
|6||unsigned 32bit integer|
|9||signed 64bit integer|
|10||unsigned 64bit integer|