ECC-200 Update tools dox files

This commit is contained in:
Shahram Najm 2016-06-16 18:52:29 +01:00
parent b9c5e2a985
commit 14752dc8f9
8 changed files with 127 additions and 289 deletions

View File

@ -11,25 +11,28 @@
\n \n -r \n 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.
\n \n -p key[:{s/d/l}],key[:{s/d/l}],... \n
\n \n -p key[:{s/d/i}],key[:{s/d/i}],... \n
Declaration of keys to print.
For each key a string (key:s) or a double (key:d) or a long (key:l)
For each key a string (key:s), a double (key:d) or an integer (key:i)
type can be requested. Default type is string.
\n \n -P key[:{s/d/l}],key[:{s/d/l}],... \n
\n \n -P key[:{s/d/i}],key[:{s/d/i}],... \n
As -p adding the declared keys to the default list.
\n \n -w key[:{s/d/l}]=value,key[:{s/d/l}]=value,... \n
\n \n -w key[:{s/d/i}]{=/!=}value,key[:{s/d/i}]=value,... \n
Where clause.
Only grib messages matching the key/value constraints are copied to the
output_grib_file.
For each key a string (key:s) or a double (key:d) or a long (key:l)
A valid constraint is of type key=value or key!=value.
For each key a string (key:s), a double (key:d) or an integer (key:i)
type can be defined. Default type is string.
\n \n -B order by directive \n
Order by. The output will be ordered according the order by directive.
Order by example: "step asc, centre desc" (step ascending and centre discending)
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)
\n \n -V \n Version.
\n \n -W width \n
Minimum width of each column in output. Default is 10.
\n \n -M \n Multi-grib support off. Turn off support for multiple fields in single grib message.
\n \n -M \n Multi-field support off. Turn off support for multiple fields in single grib message.
\n \n -T T | B | M | A \n Message type. T->GTS, B->BUFR, M->METAR (Experimental),A->Any (Experimental).
The input file is interpreted according to the message type.
\n \n -g \n Copy GTS header.
\n \n -G \n GRIBEX compatibility mode.
\n \n -7 \n Does not fail when the message has wrong length
@ -44,6 +47,10 @@
\verbatim
> grib_copy -w levtype!=pl ../data/tigge_pf_ecmwf.grib2 out.grib
\endverbatim\n
-# To copy only the first three fields from a file\n
\verbatim
> grib_copy -w count=1/2/3 ../data/tigge_pf_ecmwf.grib2 out.grib
\endverbatim\n
-# A grib_file with multi field messages can be converted in single field messages
with a simple grib_copy.\n
\verbatim
@ -52,6 +59,6 @@ with a simple grib_copy.\n
-# Use the square brackets to insert the value of a key
in the name of the output file.\n
\verbatim
> grib_copy in.grib out_[shortName].grib
> grib_copy in.grib 'out_[shortName].grib'
\endverbatim\n
*/

View File

@ -9,21 +9,29 @@
\section OPTIONS
-O \n Octet mode. WMO documentation style dump.
\n \n -D \n Debug mode.
\n \n -d \n Print all data values. Available only in C mode
\n \n -C \n C code mode. A C code program generating the grib message is dumped.
\n \n -d \n Print all data values.
\n \n -j \n JSON mode (JavaScript Object Notation).
\n \n -t \n Print type information.
\n \n -H \n Print octet content in hexadecimal format.
\n \n -a \n Dump aliases.
\n \n -w key[:{s/d/l}]{=/!=}value,key[:{s/d/l}]{=/!=}value,... \n
\n \n -w key[:{s/d/i}]{=/!=}value,key[:{s/d/i}]{=/!=}value,... \n
Where clause.
Grib messages are processed only if they match all the key/value constraints.
Messages are processed only if they match all the key/value constraints.
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)
For each key a string (key:s), a double (key:d) or an integer (key:i)
type can be specified. Default type is string.
\n \n -M \n Multi-grib support off. Turn off support for multiple fields in single grib message.
\n \n -s key[:{s/d/i}]=value,key[:{s/d/i}]=value,... \n
Key/values to set.
For each key a string (key:s), a double (key:d) or an integer (key:i)
type can be defined. By default the native type is set.
\n \n -M \n Multi-field support off. Turn off support for multiple fields in single grib message.
\n \n -T T | B | M | A \n Message type. T->GTS, B->BUFR, M->METAR (Experimental),A->Any (Experimental).
The input file is interpreted according to the message type.
\n \n -7 \n Does not fail when the message has wrong length
\n \n -V \n Version.
\n \n -G \n GRIBEX compatibility mode.
\n \n -X offset \n
Input file offset in bytes. Processing of the input file will start from "offset".
\n \n -x \n Fast parsing option, only headers are loaded.
\n \n
\section grib_dump_examples grib_dump examples
-# To dump in a WMO documentation style with hexadecimal octet values (-H).\n
@ -38,209 +46,4 @@
\verbatim
> grib_dump -D ../data/regular_latlon_surface.grib1
\endverbatim\n
-# To obtain a C code example from a grib file.\n
\code
>grib_dump -C ../data/regular_latlon_surface.grib1
#include <grib_api.h>
/* This code was generated automatically */
int main(int argc,const char** argv)
{
grib_handle *h = NULL;
size_t size = 0;
double* vdouble = NULL;
long* vlong = NULL;
FILE* f = NULL;
const char* p = NULL;
const void* buffer = NULL;
if(argc != 2) {
fprintf(stderr,"usage: %s out\n",argv[0]);
exit(1);
}
h = grib_handle_new_from_samples(NULL,"GRIB1");
if(!h) {
fprintf(stderr,"Cannot create grib handle\n");
exit(1);
}
GRIB_CHECK(grib_set_long(h,"parametersVersion",1),0);
GRIB_CHECK(grib_set_long(h,"truncateLaplacian",0),0);
GRIB_CHECK(grib_set_long(h,"truncateDegrees",0),0);
GRIB_CHECK(grib_set_long(h,"dummy",1),0);
GRIB_CHECK(grib_set_long(h,"changingPrecision",0),0);
GRIB_CHECK(grib_set_long(h,"unitsFactor",1),0);
GRIB_CHECK(grib_set_long(h,"unitsBias",0),0);
GRIB_CHECK(grib_set_long(h,"timeRangeIndicatorFromStepRange",-1),0);
GRIB_CHECK(grib_set_long(h,"eps",0),0);
GRIB_CHECK(grib_set_long(h,"editionNumber",1),0);
GRIB_CHECK(grib_set_long(h,"productionStatusOfProcessedData",0),0);
GRIB_CHECK(grib_set_long(h,"table2Version",128),0);
/* 98 = European Center for Medium-Range Weather Forecasts (grib1/0.table) */
GRIB_CHECK(grib_set_long(h,"centre",98),0);
GRIB_CHECK(grib_set_long(h,"generatingProcessIdentifier",130),0);
GRIB_CHECK(grib_set_long(h,"gridDefinition",255),0);
/* 128 = 10000000
(1=1) Section 2 included
(2=0) Section 3 omited
See grib1/1.table */
GRIB_CHECK(grib_set_long(h,"section1Flags",128),0);
/* 167 = 2 metre temperature (K) (grib1/2.98.128.table) */
GRIB_CHECK(grib_set_long(h,"indicatorOfParameter",167),0);
/* 1 = Surface (of the Earth, which includes sea surface) (grib1/3.table) */
GRIB_CHECK(grib_set_long(h,"indicatorOfTypeOfLevel",1),0);
GRIB_CHECK(grib_set_long(h,"level",0),0);
GRIB_CHECK(grib_set_long(h,"yearOfCentury",8),0);
GRIB_CHECK(grib_set_long(h,"month",2),0);
GRIB_CHECK(grib_set_long(h,"day",6),0);
GRIB_CHECK(grib_set_long(h,"hour",12),0);
GRIB_CHECK(grib_set_long(h,"minute",0),0);
GRIB_CHECK(grib_set_long(h,"second",0),0);
/* 1 = Hour (grib1/4.table) */
GRIB_CHECK(grib_set_long(h,"unitOfTimeRange",1),0);
GRIB_CHECK(grib_set_long(h,"P1",0),0);
GRIB_CHECK(grib_set_long(h,"P2",0),0);
/* 0 = Forecast product valid at reference time + P1 (P1>0) (grib1/5.table) */
GRIB_CHECK(grib_set_long(h,"timeRangeIndicator",0),0);
GRIB_CHECK(grib_set_long(h,"numberIncludedInAverage",0),0);
GRIB_CHECK(grib_set_long(h,"numberMissingFromAveragesOrAccumulations",0),0);
GRIB_CHECK(grib_set_long(h,"centuryOfReferenceTimeOfData",21),0);
/* 0 = Unknown code table entry (grib1/0.ecmf.table) */
GRIB_CHECK(grib_set_long(h,"subCentre",0),0);
GRIB_CHECK(grib_set_long(h,"decimalScaleFactor",0),0);
GRIB_CHECK(grib_set_long(h,"setLocalDefinition",0),0);
GRIB_CHECK(grib_set_long(h,"dataDate",20080206),0);
GRIB_CHECK(grib_set_long(h,"dataTime",1200),0);
/* 1 = Hour (stepUnits.table) */
GRIB_CHECK(grib_set_long(h,"stepUnits",1),0);
GRIB_CHECK(grib_set_long(h,"deleteLocalDefinition",0),0);
/* 1 = MARS labelling or ensemble forecast data (grib1/localDefinitionNumber.98.table) */
GRIB_CHECK(grib_set_long(h,"localDefinitionNumber",1),0);
/* 1 = Operational archive (mars/class.table) */
GRIB_CHECK(grib_set_long(h,"marsClass",1),0);
/* 2 = Analysis (mars/type.table) */
GRIB_CHECK(grib_set_long(h,"marsType",2),0);
/* 1025 = Atmospheric model (mars/stream.table) */
GRIB_CHECK(grib_set_long(h,"marsStream",1025),0);
p = "0001";
size = strlen(p)+1;
GRIB_CHECK(grib_set_string(h,"experimentVersionNumber",p,&size),0);
GRIB_CHECK(grib_set_long(h,"perturbationNumber",0),0);
GRIB_CHECK(grib_set_long(h,"numberOfForecastsInEnsemble",0),0);
/* x */
GRIB_CHECK(grib_set_long(h,"gridDescriptionSectionPresent",1),0);
GRIB_CHECK(grib_set_long(h,"GDSPresent",1),0);
GRIB_CHECK(grib_set_long(h,"bitmapPresent",0),0);
GRIB_CHECK(grib_set_long(h,"radius",6367470),0);
GRIB_CHECK(grib_set_long(h,"shapeOfTheEarth",6),0);
GRIB_CHECK(grib_set_long(h,"numberOfVerticalCoordinateValues",0),0);
GRIB_CHECK(grib_set_long(h,"pvlLocation",255),0);
/* 0 = Latitude/Longitude Grid (grib1/6.table) */
GRIB_CHECK(grib_set_long(h,"dataRepresentationType",0),0);
GRIB_CHECK(grib_set_long(h,"Ni",16),0);
GRIB_CHECK(grib_set_long(h,"Nj",31),0);
GRIB_CHECK(grib_set_long(h,"latitudeOfFirstGridPoint",60000),0);
GRIB_CHECK(grib_set_long(h,"longitudeOfFirstGridPoint",0),0);
/* 128 = 10000000
(1=1) Direction increments given
(2=0) Earth assumed spherical with radius = 6367.47 km
(5=0) u and v components resolved relative to easterly and northerly directions
See grib1/7.table */
GRIB_CHECK(grib_set_long(h,"resolutionAndComponentFlags",128),0);
GRIB_CHECK(grib_set_long(h,"ijDirectionIncrementGiven",1),0);
GRIB_CHECK(grib_set_long(h,"earthIsOblate",0),0);
GRIB_CHECK(grib_set_long(h,"uvRelativeToGrid",0),0);
GRIB_CHECK(grib_set_long(h,"latitudeOfLastGridPoint",0),0);
GRIB_CHECK(grib_set_long(h,"longitudeOfLastGridPoint",30000),0);
GRIB_CHECK(grib_set_long(h,"iDirectionIncrement",2000),0);
GRIB_CHECK(grib_set_long(h,"jDirectionIncrement",2000),0);
/* 0 = 00000000
(1=0) Points scan in +i direction
(2=0) Points scan in -j direction
(3=0) Adjacent points in i direction are consecutive
See grib1/8.table */
GRIB_CHECK(grib_set_long(h,"scanningMode",0),0);
GRIB_CHECK(grib_set_long(h,"iScansNegatively",0),0);
GRIB_CHECK(grib_set_long(h,"jScansPositively",0),0);
GRIB_CHECK(grib_set_long(h,"jPointsAreConsecutive",0),0);
GRIB_CHECK(grib_set_long(h,"iScansPositively",1),0);
/* ITERATOR */
/* NEAREST */
GRIB_CHECK(grib_set_long(h,"PVPresent",0),0);
GRIB_CHECK(grib_set_long(h,"PLPresent",0),0);
GRIB_CHECK(grib_set_long(h,"missingValue",9999),0);
GRIB_CHECK(grib_set_long(h,"sphericalHarmonics",0),0);
GRIB_CHECK(grib_set_long(h,"complexPacking",0),0);
GRIB_CHECK(grib_set_long(h,"integerPointValues",0),0);
GRIB_CHECK(grib_set_long(h,"additionalFlagPresent",0),0);
GRIB_CHECK(grib_set_long(h,"hideThis",0),0);
GRIB_CHECK(grib_set_long(h,"bitsPerValue",16),0);
GRIB_CHECK(grib_set_long(h,"dirty_statistics",1),0);
GRIB_CHECK(grib_set_long(h,"dataLength",124),0);
GRIB_CHECK(grib_set_long(h,"changeDecimalPrecision",0),0);
GRIB_CHECK(grib_set_long(h,"decimalPrecision",0),0);
GRIB_CHECK(grib_set_long(h,"bitsPerValueAndRepack",16),0);
/* Save the message */
f = fopen(argv[1],"w");
if(!f) {
perror(argv[1]);
exit(1);
}
GRIB_CHECK(grib_get_message(h,&buffer,&size),0);
if(fwrite(buffer,1,size,f) != size) {
perror(argv[1]);
exit(1);
}
if(fclose(f)) {
perror(argv[1]);
exit(1);
}
grib_handle_delete(h);
return 0;
}
\endcode\n
*/

View File

@ -1,8 +1,8 @@
/*! \page grib_filter grib_filter
Latest training course presentation on grib_filter available <a href="http://www.ecmwf.int/services/computing/training/material/grib_api/grib_api_filter.pdf">here<img src="/assets/icons/pdf.gif" width="20" height="20" align="absmiddle" border="0"></a>.
\section DESCRIPTION
Apply the rules defined in rules_file to each grib message
in the grib files provided as arguments.
Apply the rules defined in rules_file to each GRIB message
in the GRIB files provided as arguments.
If you specify '-' (a single dash) for the rules_file, the rules will be read from standard input.
\section USAGE
grib_filter
@ -10,13 +10,15 @@ Latest training course presentation on grib_filter available <a href="http://www
\section OPTIONS
-f \n Force. Force the execution not to fail on error.
\n \n -o output_grib_file \n
Output grib is written to ouput_grib_file.
If an ouput grib file is required and -o is not used, the ouput grib is written to filtered.out
\n \n -M \n Multi-grib support off. Turn off support for multiple fields in single grib message.
\n \n -o output_file \n
Output is written to output_file.
If an output file is required and -o is not used, the output is written to filter.out
\n \n -M \n Multi-field support off. Turn off support for multiple fields in single grib message.
\n \n -V \n Version.
\n \n -g \n Copy GTS header.
\n \n -G \n GRIBEX compatibility mode.
\n \n -T T | B | M | A \n Message type. T->GTS, B->BUFR, M->METAR (Experimental),A->Any (Experimental).
The input file is interpreted according to the message type.
\n \n -7 \n Does not fail when the message has wrong length
\n \n -v \n Verbose.
\n \n
@ -26,7 +28,7 @@ Latest training course presentation on grib_filter available <a href="http://www
is sent to multiple files depending on key values used in the output file name. \n
If we write a rules_file containing the only statement:\n \n
\verbatim
write "../data/split/[centre]_[dataDate]_[dataType]_[levelType].grib[edition]";
write "../data/split/[centre]_[date]_[dataType]_[levelType].grib[editionNumber]";
\endverbatim\n
Applying this rules_file to the "../data/tigge_pf_ecmwf.grib2" grib file we obtain several files in the ../data/split directory containing
fields split according to their key values\n
@ -41,14 +43,14 @@ ecmf_20070122_pf_pv.grib2
ecmf_20070122_pf_sfc.grib2
\endverbatim\n
-# The key values in the file name can also be obtained in a different format by indicating explicitly the type required after a colon.
- :l for long
- :i for integer
- :d for double
- :s for string
.
The following statement works in a slightly different way from the previous example,
including in the output file name the long values for centre and dataType.\n
including in the output file name the integer values for centre and dataType.\n
\verbatim
write "../data/split/[centre:l]_[dataDate]_[dataType:l]_[levelType].grib[edition]";
write "../data/split/[centre:i]_[date]_[dataType:i]_[levelType].grib[editionNumber]";
\endverbatim\n
Running the same command again we obtain a different list of files.\n
\verbatim
@ -62,20 +64,19 @@ Running the same command again we obtain a different list of files.\n
98_20070122_4_sfc.grib2
\endverbatim\n
-# Other statements are allowed in the grib_filter syntax:
- comments beginning with #
- print "string to print also with key values like in the file name"
- transient keyname1 = keyname2;
- set keyname = keyvalue;
- defined(keyname) to check if a key is defined in a message
- if ( condition ) { block of rules } else { block of rules }\n
The condition can be made using ==,!= and joining single block conditions with || and && \n
The statement can be any valid statement also another nested condition\n
- set keyname = keyvalue;
- print "string to print also with key values like in the file name"
- transient keyname1 = keyname2;
- comments beginning with #
.
A complex example of grib_filter rules is the following to change temperature in a grib edition 1 file.
\verbatim
# Temperature
if ( level == 850 && indicatorOfParameter == 11 ) {
print "found indicatorOfParameter=[indicatorOfParameter] level=[level] date=[dataDate]";
print "found indicatorOfParameter=[indicatorOfParameter] level=[level] date=[date]";
transient oldtype = type ;
set identificationOfOriginatingGeneratingSubCentre=98;
set gribTablesVersionNo = 128;
@ -95,32 +96,40 @@ if ( level == 850 && indicatorOfParameter == 11 ) {
}
set numberOfForecastsInEnsemble=11;
write;
print "indicatorOfParameter=[indicatorOfParameter] level=[level] date=[dataDate]";
print "indicatorOfParameter=[indicatorOfParameter] level=[level] date=[date]";
print;
}
\endverbatim\n
-# Here is an example of an IF statement comparing a key with a string.
Note you have to use the "is" keyword for strings and not "==", and to negate you add the "!" before the whole condition:\n \n
\verbatim
# Select Geopotential Height messages which are not on a Reduced Gaussian Grid
if (shortName is "gh" && !(gridType is "reduced_gg" )) {
set step = 72;
}
\endverbatim\n
-# The switch statement is an enhanced version of the if statement. Its syntax is the following:
\verbatim
switch (key1,key2,...,keyn) {
case val11,val12,...,val1n:
switch (key1) {
case val1:
# block of rules;
case val21,val22,...,val2n:
case val2:
# block of rules;
default:
# [ block of rules ]
# block of rules
}
\endverbatim\n
Each value of each key given as argument to the switch statement is matched against the values specified in the case statements.\n
If there is a match, then the block or rules corresponding to the matching case statement is executed.\n
Otherwise, the default case is executed. The default case is mandatory, even if empty.\n
Otherwise, the default case is executed. The default case is mandatory if the case statements do not cover all the possibilities.\n
The "~" operator can be used to match "anything".\n\n
Following is an example showing the use of the switch statement:\n
\verbatim
processing paramId=[paramId] [shortName] [stepType]
switch (shortName,indicatorOfParameter) {
case tp:
switch (shortName) {
case tp :
set stepType=accum;
case ~,2 :
case 10u :
set typeOfLevel=surface;
default:
}

View File

@ -10,9 +10,9 @@
\section OPTIONS
-f \n Force. Force the execution not to fail on error.
\n \n -p key[:{s/d/l}],key[:{s/d/l}],... \n
\n \n -p key[:{s/d/i}],key[:{s/d/i}],... \n
Declaration of keys to print.
For each key a string (key:s) or a double (key:d) or a long (key:l)
For each key a string (key:s), a double (key:d) or an integer (key:i)
type can be requested. Default type is string.
\n \n -F format \n
C style format for floating point values.
@ -22,28 +22,32 @@
4 (4 values in the nearest points are printed) Default
1 (the value at the nearest point is printed)
file (file is used as mask. The closer point with mask value>=0.5 is printed)
\n \n -P key[:{s/d/l}],key[:{s/d/l}],... \n
\n \n -P key[:{s/d/i}],key[:{s/d/i}],... \n
As -p adding the declared keys to the default list.
\n \n -w key[:{s/d/l}]{=/!=}value,key[:{s/d/l}]{=/!=}value,... \n
\n \n -w key[:{s/d/i}]{=/!=}value,key[:{s/d/i}]{=/!=}value,... \n
Where clause.
Grib messages are processed only if they match all the key/value constraints.
Messages are processed only if they match all the key/value constraints.
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)
For each key a string (key:s), a double (key:d) or an integer (key:i)
type can be specified. Default type is string.
\n \n -n namespace \n
All the keys belonging to namespace are printed.
\n \n -s key[:{s/d/l}]=value,key[:{s/d/l}]=value,... \n
\n \n -s key[:{s/d/i}]=value,key[:{s/d/i}]=value,... \n
Key/values to set.
For each key a string (key:s) or a double (key:d) or a long (key:l)
For each key a string (key:s), a double (key:d) or an integer (key:i)
type can be defined. By default the native type is set.
\n \n -V \n Version.
\n \n -W width \n
Minimum width of each column in output. Default is 10.
\n \n -m \n Mars keys are printed.
\n \n -M \n Multi-grib support off. Turn off support for multiple fields in single grib message.
\n \n -M \n Multi-field support off. Turn off support for multiple fields in single grib message.
\n \n -g \n Copy GTS header.
\n \n -G \n GRIBEX compatibility mode.
\n \n -T T | B | M | A \n Message type. T->GTS, B->BUFR, M->METAR (Experimental),A->Any (Experimental).
The input file is interpreted according to the message type.
\n \n -7 \n Does not fail when the message has wrong length
\n \n -X offset \n
Input file offset in bytes. Processing of the input file will start from "offset".
\n \n -i index \n
Data value corresponding to the given index is printed.
\n \n

View File

@ -7,26 +7,28 @@
[options] grib_file grib_file ...
\section OPTIONS
-M \n Multi-grib support off. Turn off support for multiple fields in single grib message.
-M \n Multi-field support off. Turn off support for multiple fields in single grib message.
\n \n -m missingValue \n
The missing value is given through this option.
Any string is allowed and it is printed in place of the missing
values. Default is to skip the missing values.
\n \n -p key[:{s/d/l}],key[:{s/d/l}],... \n
\n \n -p key[:{s/d/i}],key[:{s/d/i}],... \n
Declaration of keys to print.
For each key a string (key:s) or a double (key:d) or a long (key:l)
For each key a string (key:s), a double (key:d) or an integer (key:i)
type can be requested. Default type is string.
\n \n -F format \n
C style format for values. Default is "%.10e"
\n \n -w key[:{s/d/l}]{=/!=}value,key[:{s/d/l}]{=/!=}value,... \n
\n \n -w key[:{s/d/i}]{=/!=}value,key[:{s/d/i}]{=/!=}value,... \n
Where clause.
Grib messages are processed only if they match all the key/value constraints.
Messages are processed only if they match all the key/value constraints.
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)
For each key a string (key:s), a double (key:d) or an integer (key:i)
type can be specified. Default type is string.
\n \n -f \n Force. Force the execution not to fail on error.
\n \n -G \n GRIBEX compatibility mode.
\n \n -7 \n Does not fail when the message has wrong length
\n \n -X offset \n
Input file offset in bytes. Processing of the input file will start from "offset".
\n \n -V \n Version.
\n \n
\section grib_get_data_examples grib_get_data examples

View File

@ -8,13 +8,19 @@
\section OPTIONS
-f \n Force. Force the execution not to fail on error.
\n \n -o output_grib_file \n
Output grib is written to ouput_grib_file.
If an ouput grib file is required and -o is not used, the ouput grib is written to filtered.out
\n \n -o output_index_file \n
Output is written to output_index_file.
If an output index file is required and -o is not used, the output index is written to gribidx
\n \n -k key1,key2,... \n
Specify a list of keys to index on. By default the input files are indexed on the MARS keys.
For each key a string (key:s) or a double (key:d) or an integer (key:i)
type can be requested.
\n \n -V \n Version.
\n \n -M \n Multi-grib support off. Turn off support for multiple fields in single grib message.
\n \n -T T | B | M | A \n Message type. T->GTS, B->BUFR, M->METAR (Experimental),A->Any (Experimental).
The input file is interpreted according to the message type.
\n \n -M \n Multi-field support off. Turn off support for multiple fields in single grib message.
\n \n -N \n Do not compress index.
By default the index is compressed to remove keys with only one value.
\n \n
\section grib_index_build_examples grib_index_build examples
-# By default grib_index_build will index on the MARS keys. \n

View File

@ -8,32 +8,33 @@
[options] grib_file grib_file ...
\section OPTIONS
-p key[:{s/d/l}],key[:{s/d/l}],... \n
-p key[:{s/d/i}],key[:{s/d/i}],... \n
Declaration of keys to print.
For each key a string (key:s) or a double (key:d) or a long (key:l)
For each key a string (key:s), a double (key:d) or an integer (key:i)
type can be requested. Default type is string.
\n \n -F format \n
C style format for floating point values.
\n \n -P key[:{s/d/l}],key[:{s/d/l}],... \n
\n \n -P key[:{s/d/i}],key[:{s/d/i}],... \n
As -p adding the declared keys to the default list.
\n \n -w key[:{s/d/l}]{=/!=}value,key[:{s/d/l}]{=/!=}value,... \n
\n \n -w key[:{s/d/i}]{=/!=}value,key[:{s/d/i}]{=/!=}value,... \n
Where clause.
Grib messages are processed only if they match all the key/value constraints.
Messages are processed only if they match all the key/value constraints.
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)
For each key a string (key:s), a double (key:d) or an integer (key:i)
type can be specified. Default type is string.
\n \n -j \n json output \n \n -B order by directive \n
Order by. The output will be ordered according the order by directive.
Order by example: "step asc, centre desc" (step ascending and centre discending)
\n \n -j \n json output
\n \n -B order by directive \n
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)
\n \n -l Latitude,Longitude[,MODE,file] \n
Value close to the point of a Latitude/Longitude.
Allowed values for MODE are:
4 (4 values in the nearest points are printed) Default
1 (the value at the nearest point is printed)
file (file is used as mask. The closer point with mask value>=0.5 is printed)
\n \n -s key[:{s/d/l}]=value,key[:{s/d/l}]=value,... \n
\n \n -s key[:{s/d/i}]=value,key[:{s/d/i}]=value,... \n
Key/values to set.
For each key a string (key:s) or a double (key:d) or a long (key:l)
For each key a string (key:s), a double (key:d) or an integer (key:i)
type can be defined. By default the native type is set.
\n \n -i index \n
Data value corresponding to the given index is printed.
@ -43,10 +44,13 @@
\n \n -V \n Version.
\n \n -W width \n
Minimum width of each column in output. Default is 10.
\n \n -M \n Multi-grib support off. Turn off support for multiple fields in single grib message.
\n \n -M \n Multi-field support off. Turn off support for multiple fields in single grib message.
\n \n -g \n Copy GTS header.
\n \n -G \n GRIBEX compatibility mode.
\n \n -T T | B | M | A \n Message type. T->GTS, B->BUFR, M->METAR (Experimental),A->Any (Experimental).
The input file is interpreted according to the message type.
\n \n -7 \n Does not fail when the message has wrong length
\n \n -X offset \n
Input file offset in bytes. Processing of the input file will start from "offset".
\n \n -x \n Fast parsing option, only headers are loaded.
\n \n
\section grib_ls_examples grib_ls examples
@ -75,9 +79,9 @@ Only the pressure levels are listed with the following line.\n
../data/reduced_gaussian_surface.grib2
paramId shortName value
167 2t 282.002
1 of 1 grib messages in ../data/reduced_gaussian_surface.grib2
1 of 1 messages in ../data/reduced_gaussian_surface.grib2
1 of 1 total grib messages in 1 files
1 of 1 total messages in 1 files
Input Point: latitude=51.46 longitude=-1.33
Grid Point chosen #3 index=749 latitude=51.63 longitude=0.00 distance=93.81 (Km)
Other grid Points

View File

@ -9,35 +9,38 @@
[options] grib_file grib_file ... output_grib_file
\section OPTIONS
-s key[:{s/d/l}]=value,key[:{s/d/l}]=value,... \n
-s key[:{s/d/i}]=value,key[:{s/d/i}]=value,... \n
Key/values to set.
For each key a string (key:s) or a double (key:d) or a long (key:l)
For each key a string (key:s), a double (key:d) or an integer (key:i)
type can be defined. By default the native type is set.
\n \n -r \n 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.
\n \n -d value \n
Set all the data values to "value".
\n \n -p key[:{s/d/l}],key[:{s/d/l}],... \n
\n \n -p key[:{s/d/i}],key[:{s/d/i}],... \n
Declaration of keys to print.
For each key a string (key:s) or a double (key:d) or a long (key:l)
For each key a string (key:s), a double (key:d) or an integer (key:i)
type can be requested. Default type is string.
\n \n -P key[:{s/d/l}],key[:{s/d/l}],... \n
\n \n -P key[:{s/d/i}],key[:{s/d/i}],... \n
As -p adding the declared keys to the default list.
\n \n -w key[:{s/d/l}]=value,key[:{s/d/l}]=value,... \n
\n \n -w key[:{s/d/i}]{=/!=}value,key[:{s/d/i}]=value,... \n
Where clause.
Set is only executed for grib messages matching all the key/value constraints.
If a grib message does not match the constraints it is copied unchanged
to the output_grib_file. This behaviour can be changed setting the option -S.
For each key a string (key:s) or a double (key:d) or a long (key:l)
A valid constraint is of type key=value or key!=value.
For each key a string (key:s), a double (key:d) or an integer (key:i)
type can be defined. Default type is string.
\n \n -7 \n Does not fail when the message has wrong length
\n \n -S \n Strict. Only grib messages matching all the constraints are copied to
the output file
\n \n -V \n Version.
\n \n -M \n Multi-grib support off. Turn off support for multiple fields in single grib message.
\n \n -M \n Multi-field support off. Turn off support for multiple fields in single grib message.
\n \n -g \n Copy GTS header.
\n \n -G \n GRIBEX compatibility mode.
\n \n -T T | B | M | A \n Message type. T->GTS, B->BUFR, M->METAR (Experimental),A->Any (Experimental).
The input file is interpreted according to the message type.
\n \n -f \n Force. Force the execution not to fail on error.
\n \n -v \n Verbose.
\n \n