eccodes/html/keys.html

89 lines
7.0 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>grib_api: Grib API keys</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.5.3 -->
<div class="tabs">
<ul>
<li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="modules.html"><span>Modules</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
<li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
<li><a href="examples.html"><span>Examples</span></a></li>
</ul>
</div>
<h1><a class="anchor" name="keys">Grib API keys</a></h1>The GRIBEX routine used at ECMWF to encode and decode GRIB messages works on a number based table to retrive all the information from the message. This approach forces the user either to learn a code table or to use the documentation intensively. With grib_api a key name based access is provided so that all the information contained in the GRIB message is retrieved through alphanumeric names. <br>
All the key names are built from the official WMO documentation on the GRIB edition 1 and 2 coding standard removing the spaces in the key description and capitalizing the initials so that the caption:<br>
<div class="fragment"><pre class="fragment">
identification of originating generating centre
</pre></div> is transformed into the key name<br>
<div class="fragment"><pre class="fragment">
identificationOfOriginatingGeneratingCentre
</pre></div><br>
Some short names (aliases) are also provided, e.g. "centre" is an alias for identificationOfOriginatingGeneratingCentre. The names are always easily releated to the meaning of their value.<br>
A different set of keys is available for each message because the content is different. It is easy to find the keys available in a message by using the GRIB tools (<a class="el" href="grib_dump.html">grib_dump) </a>or the library (<a class="el" href="keys__iterator_8c-example.html">keys_iterator.c</a>).<br>
<h2><a class="anchor" name="coded_computed">
Coded and Computed keys</a></h2>
There are two different types of keys: coded and computed. <br>
The coded keys are directly linked to octets of the GRIB message and their value is obtained by only decoding the octets. A list of all the coded keys in a message can be obtained using <a class="el" href="grib_dump.html">grib_dump</a> without any option (use the -a option to obtain also their aliases).<br>
The computed keys are obtained by combining other keys (coded or computed) and when their value is set all the related keys are set in a cascade process.<br>
These keys provide a synthesis of the information contained in the GRIB message and are a safe way to set complex attributes such as the type of grid or the type of packing. They are also helpful in the interpretation of some octets such as the scanning mode whose bits are related to the way of scanning the grid. In this case the computed keys:<br>
<div class="fragment"><pre class="fragment">
iScansNegatively
jScansPositively
jPointsAreConsecutive
alternativeRowScanning (available only for edition 2)
</pre></div><br>
will provide access to single bits of the scanning mode octect hiding its structure from the user.<br>
The keys can also have some attributes as <em>read</em> <em>only</em>, which means that the key cannot be set (e.g. 7777 at the end of the message), or <em>edition</em> <em>specific</em> that is the attribute of all the keys having different values in the two editions (e.g. longitudeOfFirstGridPoint) or being present in one edition only (e.g. alternativeRowScanning).<br>
Moreover there are some computed keys that cannot be "get" and can be considered as functions acting on the grib in some way. These keys are always characterised by a predicate in their name (e.g. setDecimalPrecision).<br>
For the computed keys we provide the following preliminary documentation that will be extended soon.<ul>
<li>MARS keywords.<br>
All MARS keywords are available. Some examples are:<ul>
<li>date</li><li>param</li><li>levtype</li><li>levelist</li><li>step</li><li>stream</li></ul>
</li><li>angles in degrees. <br>
All the angle variables are provided in two versions, a native one with the units coded into the GRIB file and an edition independent one in degrees. It is always better to work with the "in degrees" version that is always provided through the key which has the same name of the native version with the suffix InDegrees <div class="fragment"><pre class="fragment">
longitudeOfFirstGridPoint -&gt; longitudeOfFirstGridPointInDegrees
latitudeOfFirstGridPoint -&gt; latitudeOfFirstGridPointInDegrees
longitudeOfLastGridPoint -&gt; longitudeOfLastGridPointInDegrees
latitudeOfFirstGridPoint -&gt; latitudeOfLastGridPointInDegrees
latitudeOfFirstGridPoint -&gt; latitudeOfFirstGridPointInDegrees
iDirectionIncrement -&gt; iDirectionIncrementInDegrees
jDirectionIncrement -&gt; jDirectionIncrementInDegrees
</pre></div></li><li>gridType<br>
The type of grid computed from the grid description section.<ul>
<li>For both editions:<ul>
<li>regular_ll</li><li>reduced_ll</li><li>mercator</li><li>lambert</li><li>polar_stereographic</li><li>UTM</li><li>simple_polyconic</li><li>albers</li><li>miller</li><li>rotated_ll</li><li>stretched_ll</li><li>stretched_rotated_ll</li><li>regular_gg</li><li>rotated_gg</li><li>stretched_gg</li><li>stretched_rotated_gg</li><li>reduced_gg</li><li>sh</li><li>rotated_sh</li><li>stretched_sh</li><li>stretched_rotated_sh</li><li>space_view<br>
</li></ul>
</li><li>For edition 2 only:<ul>
<li>triangular_grid</li><li>equatorial_azimuthal_equidistant</li><li>azimuth_range</li><li>cross_section</li><li>Hovmoller</li><li>time_section</li></ul>
</li></ul>
</li></ul>
<p>
<ul>
<li>packingType<br>
The alghorithm used to pack data into the GRIB message.<br>
<ul>
<li>For GRIB edition 1:<ul>
<li>grid_simple</li><li>grid_simple_matrix</li><li>grid_simple_matrix_bitmap</li><li>grid_second_order</li><li>grid_second_order_different_width</li><li>spectral_complex</li><li>spectral_simple</li><li>grid_unknown</li><li>spectral_unknown<br>
</li></ul>
</li><li>For GRIB edition 2:<ul>
<li>grid_simple</li><li>grid_simple_matrix</li><li>grid_simple_matrix_bitmap</li><li>grid_complex</li><li>grid_complex_spatial_differencing</li><li>grid_jpeg</li><li>grid_png</li><li>grid_ieee</li><li>spectral_simple</li><li>spectral_complex</li><li>grid_simple_log_preprocessing</li></ul>
</li></ul>
</li></ul>
<p>
<ul>
<li>setDecimalPrecision<br>
is a function key used to set the decimal precision see the <a class="el" href="grib_set.html">grib_set</a> page for usage.</li></ul>
<p>
<ul>
<li>getNumberOfValues<br>
The number of values coded into the data section of the GRIB message </li></ul>
<hr size="1"><address style="text-align: right;"><small>Generated on Tue Sep 22 15:18:22 2009 for grib_api by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.3 </small></address>
</body>
</html>