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-geolocation
 

wgrib2: -geolocation

Introduction

Geolocation routines are used to calculate the longitudes and latitudes of the grid points. Wgrib2 can use Proj4, gctpc and its own internal routines to do the geolocation. Each set of routines has advanages and disadvantages. The routines are listed in the default order.

Proj

The Proj library was called PROJ4 from 1994-2017. In 2018, PROJ v5 was released and the software was renamed PROJ. Wgrib2 is still using a v4 library and all references in the code are to PROJ4.

PROJ is the gold standard of geolocation libraries. It is commonly used and well supported. The drawbacks are it doesn't support OpenMP and model grids. As of wgrib2 v3.1.2, PROJ4 is installed by default in order to suppore aspherical equal area Lambert grids.

Gctpc

Gctpc is an older library was which has lost support of its original authors (USGS). The advantage is that it does support OpenMP unlike Proj4. It supports fewer grids than Proj4 but that isn't a major problem because the grib2 standard only has support for a few grids. Gctpc supports an ellipsoidal earth and is always compiled with wgrib2.

Internal

The internal routines are used to support model grids (Gaussian grid, rotated lat-lon grid), spherical earth grids, and observational grids such as the space-view grid (used by EUMETSAT) and radar grids (angle, distance from the origin).

External, wgrib2 v3.1.2+

Wgrib2 can set or overwrite the locations of the grid points using -rpn (sto_lat, sto_lon), reading from a grib file using -grid_def, and reading from a double precision binary file using -import_lonlat. These methods will set the geolocation flag to external.

For wgrib2 prior to v3.1.2, the geolocation flag showed which geolocation library generated the locations of the grid points. External methods were not considered.

Usage

-geolocation
    print out geolocation routines used: proj4, gctpc, internal, external, or not_used
      external means the lat/lon may be read or computed by an external calculation.
      If wgrib3 does not need the geolocation information, the geolocation routines
         will not be called. 

Example

$ wgrib2 burned_area_20120131_12_23_1km.grib2 -geolocation -lon -90 30 
1:0:geolocation=gctpc:lon=270.004694,lat=29.997210,val=0

	The gctpc routines were used for geolocation.

$ wgrib2 burned_area_20120131_12_23_1km.grib2 -geolocation
1:0:geolocation=not_used

	The geolocation use not used.
See also: -gctpc -grid_def -import_lonlat -proj4 -rpn

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 dates: created 4/13/2020, modified 10/2022, 1/2023
Disclaimer Privacy Policy