File: grib_ls.sh

package info (click to toggle)
eccodes 2.45.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 154,404 kB
  • sloc: cpp: 162,953; ansic: 26,308; sh: 21,742; f90: 6,854; perl: 6,361; python: 5,172; java: 2,226; javascript: 1,427; yacc: 854; fortran: 543; lex: 359; makefile: 283; xml: 183; awk: 66
file content (41 lines) | stat: -rwxr-xr-x 1,866 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/bin/sh
set -e

echo "-# Without options a default list of keys is printed. \\n"
echo "The default list is different depending on the type of grib message. \\n"
echo "\\verbatim "
echo "> grib_ls ../data/reduced*.grib1 ../data/regular*.grib1 ../data/reduced*.grib2 \\n"
#grib_ls -W 8 ../data/reduced*.grib1 ../data/regular*.grib1 ../data/reduced*.grib2
echo "\\endverbatim\\n "

echo "-# To print offset and count number in file use the keys offset and count\\n "
echo "Also the total count in a set of files is available as countTotal\\n"
echo "\\verbatim "
echo "> grib_ls -p offset,count,countTotal ../data/reduced*.grib1"
#grib_ls -p offset,count,countTotal ../data/reduced*.grib1
echo "\\endverbatim\\n "

echo "-# To list only a subset of messages use the -w (where option).\\n "
echo "Only the pressure levels are listed with the following line.\\n "
echo "\\verbatim "
echo "> grib_ls -w levelType=pl ../tigge_pf_ecmwf.grib2 "
#grib_ls -W 8 -w levelType=pl ../data/tigge_pf_ecmwf.grib2
echo "\\endverbatim\\n "

echo "-# All the grib messages not on pressure levels are listed as follows:\\n "
echo "\\verbatim "
echo "> grib_ls -w levelType!=pl ../tigge_pf_ecmwf.grib2 "
#grib_ls -W 8 -w levelType!=pl ../data/tigge_pf_ecmwf.grib2
echo "\\endverbatim\\n "

echo "-# To get the closest grid point to a latitude/longitude.\\n"
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!"