# Ingest a New Grid Using .grib Files Unrecognized grids can be decoded by EDEX simply by dropping `*.grib` or `*.grib2` files into `/awips2/data_store/ingest/` To add support for a new grid, two edits must be made: * **Geospatial projection** must be defined in a [***grid navigation file***](#create-grid-projection-file) * **Grid name**, **center**, **subcenter**, and **process ID** must be defined in a [***model definition file***](#create-model-definition) If the parameters in the grib file haven't been previously specified, another change *may* be needed as well: * **Center**, **subcenter**, **discipline**, **category**, and possibly **parameter ID** information may need to be defined in a [***table***](#adding-a-table) --- ## Ingest an Unsupported Grid ### Download Test Data Download an example grib1 file and rename to a `*.grib` extension, then copy to the manual ingest point `/awips2/data_store/ingest/` wget https://downloads.unidata.ucar.edu/awips2/current/files/14102318_nmm_d01.GrbF00600 -O wrf.grib cp wrf.grib /awips2/data_store/ingest/ Remember that the data distribution file (`/awips2/edex/data/utility/common_static/base/distribution/grib.xml`) will match filenames which have the `*.grib*` extension. ### Check Grib Logs Confirm that the grib file decodes in the grib log file: edex log grib INFO [Ingest.GribDecode] /awips2/data_store/ingest/grib/20141026/14/wrf.grib processed in: 0.1200 (sec) Latency: 21.8080 (sec) INFO [Ingest.GribDecode] /awips2/data_store/ingest/grib/20141026/14/wrf.grib processed in: 0.1180 (sec) Latency: 21.8140 (sec) INFO [Ingest.GribDecode] /awips2/data_store/ingest/grib/20141026/14/wrf.grib processed in: 0.4230 (sec) Latency: 21.8360 (sec) INFO [Ingest.GribDecode] /awips2/data_store/ingest/grib/20141026/14/wrf.grib processed in: 0.2240 (sec) Latency: 21.9140 (sec) ... ### Check HDF5 Data Check that the hdf5 data directory exists for our unnamed grid ls -latr /awips2/edex/data/hdf5/grid/GribModel:7:0:89 Though the grib file has been decoded, it has been given a generic name with its center, subcenter, and process IDs (7, 0, 89, respectively). --- ## Determine Grid Projection When the grid was ingested a record was added to the `grid_coverage` table with its navigation information: psql metadata metadata=# select nx,ny,dx,dy,majoraxis,minoraxis,la1,lo1,lov,latin1,latin2 from gridcoverage where id=(select distinct(location_id) from grid_info where datasetid='GribModel:7:0:89'); nx | ny | dx | dy | majoraxis | minoraxis | la1 | lo1 | lov | latin1 | latin2 -----+-----+------------------+------------------+-----------+-----------+------------------+-------------------+-------------------+------------------+------------------ 201 | 155 | 4.29699993133545 | 4.29699993133545 | 6378160 | 6356775 | 42.2830009460449 | -72.3610000610352 | -67.0770034790039 | 45.3680000305176 | 45.3680000305176 (1 row) Compare with the projection info returned by wgrib on the original file (look at the bolded sections below and make sure they match up with the corresponding entries returned from the database above):
wgrib -V wrf.grib rec 799:27785754:date 2014102318 ALBDO kpds5=84 kpds6=1 kpds7=0 levels=(0,0) grid=255 sfc 6hr fcst: bitmap: 736 undef ALBDO=Albedo [%] timerange 0 P1 6 P2 0 TimeU 1 nx 201 ny 155 GDS grid 3 num_in_ave 0 missing 0 center 7 subcenter 0 process 89 Table 2 scan: WE:SN winds(grid) Lambert Conf: Lat1 42.283000 Lon1 -72.361000 Lov -67.077000 Latin1 45.368000 Latin2 45.368000 LatSP 0.000000 LonSP 0.000000 North Pole (201 x 155) Dx 4.297000 Dy 4.297000 scan 64 mode 8 min/max data 5 21.9 num bits 8 BDS_Ref 50 DecScale 1 BinScale 0Notice that our grib file has a **Lambert Conformal** projection. We will need these values for the next step. !!! note "**There is a tolerance of +/- 0.1 degrees** to keep in mind when defining your coverage area." --- ## Create Grid Projection File ### Projection Types Grid projection files are stored in `/awips2/edex/data/utility/common_static/base/grib/grids/` and there are four grid coverage types available: 1. **lambertConformalGridCoverage** (example: `RUCIcing.xml`)
wgrib -V wrf.grib rec 799:27785754:date 2014102318 ALBDO kpds5=84 kpds6=1 kpds7=0 levels=(0,0) grid=255 sfc 6hr fcst: bitmap: 736 undef ALBDO=Albedo [%] timerange 0 P1 6 P2 0 TimeU 1 nx 201 ny 155 GDS grid 3 num_in_ave 0 missing 0 center 7 subcenter 0 process 89 Table 2 scan: WE:SN winds(grid) Lambert Conf: Lat1 42.283000 Lon1 -72.361000 Lov -67.077000 Latin1 45.368000 Latin2 45.368000< LatSP 0.000000 LonSP 0.000000 North Pole (201 x 155) Dx 4.297000 Dy 4.297000 scan 64 mode 8 min/max data 5 21.9 num bits 8 BDS_Ref 50 DecScale 1 BinScale 0For our example, the process is **89** and table is **2**. Next, take a look in: /awips2/edex/data/utility/common_static/base/grid/grib1ParameterConvTable.xml And find the entry that has grib1 data with TableVersion 2 and Value 89: