The recode command

recode code to newcode
recode code to newcode uncertainty date_range
recode suffix suffix uncertainty date_range for station_list
recode file station_recode_file

Specifies a translation of a station code that is applied when data files are read. These translations are applied to all files. Individual data files can be recoded using the data_file command.

The code and newcode define the data file code and the codes that they are recoded to in SNAP. The newcode can be "*", which means that the station will be ignored. Also newcode can be preceded by '*' to reject all observations involving the mark.

Station recoding can be restricted to a range of dates - valid date range specifications are:

between date_from and date_to
before date_to
after date_from

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

Station recoding can also be applied to a list of files using the recode suffix option. All the stations specified in the station list will be recoded by appending the suffix to the code. This is only applied with a date range.

The recode command can also include an uncertainty. If this is defined then it adds a pseudo observation to the adjustment which defines that the recoded and original stations are co-located. The uncertainty specifies a horizontal and vertical positional error in millimetres. This option is primarily intended to represent the uncertainty of a deformation model for a specific tectonic event, and provides a crude stochastic model of it. The format is one of:

hv_error hv_error m
hv_error h_error v_error m
disconnected

The recode error is only valid with a date specification as either before or after a specific date. Where there are multiple recodings for the same suffix and date the largest one will be taken. The disconnected option can be used to override any error specifications - however a specification without an error has the same effect.

Where multiple recodings with errors apply to a mark then these will be compiled into date order and each step will be used to define the relationship between the first and last errors. For example if station ABCD is recoded to ABCD_0 with uncertainty 4mm on before 2011-09-22 and ABCD_1 with uncertainty 3mm before 2012-12-24 then the relationship between ABCD (the location after 2012-12-24) and ABCD_0 (the location before 2011-09-22) will have an uncertainty of 5mm, which is root mean square of the errors at each intermediate step.

The station_recode_file option can specify a station recode file containing a list of station recode specifications.

Some examples of recode commands:

recode ABCD to XYZ

Recoded all mark ABCD to XYZ

recode ABCD to XYZ after 2005-05-01

Recoded mark ABCD to XYZ for observations dated after 1 May 2005.

recode ABCD to *

Ignore all observations involving ABCD

recode ABCD to *ABCD

Reject all observations involving ABCD

recode suffix _A after 2005-05-01 for inside NZTM landslip.wkt

Recodes all marks inside the extents defined by the polygon defined using NZTM coordinates in the well known text file landslip.wkt for observations after 1 May 2005. So for example ABCD will be recoded to ABCD_A. Note that stations that already have a suffix _A will not be affected.

recode suffix _A hv_error 0.3 0.5 m before 2016-11-14 for inside NZG2000 eqzone.wkt

Recodes stations in the affected area before 2016-11-14 and adds co-location observervations with error 0.3m horizontally and 0.5m vertically. This assumes that a deformation model is used which is expected to account for the movement. The before and after locations are expected to be the same after accounting for the deformation model, but the model adds uncertainty to their relative position. To account for this uncertainty the before position is recoded with a suffix _A to allow a different value.

See also:

The data_file command

The station recode file

Station lists

Command file syntax

Alphabetical list of commands

Summary of commands by function