/usr/share/doc/grads/html/gradutilgrib2scan.html is in grads 2.0.a9-4.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 | <!--Copyright (C) 1988-2005 by the Institute of Global Environment and Society (IGES). See file COPYRIGHT for more information.-->
<html>
<head>
<title>GrADS Utilities: grib2scan</title>
<style type="text/css">
<!--
.style1 {color: #006600}
.style2 {color: #0033FF}
.style3 {color: #996600}
.style4 {color: #006666}
.style5 {color: #993366}
.style6 {color: #FF66FF}
.style8 {color: #990000}
.style11 {color: #00CC33}
.style12 {color: #9900FF}
.style13 {color: #FF6600}
-->
</style>
</head>
<body text="#000000" bgcolor="e0f0ff">
<h2><b>grib2scan</b></h2>
<p>
The <code>grib2scan</code> utility is used for finding out what is inside a GRIB2 data file. It scans each record in the file, and prints out relevant information about the data in the record.
The command sytax is:
<ul>
<code>grib2scan [-v] <i>fname</i></code></ul>
<p>
Where <code><i>fname</i></code>
is the input GRIB2 file name, and the <code>-v</code> option is used for verbose output.
<p>To assist in the interpretation of the grib2scan output, here are some links to GRIB2 documentation: <a href="http://www.wmo.int/pages/prog/www/WMOCodes/GRIB.html" target="_parent"><br>
WMO</a> (the official source)<a href="http://www.nco.ncep.noaa.gov/pmb/docs/grib2/grib2_doc.shtml" target="_parent"><br>
NCEP</a> (unofficial, but with a user-friendly web interface).
<p>A GRIB2 file is a collection of records, each with a complete set of metadata to describe the data contained in the record. A GRIB2 record has 9 sections, some of which may occur more than once. The output from grib2scan is printed out as it scans each section of the record. Below are examples of the grib2scan output from two different GRIB2 records. An explanation of the output follows.
<p><code>
Record 1 starts at 0 of length <span class="style3">17242</span><br>
<span class="style2">Discipline=0</span> (Meteorological)
<br>
<span class="style1"> Reference Time</span> = 2007-10-09 00:00:00
<span class="style4">Start of Forecast</span> <br>
Field 1 <br>
<span class="style5">GDT=0</span> (Lat/Lon) nx*ny=10512
<br>
XDEF 144 linear 0.000000 2.500000
<br>
YDEF 73 linear 90.000000 2.500000
<br>
<span class="style6">PDT=1</span> Forecast Time = 0 Hour
<br>
Parameter: <span class="style13">disc,cat,num</span> = 0,3,5 <br>
Level: <span class="style8">ltype,lval</span> = 100,20000 (sf,sval = 0 20000)
<br>
Ens: <span class="style11">type,pert</span> = 3,1 (total=10)
<br>
<span class="style12">DRT=40</span> (Grid Point Data - JPEG2000 Compression) (Lossless)
<br>
<br>
Record 2 starts at 17242 of length <span class="style3">110483</span> <br>
<span class="style2">Discipline=0</span> (Meteorological)
<br>
<span class="style1">Reference Time</span> = 2007-10-09 00:00:00 <span class="style4">Start of Forecast</span> <br>
Field 1
<br>
<span class="style5">GDT=0</span> (Lat/Lon) nx*ny=259920
<br>
XDEF 720 linear 0.000000 0.500000
<br>
YDEF 361 linear 90.000000 0.500000
<br>
<span class="style6">PDT=8</span> (6 Hour Average) EndTime = 2007-10-09 06:00
<br>
Parameter: <span class="style13">disc,cat,num,sp</span> = 0,1,7,0
<br>
Level: <span class="style8">ltype,lval</span> = 1,0 (sf,sval = 0 0)
<br>
<span class="style12">DRT=40</span> (Grid Point Data - JPEG2000 Compression) (Lossless)
</code>
<p>Section 0, the Indicator Section, contains info grib2scan uses to confirm it is looking at a GRIB2 file. This section also contains the <span class="style2">Discipline</span>, as well as the <span class="style3">size of the entire record</span>.
<p>Section 1, the Identification Section, contains characteristics that apply to all data in the record. Sections 0 and 1 are the only ones that may not be repeated in a GRIB2 record. From section 1 we get the <span class="style1">Reference Time</span> printed in a YYYY-MM-DD HH:MM:SS format, plus the <span class="style4">significance of the reference time</span>.
<p>Section 3, the Grid Definition Section, contains the definition of the grid surface and geometry of the data values in the grid. The Grid Definition Template (<span class="style5">GDT</span>) value indicates the grid type -- in Record 1, the data are on a Lat/Lon grid at 2.5-degree resolution; Record 2 has a 0.5-degree Lat/Lon grid. For some <span class="style5">GDT</span> values, grib2scan in verbose mode will print out helpful information for creating the XDEF and YDEF or PDEF entries for the descriptor file.
<p>Section 4, the Product Definition Section, contains a lot of essential information about the nature of the data -- what the variable is called, its units, its vertical level, its valid time, whether it is part of an ensemble set, and whether it is an instantaneous value or statistically processed in some way. The Product Definition Template (<span class="style6">PDT</span>) value tells grib2scan where to get the parameter category and number, which, along with the discipline, are required codes to uniquely identify the variable in the descriptor file. These three numbers, the <span class="style13">discipline, category, and number</span>, are printed out in comma-delimed format, so you can cut and paste them directly into your descriptor file. In Record 1, the parameter is "Discipline 0: Meteorological products, Parameter Category 3: Mass, Parameter Number 5: Geopotential Height".
If the parameter has been statistically processed (i.e. it is an average or an accumulation over a period of time), then a fourth number is required by GrADS to indicate the kind of statistical process used to generate the parameter: the <span class="style13">discipline, category, number, and statistical process</span> must go into the descriptor file. In Record 2, the parameter is "Discipline 0: Meterological products, Parameter Category 1: Moisture, Parameter Number 7: Precipitation rate, Statistical Process 0: Average (6 hour)".
Section 4 also give the parameter's <span class="style8">level type and value</span> --
these comma-delimited numbers can also be copied from the grib2scan output into your descriptor file. In the first example, the level type is pressure, and the level value is 20000 Pascals (or 200 mb). Note that if a parameter occurs on more than one pressure level, you should use ZDEF to list the pressure level values and omit the level value in the variable declaration. Pressure values are converted back to millibars internally if you use the OPTIONS keyword "pascals". In Record 2, the level type is the ground or water surface and the value is 0. Finally, if it is relevant, ensemble
metadata also appears in section 4. Ensemble metadata is only relevant in Record 1, and appears as an <span class="style11">ensemble type and perturbation number</span>. Parameters that are derived from all ensemble members only require one code, a number that indicates the type of derived forecast (e.g. ensemble mean). These ensemble codes belong in the exanded form of the EDEF declaration.
<p>Section 5, the Data Representation Section, contains information about how the data are represented. The Data Representation Template (<span class="style12">DRT</span>) number is not required in a GrADS descriptor file, but because it is sometimes useful to know how the data are formatted in the GRIB2 file, it is included in the grib2scan output.
</body>
</html>
|