Skip to content
Thomas Nipen edited this page Apr 11, 2020 · 25 revisions

This section is only relevant for the gridpp command-line tool.

Parameter files contain the coefficients that a calibrator uses. They are specified using -p, which is specified after a calibrator definition. For example, a simple linear regression scheme (e.g. a + bx) contains two parameters. A single instance of a vector with one value of a and b is called parameter set. A parameter file contains parameter sets for one or more positions and one or more leadtimes. It is up to each calibrator to define the behaviour.

If no leadtime information is defined in the files, then the parameter sets apply to all leadtimes. If no position information is defined in the files, then the parameter sets apply to the whole grid and therefore do not vary in space.

gridpp ... -v [variable] -c regression [regression options] -p filename [parameter options]

Local vs global parameters

Parameter files can contain parameters that are valid over the whole domain or that vary locally. A local parameter file has parameters defined for one or more geographical points. Often, these points will correspond to the gridpoints on the output grid, but this need not be the case. In general, the input grid, output grid, and parameter points can be different as shown in this illustration (input grid is shown in yellow, output grid in black, and parameter locations by green circles):

Each calibrator can specify which parameter location is used for each gridpoint. Most schemes uses the nearest parameter location when processing a particular gridpoint, but this is not the case with optimal interpolation (-c oi), where multiple parameter locations are used for each gridpoint.

Global parameters do not have any geographical information and therefore apply to all gridpoints.

Temporal parameters

Parameters can also vary with leadtime. If no leadtime information is provided, then parameter sets are valid for all leadtimes.

Text format

The text format is space delimited with one parameter set on each line.

The file contains a header row that describes each column. They can be in any order and the following keywords are recognized:

  • lat: Latitude in degrees (optional; north is positive)
  • lon: Longitude in degrees (optional; west is positive)
  • elev: Elevation in m (optional)
  • time: Leadtime in hours (optional)
  • param<N>: Parameter value (numbered 1 and up)

Parameter files without lat and lon are treated as global. A linear regression parameter file might look like this:

lat  lon  param1 param2
59.9 10.7 0.1    0.9
60.4 5.5  0.2    1.1

The amount of white space between each column is irrelevant. All lines must have the same number of columns.

NetCDF format

For large parameter sets, the NetCDF format is faster. The file can contain spatial dimensions x and y, leadtime dimension time and a parameter dimension coeff. The latter can be controlled using dimName=.

The file can contain lat and lon variables to define the positions of the parameter sets, and a coefficient variable that stores the parameters. The latter can be overridden using varName=.

The following file contains 10 parameter sets, each with 2 parameters.

netcdf parameters {

dimensions:
      x = 10 ;
      coeff = 2;
variables:
      float lon(x) ;
      float lat(x) ;
      float coefficient(x, coeff) ;
}
Clone this wiki locally