Versions Compared

Key

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

...

  1. The default behaviour for bufr_compare without any option is to perform a bit by bit comparison of the two messages. If the messages are found to be bitwise different then grib_compare switches to a "key based" mode to find out which coded keys are different. To see how grib_compare works we first set the bufrHeaderCentre=222 in the file syno_1.bufr

    Code Block
     
    > bufr_set -s bufrHeaderCentre=222 data/bufr/syno_1.bufr out.bufr
    
    Then we can compare the two fields with bufr_compare.
    Code Block
     
    > bufr_compare data/bufr/syno_1.bufr out.bufr
    == 1 == DIFFERENCE == long [bufrHeaderCentre]: [98] != [222]
    == 1 == DIFFERENCE == [rdbType] not found in 2nd field
    == 1 == DIFFERENCE == [rdbSubtype] not found in 2nd field
    == 1 == DIFFERENCE == [typicalDate] not found in 2nd field
    == 1 == DIFFERENCE == [typicalTime] not found in 2nd field
    == 1 == DIFFERENCE == [rdbtimeDay] not found in 2nd field
    == 1 == DIFFERENCE == [rdbtimeHour] not found in 2nd field
    == 1 == DIFFERENCE == [rdbtimeMinute] not found in 2nd field
    == 1 == DIFFERENCE == [rdbtimeSecond] not found in 2nd field
    == 1 == DIFFERENCE == [rectimeDay] not found in 2nd field
    == 1 == DIFFERENCE == [rectimeHour] not found in 2nd field
    == 1 == DIFFERENCE == [rectimeMinute] not found in 2nd field
    == 1 == DIFFERENCE == [rectimeSecond] not found in 2nd field
    == 1 == DIFFERENCE == [correction1] not found in 2nd field
    == 1 == DIFFERENCE == [correction1Part] not found in 2nd field
    == 1 == DIFFERENCE == [correction2] not found in 2nd field
    == 1 == DIFFERENCE == [correction2Part] not found in 2nd field
    == 1 == DIFFERENCE == [correction3] not found in 2nd field
    == 1 == DIFFERENCE == [correction3Part] not found in 2nd field
    == 1 == DIFFERENCE == [correction4] not found in 2nd field
    == 1 == DIFFERENCE == [correction4Part] not found in 2nd field
    == 1 == DIFFERENCE == [qualityControl] not found in 2nd field
    == 1 == DIFFERENCE == [localLatitude] not found in 2nd field
    == 1 == DIFFERENCE == [localLongitude] not found in 2nd field
    
    In the output we can see that the only "coded" key with different values in the two messages is indicatorOfParameter which is the relevant key for the parameter information. The comparison can be forced to be successful listing the keys with different values in the -b option.
    Code Block
     
    > grib_compare -b indicatorOfParameter regular_latlon_surface.grib1 2d.grib1