Skip Navigation Links www.nws.noaa.gov 
NOAA logo - Click to go to the NOAA home page National Weather Service   NWS logo - Click to go to the NWS home page
Climate Prediction Center
 
 

 
About Us
   Our Mission
   Who We Are

Contact Us
   CPC Information
   CPC Web Team

 
HOME > Monitoring_and_Data > Oceanic and Atmospheric Data > Reanalysis: Atmospheric Data > wgrib2-checksum
 

wgrib2: -checksum

Introduction

The -checksum option writes the checksum (32 bit CRC) for the entire grib message or any specified section. Two sections or messages with the same checksum are very probably the same. This option can be used to check the integrity of a grib message or to check for for identical sections.

Usage

-checksum N
-1 for the checksum of the entire message
1..8 for the checksum of section N

Example

$ wgrib2 test.grb2 -checksum 3
1:0:sec3_cksum=4006285726
2:4786:sec3_cksum=4006285726
3:9572:sec3_cksum=4006285726
4:13335:sec3_cksum=4006285726
5:17098:sec3_cksum=4006285726

The above example shows the checksum of section 3 which is
the grid defintion section.

$ wgrib2 test.grb2 -checksum 3 | cut -f3 -d: | sort -u | wc -l

1
The above example prints out the number of grid defintion sections in the file by (1) creating the checksum for the GDS, (2) extracting the GDS checksum, (3) finding the unique checksums and finally counting them.

Space can be saved by putting combining like grib messages. For example, if a 100 messages share the same bitmap and discipline, then the 100 messages could be combined into one message with a hundred submessages. By combining the message, only one copy of the bitmap is needed. This saves 99 copies of the bitmap.

$ wgrib2 test.grb2 -checksum 6 | sort -k3,3 -t: | wgrib2 test.grib -i -tosubmsg new.grb2
1:0:d=2008120200:TMP:800 mb:anl:
2:4786:d=2008120200:TMP:750 mb:anl:
3:9572:d=2008120200:RH:800 mb:anl:
4:13335:d=2008120200:RH:750 mb:anl:
5:17098:d=2008120200:TMP:2743 m above mean sea level:anl:

Submessage statistics:
- # submessages written  : 5
- Kbytes saved           : 0
- Kbytes written         : 20

See also:


NOAA/ National Weather Service
National Centers for Environmental Prediction
Climate Prediction Center
5830 University Research Court
College Park, Maryland 20740
Climate Prediction Center Web Team
Page last modified: May 15, 2005

See also: -undefine


NOAA/ National Weather Service
National Centers for Environmental Prediction
Climate Prediction Center
5830 University Research Court
College Park, Maryland 20740
Climate Prediction Center Web Team
Page last modified: May 15, 2005
Disclaimer Privacy Policy