GRIB-958: Some lat/lon values are invalid for Polar stereographic grid

This commit is contained in:
Shahram Najm 2016-04-02 12:20:55 +01:00
parent 6fe6ce316c
commit 3a79efa761
1 changed files with 4 additions and 2 deletions

View File

@ -218,7 +218,8 @@ static int init(grib_iterator* iter,grib_handle* h,grib_arguments* args)
*lats = asin( cosc*sinphi1 + y*sinc*cosphi1/rho ) * RAD2DEG;
*lons = (lambda0+atan2(x*sinc, rho*cosphi1*cosc - y*sinphi1*sinc)) * RAD2DEG;
}
if (*lons<0) *lons+=360;
while (*lons<0) *lons += 360;
while (*lons>360) *lons -= 360;
lons++;
lats++;
@ -246,7 +247,8 @@ static int init(grib_iterator* iter,grib_handle* h,grib_arguments* args)
*lats = asin( cosc*sinphi1 + y*sinc*cosphi1/rho ) * RAD2DEG;
*lons = (lambda0+atan2(x*sinc, rho*cosphi1*cosc - y*sinphi1*sinc)) * RAD2DEG;
}
if (*lons<0) *lons+=360;
while (*lons<0) *lons += 360;
while (*lons>360) *lons -= 360;
lons++;
lats++;