Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

DESCRIPTION

Copies the content of grib files printing values of some keys.

USAGE

grib_copy [options] grib_file grib_file ... output_grib_file

OPTIONS

...

Force. Force the execution not to fail on error.

...

Repack data. Sometimes after setting some keys involving properties of the packing algorithm a repacking of data is needed. This repacking is performed setting this -r option.

...

Declaration of keys to print. For each key a string (key:s) or a double (key:d) or a long (key:l) type can be requested. Default type is string.

...

As -p adding the declared keys to the default list.

...

Where clause. Only grib messages matching the key/value constraints are copied to the output_grib_file. A valid constraint is of type key=value or key!=value. For each key a string (key:s) or a double (key:d) or a long (key:l) type can be defined. Default type is string.

...

Order by. The output will be ordered according to the order by directive. Order by example: "step asc, centre desc" (step ascending and centre descending)

...

Version.

...

Minimum width of each column in output. Default is 10.

...

Multi-field support off. Turn off support for multiple fields in single grib message.

...

Message type. T->GTS, B->BUFR, M->METAR (Experimental),A->Any (Experimental). The input file is interpreted according to the message type.

...

Copy GTS header.

...

GRIBEX compatibility mode.

...

Does not fail when the message has wrong length

...

Verbose.

grib_copy examples

  1. To copy only the pressure levels from a file

    Code Block
    >  grib_copy -w levtype=pl ../data/tigge_pf_ecmwf.grib2 out.grib
    


  2. To copy only the fields that are not on pressure levels from a file

    Code Block
    >  grib_copy -w levtype!=pl ../data/tigge_pf_ecmwf.grib2 out.grib
    


  3. A grib_file with multi field messages can be converted in single field messages with a simple grib_copy.

    Code Block
    >  grib_copy multi.grib simple.grib
    


  4. Use the square brackets to insert the value of a key in the name of the output file.

    Code Block
    >  grib_copy in.grib out_[shortName].grib