Station recode file

Station recode files define recoding of stations when data files are read into SNAP. They have two main uses

Station recoding can be applied globally, that is for all files loaded into a snap job, using the recode command, or for an individual data file with the data_file command. The recode command can define a station recode file or explicitly defines stations to recode.

The station recode file (or files) is a CSV formatted file with columns "codefrom", "codeto" and optionally "datefrom" and "dateto". Each record in the file defines a code in the data file and the code that it is to be changed to.

The recode may also specify a date range. The recoding will only apply after the datefrom and before the dateto dates. Either or both can be blank - for example if datefrom is blank then any date before dateto will apply.

Dates are entered using the format "YYYY-MM-DD" or "YYYY-MM-DD:hh:mm:ss".

Stations can be recoded to "*", in which case they will be ignored. If "codefrom" and "codeto" are both "*" then all stations will be ignored except those explicitly recoded in the file.

Similarly stations can be recoded to "*XYZ" where XYZ is the name that the station is to be recoded to. This will recode the station to XYZ, but reject any observations involving it. This can be used to reject all observations using a station with a date range. For example

codefrom,codeto,datefrom,dateto
ABCD,*ABCD,2005-06-01,

will reject all observations involving ABCD after 1 June 2005.

Multiple recodings can be specified for each station. The last matching recoding record with a date range matching the observation will be used in preference. If there is none, then the last recoding record without a date range is used.

Global recoding (from the command file) is applied after recoding specific to a data file. The recoded data file codes are may be recoded again by the command file recodes.

When the station code has been recoded the SNAP will check if it is defined in the coordinate file. If it is not defined and if the original code is defined then the SNAP will create a new station based on the original one.

See also:

Station coordinate file

Station codes

The recode command