Versions Compared

Key

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

...

List content of BUFR files printing values of some header keys. Only scalar keys can be printed. It does not fail when a key is not found.

USAGE

bufr_ls [options] bufr_file bufr_file ...

OPTIONS

...

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

...

C style format for floating-point values.

...

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

...

Where clause. 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 an integer (key:li) type can be specified. 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) In the value you can also use the forward-slash character '/' to specify an OR condition (i.e. a logical disjunction) Note: only one -w clause is allowed.

...

Key/values to set. For each key a string (key:s) or , a double (key:d) or a long an integer (key:li) type can be defined. By default the native type is set.

...

bufr_ls examples

  1. Without options a default list of keys is printed. The default list can be different depending on the type of bufr BUFR message.

    Code Block
     
    >  bufr_ls ../data/bufr/syno_*multi.bufr 
    
    The result is:
    Code Block
     
    ../data/bufr/syno_1multi.bufr
    masterTablesVersionNumbercentre  localTablesVersionNumber   rdbType                masterTablesVersionNumber  localTablesVersionNumber  rdbSubtype typicalDate                rdbtimeYeartypicalTime                rdbtimeMonthrdbType               typicalDate     rdbSubtype           typicalTime      rdbtimeDate          numberOfSubsets      rdbtimeTime      localLatitude          numberOfSubsets    localLongitude        localLatitude     
    13         localLongitude             
    ecmf   1                    13      1                   1       1                   20090124       2012            120000           10          1               20121030           1        000000                  20090124   1                121435          7.45           1            151.83              70.93      
    1 of 1 messages in ../data/bufr/syno_1.bufr
    
    ../data/bufr/syno_2.bufr
    13           -8.67              1       
    ecmf                   1    13                      1   1                       2012   20090124                   120000 10                    1     20121030                   000000  1                   1       20090124                   7.45121435                     1  151.83                    
    1 of 1 messages in ../data/bufr/syno_2.bufr
    
    ../data/bufr/syno_3.bufr
    1377                         15.5 1                     
    ecmf     1                  13        3                 1         2012                 20090124      10             120000            20121030         1          000000                1     1                     20090124     -15.93              121435       -5.67              1       
    1 of 1 messages in ../data/bufr/syno_3.bufr
    
    ../data/bufr/syno_4.bufr
    13              78.92           1           11.93               1      
    3 of 3 messages in ../data/bufr/syno_multi.bufr
    
    3 of 3 total messages           1                          2012                       10                         20121030                   000000                     1                          54.18                      7.9                       
    1 of 1 messages in ../data/bufr/syno_4.bufr
    
    ../data/bufr/syno_multi.bufr
    13                         1                          1                          1                          2009                       1                          20090124                   120000                     1                          70.93                      -8.67                     
    13                         1                          1                          1                          2009                       1                          20090124                   120000                     1                          77                         15.5                      
    13                         1                          1                          1                          2009                       1                          20090124                   120000                     1                          78.92                      11.93                     
    3 of 3 messages in ../data/bufr/syno_multi.bufr
    
    7 of 7 total messages in 5 files
    

  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
     
    >  > bufr_ls  -p offset,count,countTotal ../data/bufr/syno_*.bufr
    ../data/bufr/syno_1.bufr
    offset      count       countTotal  
    0           1           1          
    1 of 1 messages in ../data/bufr/syno_1.bufr
    
    ../data/bufr/syno_2.bufr
    0           2           2          
    1 of 1 messages in ../data/bufr/syno_2.bufr
    
    ../data/bufr/syno_3.bufr
    0           3           3          
    1 of 1 messages in ../data/bufr/syno_3.bufr
    
    ../data/bufr/syno_4.bufr
    0           4           4          
    1 of 1 messages in ../data/bufr/syno_4.bufr
    
    ../data/bufr/syno_multi.bufr
    0           5           5          
    220         6           6          
    440         7           7          
    3 of 3 messages in ../data/bufr/syno_multi.bufr
    
    7 of 7 total messages in 5 files
    

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

    Code Block
     
    >  bufr_ls -W 8 -w dataCategory=0 ../data/bufr/syno_*.bufr ../data/bufr/temp_*.bufr
    ../data/bufr/syno_1.bufr
    masterTablesVersionNumber  localTablesVersionNumber   rdbType                    rdbSubtype                 rdbtimeYear                rdbtimeMonth               typicalDate                typicalTime                numberOfSubsets            localLatitude              localLongitude             
    13                         1                          1                          1                          2012                       10                         20121030                   000000                     1                          7.45                       151.83                    
    1 of 1 messages in ../data/bufr/syno_1.bufr
    
    ../data/bufr/syno_2.bufr
    13                         1                          1                          1                          2012                       10                         20121030                   000000                     1                          7.45                       151.83                    
    1 of 1 messages in ../data/bufr/syno_2.bufr
    
    ../data/bufr/syno_3.bufr
    13                         1                          1                          3                          2012                       10                         20121030                   000000                     1                          -15.93                     -5.67                     
    1 of 1 messages in ../data/bufr/syno_3.bufr
    
    ../data/bufr/syno_4.bufr
    13                         1                          1                          1                          2012                       10                         20121030                   000000                     1                          54.18                      7.9                       
    1 of 1 messages in ../data/bufr/syno_4.bufr
    
    ../data/bufr/syno_multi.bufr
    13                         1                          1                          1                          2009                       1                          20090124                   120000                     1                          70.93                      -8.67                     
    13                         1                          1                          1                          2009                       1                          20090124                   120000                     1                          77                         15.5                      
    13                         1                          1                          1                          2009                       1                          20090124                   120000                     1                          78.92                      11.93                     
    3 of 3 messages in ../data/bufr/syno_multi.bufr
    
    ../data/bufr/temp_101.bufr
    0 of 1 messages in ../data/bufr/temp_101.bufr
    
    ../data/bufr/temp_102.bufr
    0 of 1 messages in ../data/bufr/temp_102.bufr
    
    ../data/bufr/temp_106.bufr
    0 of 1 messages in ../data/bufr/temp_106.bufr
    
    7 of 10 total messages in 8 files
    

  4. in 1 files
    


  5. It is allowed to use wildcards in filenames.

    Code Block
     
    >  bufr_ls ../data/bufr/syno_*.bufr 
    


  6. To list only a specific set of keys use the -p option.

    Code Block
     
    >  bufr_ls -p totalLength,bufrHeaderCentre,bufrHeaderSubCentre ../data/bufr/syno_multi.bufr 
    


  7. To list only a subset of messages use the -w (where option). Only the 12 UTC messages are listed with the following line.

    Code Block
     
    >  bufr_ls -w typicalTime="120000" ../data/bufr/syno_*.bufr
    


  8. All the non-12 UTC messages are listed as follows:

    Code Block
     
    >   bufr_ls -w typicalTime!="120000" ../data/bufr/syno_*.bufr
    


  9. To list only the second message from a BUFR file:

    Code Block
     
    >  bufr_ls -w count=2 ../data/bufr/syno_multi.bufr
    All the non-SYNOP messages are listed as follows:
    Code Block
     
    >   bufr_ls -W 8 -w dataCategory!=0 ../data/bufr/syno_*.bufr ../data/bufr/temp_*.bufr
    ../data/bufr/syno_1.bufr
    masterTablesVersionNumber  localTablesVersionNumber   rdbType                    rdbSubtype                 rdbtimeYear                rdbtimeMonth               typicalDate                typicalTime                numberOfSubsets            localLatitude              localLongitude             
    0 of 1 messages in ../data/bufr/syno_1.bufr
    
    ../data/bufr/syno_2.bufr
    0 of 1 messages in ../data/bufr/syno_2.bufr
    
    ../data/bufr/syno_3.bufr
    0 of 1 messages in ../data/bufr/syno_3.bufr
    
    ../data/bufr/syno_4.bufr
    0 of 1 messages in ../data/bufr/syno_4.bufr
    
    ../data/bufr/syno_multi.bufr
    0 of 3 messages in ../data/bufr/syno_multi.bufr
    
    ../data/bufr/temp_101.bufr
    13                         1                          5                          101                        2012                       10                         20121030                   000000                     1                          60.77                      -161.83                   
    1 of 1 messages in ../data/bufr/temp_101.bufr
    
    ../data/bufr/temp_102.bufr
    13                         1                          5                          102                        2012                       10                         20121030                   230000                     1                          51.2                       -28.1                     
    1 of 1 messages in ../data/bufr/temp_102.bufr
    
    ../data/bufr/temp_106.bufr
    13                         1                          5                          106                        2012                       10                         20121030                   180000                     1                          43.2                       3.4                       
    1 of 1 messages in ../data/bufr/temp_106.bufr
    
    3 of 10 total messages in 8 files