Skip to content
Snippets Groups Projects
Commit 8a426006 authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

Verifygrid: add healpix support

parent 134d3fba
No related branches found
No related tags found
No related merge requests found
......@@ -247,7 +247,10 @@ is_simple_polygon_convex(const Varray<Point> &cellCorners, int numCorners)
{
if (IS_NOT_EQUAL(direction, 0.0)) return false;
}
else { direction = turnsTo; }
else
{
direction = turnsTo;
}
}
return true;
......@@ -365,7 +368,10 @@ get_no_unique_center_points(size_t gridsize, size_t nx, const Varray<double> &gr
fprintf(stdout, "\n");
}
}
else { no_unique_center_points++; }
else
{
no_unique_center_points++;
}
}
return no_unique_center_points;
......@@ -695,7 +701,10 @@ verify_grid(size_t gridsize, size_t nx, int ncorner, const Varray<double> &grid_
fprintf(stdout, "\n");
}
}
else { no_counterclockwise_cells++; }
else
{
no_counterclockwise_cells++;
}
// The winding numbers algorithm is used to test whether the presumed center point is within the bounds of the cell.
auto windingNumber = winding_numbers_algorithm(cellCornersPlaneProjection, actualNumberOfCorners + 1, centerPoint2D);
......@@ -793,8 +802,10 @@ Verifygrid(void *argument)
auto gridID = vlistGrid(vlistID, gridno);
auto gridtype = gridInqType(gridID);
auto isHealpixGrid = (gridtype == GRID_PROJECTION && gridInqProjType(gridID) == CDI_PROJ_HEALPIX);
if (gridtype == GRID_GENERIC || gridtype == GRID_SPECTRAL) lgeo = false;
if (isHealpixGrid) lgeo = false;
if (gridtype == GRID_GME) gridID = gridToUnstructured(gridID, 1);
......@@ -847,7 +858,10 @@ Verifygrid(void *argument)
verify_grid(gridsize, nx, ncorner, grid_center_lon, grid_center_lat, grid_corner_lon, grid_corner_lat);
}
else { cdo_warning("Grid cell corner coordinates missing!"); }
else
{
cdo_warning("Grid cell corner coordinates missing!");
}
int dig = Options::CDO_flt_digits;
print_lonlat(dig, gridID, gridsize, grid_center_lon, grid_center_lat);
......@@ -855,7 +869,7 @@ Verifygrid(void *argument)
else
{
if (ngrids == 1)
cdo_print(Blue("Grid consists of %zu points (type: %s)"), gridsize, gridNamePtr(gridtype));
cdo_print(Blue("Grid consists of %zu points (type: %s)"), gridsize, isHealpixGrid ? "healpix" : gridNamePtr(gridtype));
else
cdo_print(Blue("Grid no %u (of %u) consists of %zu points (type: %s)"), gridno + 1, ngrids, gridsize,
gridNamePtr(gridtype));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment