diff --git a/tools/grib_compare.c b/tools/grib_compare.c index 8e56aac05..203ea517b 100644 --- a/tools/grib_compare.c +++ b/tools/grib_compare.c @@ -146,14 +146,13 @@ int theStart=-1; int theEnd=-1; char* grib_tool_description= - "Compare grib messages contained in two files." + "Compare GRIB messages contained in two files." "\n\tIf some differences are found it fails returning an error code." "\n\tFloating point values are compared exactly by default, different tolerance can be defined see -P -A -R." "\n\tDefault behaviour: absolute error=0, bit-by-bit compare, same order in files."; char* grib_tool_name="grib_compare"; -char* grib_tool_usage="[options] " - "grib_file grib_file"; +char* grib_tool_usage="[options] grib_file1 grib_file2"; int grib_options_count=sizeof(grib_options)/sizeof(grib_option); diff --git a/tools/grib_copy.sh b/tools/grib_copy.sh index fcb546863..b3aac6c4a 100755 --- a/tools/grib_copy.sh +++ b/tools/grib_copy.sh @@ -23,7 +23,19 @@ echo "> grib_copy multi.grib simple.grib" echo "\endverbatim\\n" echo "-# Use the square brackets to insert the value of a key" -echo "in the name of the output file.\\n" +echo "in the name of the output file (This is a good way to split a large GRIB file)\\n" echo "\verbatim" echo "> grib_copy in.grib 'out_[shortName].grib'" echo "\endverbatim\\n" + +echo "-# To copy fields whose typeOfLevel is either 'surface' or 'meanSea'" +echo "\verbatim" +echo "> grib_copy -w typeOfLevel=surface/meanSea orig.grib out.grib" +echo "\endverbatim\\n" +echo "Note: we need to quote the name of the output so the shell does not interpret the square brackets" + +echo "-# To copy selected fields and apply sorting (sorted by level in ascending order)" +echo "\verbatim" +echo "> grib_copy -w typeOfLevel=heightAboveGround -B'level:i asc' tigge_af_ecmwf.grib2 out.grib" +echo "\endverbatim\\n" +echo "Note: we need to specify the ':i' to get a numerical sort. By default values are sorted as strings so a level of 100 would come before 20!" diff --git a/tools/grib_count.desc b/tools/grib_count.desc index dc1fc5aeb..1db1ed022 100644 --- a/tools/grib_count.desc +++ b/tools/grib_count.desc @@ -4,7 +4,7 @@ DESCRIPTION Print the total number of GRIB messages in the given files. USAGE - grib_count [options] file file ... + grib_count [options] grib_file grib_file ... OPTIONS -v Verbose mode. The number of messages is given for each file. diff --git a/tools/grib_filter.sh b/tools/grib_filter.sh index 2a7c60d14..b33a701bd 100755 --- a/tools/grib_filter.sh +++ b/tools/grib_filter.sh @@ -71,6 +71,10 @@ echo " - set keyname = keyvalue;" echo " - print \"string to print also with key values like in the file name\"" echo " - transient keyname1 = keyname2;" echo " - comments beginning with #" +echo " - defined(keyname) to check if a key is defined in a message" +echo " - missing(keyname) to check if the value of the key is set to MISSING" +echo " - To set a key value to MISSING, use 'set key=MISSING;' (note the case)" +echo " - You can also make an assertion with 'assert(condition)'. If condition is false, it will abort the filter." echo " ." echo "A complex example of grib_filter rules is the following to change temperature in a grib edition 1 file." echo "\\verbatim" diff --git a/tools/grib_get_data.c b/tools/grib_get_data.c index 57f698418..de6d12717 100644 --- a/tools/grib_get_data.c +++ b/tools/grib_get_data.c @@ -36,7 +36,8 @@ grib_option grib_options[]={ {"V",0,0,0,1,0} }; -char* grib_tool_description="Print a latitude, longitude, data values list "; +char* grib_tool_description="Print a latitude, longitude, data values list.\n" + "\tNote: Rotated grids are first unrotated"; char* grib_tool_name="grib_get_data"; char* grib_tool_usage="[options] grib_file grib_file ..."; diff --git a/tools/grib_get_data.sh b/tools/grib_get_data.sh index 526645cbe..223930257 100755 --- a/tools/grib_get_data.sh +++ b/tools/grib_get_data.sh @@ -7,7 +7,7 @@ echo "\\verbatim" echo ">grib_get_data ../data/reduced_gaussian_model_level.grib2" echo "\\endverbatim" -echo "-# If you want to define your missing value=1111 and to print the string missing in place of it" +echo "-# If you want to define your missing value=1111 and to print the string 'missing' in place of it" echo "\\verbatim" echo ">grib_get_data -m 1111:missing ../data/reduced_gaussian_model_level.grib2" echo "\\endverbatim" @@ -16,6 +16,3 @@ echo "-# If you want to print the value of other keys with the data value list" echo "\\verbatim" echo ">grib_get_data -p centre,level,step ../data/reduced_gaussian_model_level.grib2" echo "\\endverbatim" - - - diff --git a/tools/grib_index_build.c b/tools/grib_index_build.c index 32ee16692..c5ef52cdf 100644 --- a/tools/grib_index_build.c +++ b/tools/grib_index_build.c @@ -15,7 +15,7 @@ #include "grib_tools.h" -char* grib_tool_description="Build an index file for a set of input grib files."; +char* grib_tool_description="Build an index file for a set of input GRIB files."; char* grib_tool_name="grib_index_build"; char* grib_tool_usage="[options] grib_file grib_file ... "; grib_index* idx=NULL; diff --git a/tools/grib_ls.sh b/tools/grib_ls.sh index 4cefe6a02..0d40ba1ee 100755 --- a/tools/grib_ls.sh +++ b/tools/grib_ls.sh @@ -33,3 +33,9 @@ echo "\\code " echo ">grib_ls -l 51.46,-1.33,1 -p paramId,name ../data/reduced_gaussian_surface.grib2" ./grib_ls -l 51.46,-1.33,1 -p paramId,shortName ../data/reduced_gaussian_surface.grib2 echo "\\endcode\\n" + +echo "-# To get a list ordered by the 'level' key (ascending order).\\n " +echo "\\verbatim " +echo "> grib_ls -B 'level:i asc' tigge_af_ecmwf.grib2" +echo "\\endverbatim\\n " +echo "Note: we need to specify the ':i' to get a numerical sort. By default values are sorted as strings so a level of 100 would come before 20!" diff --git a/tools/grib_options.c b/tools/grib_options.c index 84c27803a..5190f9109 100644 --- a/tools/grib_options.c +++ b/tools/grib_options.c @@ -77,7 +77,9 @@ grib_options_help grib_options_help_list[] ={ " key/value constraints." "\n\t\tA valid constraint is of type key=value or key!=value." "\n\t\tFor each key a string (key:s), a double (key:d) or" - " an integer (key:i)\n\t\ttype can be specified. Default type is string.\n"}, + " an integer (key:i)\n\t\ttype can be specified. Default type is string." + "\n\t\tIn the value you can also use the forward-slash character '/' to specify an OR condition (i.e. a logical disjunction)\n" + }, {"v",0,"Verbose.\n"}, {"7",0,"Does not fail when the message has wrong length\n"}, {"A:","absolute error\n",