Changeset 12065

Show
Ignore:
Timestamp:
09/04/07 12:19:04 (10 months ago)
Author:
retsios
Message:

Add support for GRIB files with the Gaussian Latitude/Longitude projection.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • spike/grib/degrib18/degrib/degrib1.cpp

    r10753 r12065  
    864864   gridType = *(gds++); 
    865865   switch (gridType) { 
    866       case GB1S2_LATLON: 
     866      case GB1S2_LATLON: // Latitude/Longitude Grid 
     867      case GB1S2_GAUSSIAN_LATLON: // Gaussian Latitude/Longitude 
    867868         if ((sectLen != 32) && (sectLen != 42) && (sectLen != 52)) { 
    868869            errSprintf ("For LatLon GDS, should have 32 or 42 or 52 bytes " 
     
    870871            return -1; 
    871872         } 
    872          gdsMeta->projType = GS3_LATLON; 
     873         if (gridType == GB1S2_GAUSSIAN_LATLON) 
     874            gdsMeta->projType = GS3_GAUSSIAN_LATLON; 
     875         else 
     876            gdsMeta->projType = GS3_LATLON; 
    873877         gdsMeta->orientLon = 0; 
    874878         gdsMeta->meshLat = 0; 
     
    905909         gdsMeta->Dx = GRIB_UNSIGN_INT2 (*gds, gds[1]) * unit; 
    906910         gds += 2; 
    907          gdsMeta->Dy = GRIB_UNSIGN_INT2 (*gds, gds[1]) * unit; 
     911         if (gridType == GB1S2_GAUSSIAN_LATLON) { 
     912            int np = GRIB_UNSIGN_INT2 (*gds, gds[1]); /* parallels between a pole and the equator */ 
     913            gdsMeta->Dy = 90.0 / np; 
     914         } else 
     915            gdsMeta->Dy = GRIB_UNSIGN_INT2 (*gds, gds[1]) * unit; 
    908916         gds += 2; 
    909917         gdsMeta->scan = *gds; 
  • spike/grib/degrib18/degrib/meta.h

    r10749 r12065  
    6565/* For GRIB1 GDS Types. */ 
    6666enum { GB1S2_LATLON = 0, GB1S2_MERCATOR = 1, GB1S2_LAMBERT = 3, 
    67       GB1S2_POLAR = 5 
     67      GB1S2_GAUSSIAN_LATLON = 4, GB1S2_POLAR = 5 
    6868}; 
    6969 
     
    381381 */ 
    382382enum { GS3_LATLON = 0, GS3_MERCATOR = 10, GS3_POLAR = 20, 
    383        GS3_LAMBERT = 30, GS3_ORTHOGRAPHIC = 90, 
     383       GS3_LAMBERT = 30, GS3_GAUSSIAN_LATLON = 40, GS3_ORTHOGRAPHIC = 90, 
    384384       GS3_EQUATOR_EQUIDIST = 110, GS3_AZIMUTH_RANGE = 120}; 
    385385 
  • spike/grib/degrib18/degrib/metaparse.cpp

    r10753 r12065  
    824824   switch (is3[12]) { 
    825825      case GS3_LATLON: /* 0: Regular lat/lon grid. */ 
     826      case GS3_GAUSSIAN_LATLON:  /* 40: Gaussian lat/lon grid. */ 
    826827         if (ns3 < 72) { 
    827828            return -1; 
     
    849850         meta->gds.lon2 = is3[59] * unit; 
    850851         meta->gds.Dx = is3[63] * unit; /* degrees. */ 
    851          meta->gds.Dy = is3[67] * unit; /* degrees. */ 
     852         if (is3[12] == GS3_GAUSSIAN_LATLON) { 
     853            int np = is3[67]; /* parallels between a pole and the equator */ 
     854            meta->gds.Dy = 90.0 / np; 
     855         } else 
     856            meta->gds.Dy = is3[67] * unit; /* degrees. */ 
    852857         meta->gds.scan = (uChar) is3[71]; 
    853858         meta->gds.meshLat = 0; 
  • spike/grib/gribdataset.cpp

    r10749 r12065  
    386386                { 
    387387                case GS3_LATLON: 
     388                case GS3_GAUSSIAN_LATLON: 
    388389                        // No projection, only latlon system (geographic) 
    389390                        break;