p2cgrb | c2pgrb - GRIB polar to Cartesian converters

p2cgrb & c2pgrb convert GRIB records from polar (magnitude & direction) to east and north components and vice versa.

Comments are appreciated, future versions may appear.

Syntax

  % p2cgrb speed.grb dir.grb uv.grb [[-]u-par v-par]
  % c2pgrb u.grb v.grb polar.grb [[-]magnitude-par dir-par]

Here, the two first grib files are input files containing matching magnitude and direction records or east and north component records, respectively for p2cgrb and c2pgrb. The optional parameters at the end of the argument list indicate which parameters numbers the new fields should be given. This is optional, if left out, the standard parameter numbers for wind speed and wind direction or east and north components of the wind are used (parameters 31-34 in the standard table).

Facts & caveats

Examples


  1. p2cgrb speed.grb dir.grb uv.grb -49 50
    The new file uv.grb contains the east and north components of the surface current vector with parameter nos 49 and 50 [optional, default 33 and 34]. Direction is assumed to be in the "going-to" or oceanographic convention (note the negative sign on parameter 49).

  2. c2pgrb u.grb v.grb polar.grb -48 47
    The new file polar.grb contains the speed and direction of the surface current vector with parameter nos 48 and 47 [optional, default 32 and 31] . Again, direction is in the "going-to" or oceanographic convention (note the negative sign on parameter 48).

Installation

% gunzip p2c.tar.gz
% cd Gribw
% make -f gribwlib.make
% cd ../P2cgrb
% make -f p2cgrb.make p2cgrb

% make -f p2cgrb.make c2pgrb

The TAR-ball includes a Linux binary of bilingrb, which makes compilation unnecessary for those fortunate owners of Linux boxes. Four test files are also included (speed.grb, dir.grb, u.grb, and v.grb).

See also

v1.0, 2004m08d05, oyvind.breivik@met.no

--
Øyvind Breivik, Norwegian Meteorological Institute, www.met.no