Angular precision
@@ -601,17 +601,18 @@ static int check_handle_against_spec(grib_handle* handle, const long edition,
int err = 0;
int check_latitudes = 1;
int check_longitudes = 1;
- double angular_precision = 1.0/1000.0; /* millidegree */
- double tolerance = angular_precision/2.0; /* half a millidegree */
+ long angleSubdivisions = 0;
+ double angular_precision = 1.0/1000.0; /* millidegree by default */
+ double tolerance = 0;
if (edition == 2) {
- angular_precision = 1.0/1000000.0; /* microdegree */
- tolerance = angular_precision/2.0;
+ return GRIB_SUCCESS; /* For now only do checks on edition 1 */
}
- if (edition == 2) {
- return GRIB_SUCCESS; /* For now only do checks on edition 1 */
+ if ((err = grib_get_long(handle, "angleSubdivisions", &angleSubdivisions))==GRIB_SUCCESS) {
+ angular_precision = 1.0/angleSubdivisions;
}
+ tolerance = angular_precision/2.0;
if (spec->grid_type == GRIB_UTIL_GRID_SPEC_POLAR_STEREOGRAPHIC ||
spec->grid_type == GRIB_UTIL_GRID_SPEC_SH)
