Versions Compared

Key

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

...

Fast parsing option, only headers are loaded.

grib_ls examples

  1. Without options a default list of keys is printed. The default list is different depending on the type of grib message.

    Code Block
     
    >  grib_ls ../data/reduced*.grib1 ../data/regular*.grib1 ../data/reduced*.grib2 
    



  2. To print offset and count number in file use the keys offset and count Also the total count in a set of files is available as countTotal

    Code Block
     
    >  grib_ls -p offset,count,countTotal ../data/reduced*.grib1
    



  3. To list only a subset of messages use the -w (where option). Only the pressure levels are listed with the following line.

    Code Block
     
    >  grib_ls -w levelType=pl ../tigge_pf_ecmwf.grib2 
    



  4. All the grib messages not on pressure levels are listed as follows:

    Code Block
     
    >  grib_ls -w levelType!=pl ../tigge_pf_ecmwf.grib2 
    



  5. To get the closest grid point to a latitude/longitude.

    Code Block
     
    > grib_ls -l 51.46,-1.33,1 -p paramId,name ../data/reduced_gaussian_surface.grib2
    ../data/reduced_gaussian_surface.grib2
    paramId     shortName    value 
    167         2t          282.002     
    1 of 1 messages in ../data/reduced_gaussian_surface.grib2
    
    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
    1 - index=845 latitude=48.84 longitude=0.00 distance=306.86 (Km)
    2 - index=944 latitude=48.84 longitude=356.40 distance=333.66 (Km)
    3 - index=749 latitude=51.63 longitude=0.00 distance=93.81 (Km)
    4 - index=844 latitude=51.63 longitude=356.25 distance=168.37 (Km)
    



  6. To get a list ordered by the 'level' key (ascending order).

    Code Block
     
    >  grib_ls -B 'level:i asc' tigge_af_ecmwf.grib2
    

    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!