Geopsy: Custom ASCII formats
Contents
Introduction
Geopsy allows you to load ASCII signal files with a custom header or without header, adding automatically information when loading the signal. In order to manage the header formats, go to Geopsy Preferences, tab Load, box File Format and push the button Custom ASCII format.
A list of user formats is maintained and stored in the general user settings. These formats are included in the list of accepted formats for automatic recognition and for importation. They cannot be used for export.
Format specifications are saved to and restored from files with extension 'ascfmt' (Import and Export buttons). It is recommended to export your format specifications before a software upgrade or when resetting user settings. If you constructed a specification for a format that can be of interest for other users, you can submit it in the Examples section (or by e-mail).
Creating a new format
If there are already some formats in the list, select the closest to the new one you are going to create. All the attributes of this model format are loaded.
To ease adjustment of attributes of a format specification it is easier to work on a file example. Enter a file name in Example or click on the browse button on the right side of the Example field.
Set a descriptive Name and eventually add an extension (do not include the dot). The extension is not mandatory. It is used only during automatic format recognition. If there is a match on the file name extension, the format is identified without even opening the file and checking its content. Custom ASCII file format extension are checked after all other formats, hence there is no risk to supersede existing rules.
There are basically four things to do in this order:
- define the header size (Header definition)
- map header information to signal properties (Rules)
- define component naming convention (Components)
- set the time format (Time format)
Header definition
There four ways to define the header size:
- No header: signals values are encountered yet on the first line of the file. A custom file format without header cannot be automatically recognized from its content, only the extension can be used. The Rules can set constant values to signal properties even without information from the header. Hence you can associate a particular file extension to signal properties (e.g. sampling frequency).
- Fixed header: header is limited by a fixed number of lines. Right after the last header line, the signal values in columns are expected.
- Header pattern: all lines of the header contain a text pattern (e.g. '#' as the first character). The pattern is a regular expression. When a line does not contain this pattern it is assumed that signal values start.
- End header pattern: the end of the header is marked by a special text pattern (e.g. '########'). The pattern is a regular expression. The pattern must include all characters until the first signal value.
Examples
^#{40,}$
Matches all lines containing at least 40 '#'. '^' marks the starting of a line and '$' the end of a line. For End header pattern, there can be several consecutive lines matching the pattern, the data are assumed to start after the last one.
^#
Matches all lines that start with '#'
Rules
Component table
Time format
Editing an existing format
It works the same way as for the creation of a new format. Select it in the list, click on Edit,edit the attributes and click on Ok from the editor dialog box. Changes are committed to the main internal list only after clicking on Ok from the list dialog box.
Examples
- Titan with corrected starting time (exported by rtitan2 with option -asc) TitanCorrectedT0.ascfmt
- Tromino ... [does anyone have a file example?]