Difference between revisions of "Geopsy: Custom ASCII formats"

From GeopsyWiki
Jump to navigation Jump to search
Line 25: Line 25:
 
=== Header definition ===
 
=== Header definition ===
  
There four way to define the header size:
+
There four ways to define the header size:
* ''No header'': signals values are encountered yet one the first line of the file. This is option is not really useful because the standard ASCII format is already able to identify those type of files. A custom file format without header cannot be automatically recognized from its content, only the extension can be used. The [[#Rules|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).
+
* ''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|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.
 
* ''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. '#'). The pattern is a [[Regular Expression|regular expression]. When a line does not contain this pattern it is assumed that signal values begin.
+
* ''Header pattern'': all lines of the header contain a text pattern (e.g. '#' as the first character). The pattern is a [[Regular Expressions|regular expression]]. When a line does not contain this pattern it is assumed that signal values begin.
* ''End header pattern'': the end of the header is marked by a special text pattern (e.g. '########'). The pattern is a [[Regular Expression|regular expression]. The pattern must include all characters until the first signal value.
+
* ''End header pattern'': the end of the header is marked by a special text pattern (e.g. '########'). The pattern is a [[Regular Expressions|regular expression]]. The pattern must include all characters until the first signal value.
  
 
=== Rules ===
 
=== Rules ===

Revision as of 17:37, 23 March 2010

Introduction

Custom ASCII format dialog box

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 email).

Creating a new format

Custom ASCII format editor

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:

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 begin.
  • 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.

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?]