Resources

AXF (historical) format

AXF format was established by BODC as an exchange and archive format. It has since been superseded but is described here for completeness. If you still have data in AXF format and require assistance please contact the BODC Enquiries Officer.

The format is based on a set of simple, generalised building blocks that may be assembled in many different ways. This can be confusing and lead to many different ways of encoding similar or even identical data. Therefore, this document also defines a subset of AXF (the BODC series subset) that was designed for instrumentally measured wave data, but is applicable to a wide range of oceanographic measurements. AXF users are advised to adopt this wherever possible.

This document assumes you are familiar with programming terms.

Format specification

AXF is a comma-separated, self-descriptive, easily adaptable format. Each line of the file starts with a field defining the record type. Integer, real and character data can be accommodated. This enables the writing of simple one-off Fortran programs as well as allowing simple procedures for spreadsheet and database input. Please see the following for further information

  1. Record definitions
  2. Parameter types
  3. Units
  4. Absent and default values
  5. Maintaining easy Fortran legibility
  6. Buffer size
  7. Record ordering
  8. Nomenclature
  9. Multiplicity
  10. BODC series subset
  11. Flagging
  12. Example 1
  13. Example 2

1. Record definitions

Each line can contain no more than one record and no record can span more than one line. Blank lines are permitted. Comments are introduced through a double slash. Blank-commented lines (i.e. lines with no formal data content) are not allowed unless they begin with a double comma (this facilitates the construction of Fortran programs).

Each record begins with a record type identifier. Record types 0-9 that are not defined below are reserved. User-defined record types are in the range 10-99.

0,0,'AXF','0.0'                       //Format & Version
0,1,'yyyymmdd','hh24miss'  //Date/time of creation
0,2,maxreclength                //Maximum length of line in bytes - defines buffer size
0,3,datacyclecount              //No. of 'cycles'
0,4,'file_identifier'               //Internal reference for file. No embedded blanks
0,5,'text'                             //Records 0,6-9 are reserved

1,udrr,param,type,absent data value,defaultvalue   // udrr =User Defined Record Reference
2,udrr,lower,upper                                                    // Defines multiplicity (see below)
,,                                                                                // If lower omitted is assumed 0,
,,                                                                                // if upper omitted it is unlimited

Example 1 (a timeseries originating from a thermistor chain) and Example 2 (a BODC subset series to store Wave Spectra) are provided below.

2. Parameter types

In the above param (parameter name) type, file_identifier are type character; other identifiers are integer.

Type takes the form 'D' (double-precision float), 'F' (single-precision float), ''I' (integer), 'A' (alphanumeric - arbitrary width) or 'Anum' (alphanumeric with specified maximum width) where num defines the maximum field width.

Floating point numbers can be expressed in scientific notation where appropriate (E.g. 0.1234, -12.45e-12 are legitimate). For compatibility with a wide range of Fortran implementations, including Fortran 90, embedded blanks and the omission of the 'e' or 'E' (123e-4 is sometimes rendered as 123-4) should be avoided.

Alphanumerics appear in single quotes. Embedded single quotes are doubled.

3. Units

Units are not explicitly defined in the parameter description. They may be included in supplementary text, through comments or implicitly defined through parameter codes for which units have been specified.

4. Absent and default values

The absent data value may be the same as the default value. The absent data value is the value assumed by the parameter to signify that no data are available.

The default value is assumed when a field is null, that is a field bounded either by the start of the record and a comma, or by two commas, and which consists solely of zero or more blanks. Default values are handy for dealing with sparse or repetitious data.

In the absence of definition of the absent data value alphanumerics assume the value blank, and numerics the value -1. If the default value is undefined it is set equal to the absent data value.

5. Maintaining easy Fortran legibility

As noted above a null field is defined as white space (0 or more blanks) between the beginning of the record and a comma, or white space between two commas. It is not defined to be white space between a comma and the end of a record. This is because in Fortran 77, although a READ will begin at the start of a record, record boundaries are subsequently ignored in this form of input. To ascertain whether a field is null or not Fortran will pull in the next record if confronted with white space and read to the next comma. Thus one has to terminate each line ending in a null field with an additional comma.

6. Buffer size

The default buffer size is 80. Other type 0 records can be omitted with the exception of 0,0. Including cycle count facilitates programming and provides a check on file truncation or extension.

7. Record ordering

Most of the following rules are intended to simplify programming. They are in fact consistent with the natural order derived from sorting on the first two fields of each record within the header section of the file. Ordering within user-defined records within the body of the file is a matter for subset specification.

Record 0,0 should appear first in the file. Record types 0-9 should precede user-defined records. The buffer length specification should precede the point where the buffer length is required. The order of prescription identifies the order of the fields in a user-defined record. However all fields belonging to a given record must be specified contiguously in the file. Type 2 records must come after the corresponding type 1 definition records.

8. Nomenclature

A repeating group is a set of several readings of a parameter set registered for a given cycle of measurement. E.g. the parameter set would consist of (just) temperature for thermistor chains, parameters which are dependent on frequency (e.g. peak direction) for spectral wave data, and current velocity for an Ocean Surface Current Radar. The respective ancillary information would be heights above sea floor or depths below sea surface, the frequency set and cell positions.

9. Multiplicity

Type 1 records define parameter sets. Names within the parameter set are not required to be unique. Each user-defined record contains one or more cycles where a cycle is defined to be a set of values associated with the parameter set. The number of cycles in a particular record type may well vary throughout the file.

Type 2 records define what is termed multiplicity. Where a lower limit on multiplicity has been specified that number of cycles must be present in the file before switching to an alternative record type (parameter set) or encountering the end of the file. If the multiplicity is fixed (N=lower=upper) the number of cycles in the file for the associated parameter set must be a multiple of N. If a type 2 record is omitted the multiplicity is 1.

10. BODC series subset

Record 11 defines the ancillary parameter set. Record 21 holds the non-repeating elements of the cycle. Record 31 holds the repeating group. Data types with more than one repeating group are specifically excluded. If there is no repeating group only type 21 records will be present in the body of the data. Record 11 occurs once and precedes the cycle data. Record 21 precedes 31 in each cycle.

In records 21 and 31 parameters, with the exception of day number, are flagged. This means that there are one-byte alphanumeric channels named 'Flag' which succeed each parameter in the parameter-set definition. See Flagging below.

Parameters are specified using codes from the BODC Parameter Dictionary, which implicitly defines the units in which the data are stored.

11. Flagging

The flag channel is used to qualify the data. BODC uses 'N' to signify a null value and blank to signify a good one. Other flag values will be defined in the data documentation.

12. Example 1

An example of a timeseries originating from a thermistor chain. Conforms to BODC's series subset.

0,0,'AXF','0.0'
0,3,814 //Number of cycles is 814
0,4,'THCHA4 '
0,5,' The thermistor chain was deployed from RV Boethius'

1,11,'ADEP','F',,, //Depth of thermistors
2,11,15,15 //Number of thermistors


1,21,AADY,'I',-1,, //Day number of cycle (since 1760.1.1)
1,21,'AASC','I',-1,, //Time in seconds of day of
1,21,'Flag','A1',,, // cycle
1,31,'TEMP','F',-9,, //Temperature. Absent value
1,31,'Flag','A1',,, //Temperature flag
2,31,15,15 //There must be 15 readings per cycle

11,15,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45 //Depth set

21,,87654,36000 //This cycle is logged at 10am, 28/12/1999
31,4, 3.4,,4.5,,4.5,,4.5,,
31,4,4.5,,5.6,'M',4.5,,4.6,, //Note flag. The ',,' signify blank flags
31,4,4.8,,4.9,,5.0,,5.0,,
31,3,4.7,,4.8,,4.9
21,,87654,36060 //Next cycle
31,10,3.4,,4.5,,4.5,,4.6,,4.5,,5.6,'M',4.5,,4.6,,4.7,,4.8,, //Unlikely to mix the form of the output
,, //in this way in practice
31,5,5.1,,5.1,,4.6,,7.7,'M',,'N', //Absent data value at end (Fill=Absent)
etc.

13. Example 2

We use the BODC series subset to store Wave Spectra. The frequencies are stored in records with type 11 and the power values (and spread, peak direction, etc. for 2-D spectra) are accommodated in records of type 31.

0,0,'AXF','0.0'
0,1,'19960710','162147' // Date/time file produced
0,2,80 // Buffer size
0,3,362 // Number of cycles
0,4,'PR9410.N1' // Internal file name
1,21,'AADY','I',-1,,
1,21,'AAFD','F',-1.000000,,
1,21,'Flag','A1',,' '
1,21,'GTDHFP01','F',-1.000000,,
1,21,'Flag','A1',,' '
1,21,'GTZAFP01','F',-1.000000,,
1,21,'Flag','A1',,' '
1,21,'GTPKFP01','F',-1.000000,,
1,21,'Flag','A1',,' '
1,31,'GDSNFP01','F',-9.000000,,
1,21,'Flag','A1',,' '
2,31,64,64
1,11,'FREQ','F',,,
2,11,64,64
11,8,0.025000,0.035000,0.044000,0.054000,0.064000,0.074000,0.083000,0.093000
11,8,0.103000,0.113000,0.123000,0.132000,0.142000,0.152000,0.162000,0.171000
11,8,0.181000,0.191000,0.201000,0.210000,0.220000,0.230000,0.240000,0.250000
11,8,0.259000,0.269000,0.279000,0.289000,0.298000,0.308000,0.318000,0.328000
11,8,0.337000,0.347000,0.357000,0.367000,0.376000,0.386000,0.396000,0.406000
11,8,0.416000,0.425000,0.435000,0.445000,0.455000,0.464000,0.474000,0.484000
11,8,0.494000,0.503000,0.513000,0.523000,0.533000,0.542000,0.552000,0.562000
11,8,0.572000,0.582000,0.591000,0.601000,0.611000,0.621000,0.630000,0.640000
21,,85748,0.375000,,0.430000,'L',7.400000,'L',12.050000,'L',
31,5,0.009680,'L',0.003900,'L',0.002770,'L',0.002190,'L',0.004820,'L',
31,5,0.095600,'L',0.284000,'L',0.284000,'L',0.195000,'L',0.033500,'L',
31,5,0.013600,'L',0.013600,'L',0.014800,'L',0.015200,'L',0.006750,'L',
31,5,0.009010,'L',0.011600,'L',0.006510,'L',0.009570,'L',0.046300,'L',
31,5,0.051500,'L',0.006060,'L',0.005120,'L',0.001910,'L',0.001930,'L',
31,5,0.009940,'L',0.004830,'L',0.004720,'L',0.006490,'L',0.005630,'L',
31,5,0.005150,'L',0.007250,'L',0.003380,'L',0.002280,'L',0.002540,'L',
31,5,0.001200,'L',0.001130,'L',0.000910,'L',0.000551,'L',0.000297,'L',
31,5,0.000165,'L',0.000157,'L',0.000158,'L',0.000140,'L',0.000112,'L',
31,5,0.000136,'L',0.000146,'L',0.000072,'L',0.000100,'L',0.000046,'L',
31,5,0.000060,'L',0.000079,'L',0.000046,'L',0.000061,'L',0.000096,'L',
31,5,0.000038,'L',0.000035,'L',0.000042,'L',0.000034,'L',0.000061,'L',
31,4,0.000050,'L',0.000061,'L',0.000103,'L',0.000084,'L',
21,,85748,0.437500,,0.320000,,7.360000,,12.050000,,
31,5,0.000562,,0.001290,,0.000852,,0.002860,,0.010600,,
31,5,0.193000,,0.201000,,0.080200,,0.013800,,0.010500,,
31,5,0.015400,,0.007020,,0.011600,,0.007840,,0.008530,,
31,5,0.002700,,0.002430,,0.004350,,0.003270,,0.006140,,
31,5,0.003150,,0.003190,,0.003910,,0.006590,,0.002150,,
31,5,0.003870,,0.002320,,0.002530,,0.003050,,0.001300,,
31,5,0.001810,,0.001720,,0.001360,,0.000884,,0.001640,,
31,5 .............................