Commit 568b50f0 authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

remapSearchSquare(): changed interface.

parent 87abbffe
......@@ -149,7 +149,7 @@ void remapSearchInit(RemapMethod mapType, RemapSearch &search, RemapGrid &src_gr
void remapSearchFree(RemapSearch &search);
void remapSearchPoints(RemapSearch &rsearch, double plon, double plat, knnWeightsType &knnWeights);
int remapSearchSquare(RemapSearch &rsearch, double plon, double plat, size_t *src_add, double *src_lats, double *src_lons);
int remapSearchSquare(RemapSearch &rsearch, const LonLatPoint &llp, size_t *src_add, double *src_lats, double *src_lons);
size_t remapSearchCells(RemapSearch &rsearch, bool isReg2dCell, grid_cell &gridCell, size_t *srchAddr);
void remapBilinearWeights(RemapSearch &rsearch, RemapVars &rv);
......
......@@ -144,7 +144,7 @@ remapBicubicWeights(RemapSearch &rsearch, RemapVars &rv)
double wgts[4][4]; // bicubic weights for four corners
// Find nearest square of grid points on source grid
int search_result = remapSearchSquare(rsearch, llp.lon, llp.lat, src_add, src_lats, src_lons);
int search_result = remapSearchSquare(rsearch, llp, src_add, src_lats, src_lons);
// Check to see if points are mask points
if (search_result > 0)
......@@ -260,7 +260,7 @@ remapBicubic(RemapSearch &rsearch, const double *restrict src_array, double *res
double wgts[4][4]; // bicubic weights for four corners
// Find nearest square of grid points on source grid
int search_result = remapSearchSquare(rsearch, llp.lon, llp.lat, src_add, src_lats, src_lons);
int search_result = remapSearchSquare(rsearch, llp, src_add, src_lats, src_lons);
// Check to see if points are mask points
if (search_result > 0)
......
......@@ -214,7 +214,7 @@ remapBilinearWeights(RemapSearch &rsearch, RemapVars &rv)
double wgts[4]; // bilinear weights for four corners
// Find nearest square of grid points on source grid
int search_result = remapSearchSquare(rsearch, llp.lon, llp.lat, src_add, src_lats, src_lons);
int search_result = remapSearchSquare(rsearch, llp, src_add, src_lats, src_lons);
// Check to see if points are mask points
if (search_result > 0)
......@@ -320,7 +320,7 @@ remapBilinear(RemapSearch &rsearch, const double *restrict src_array, double *re
double wgts[4]; // bilinear weights for four corners
// Find nearest square of grid points on source grid
int search_result = remapSearchSquare(rsearch, llp.lon, llp.lat, src_add, src_lats, src_lons);
int search_result = remapSearchSquare(rsearch, llp, src_add, src_lats, src_lons);
// Check to see if points are mask points
if (search_result > 0)
......
......@@ -334,16 +334,12 @@ gridSearchSquareCurv2d(GridPointSearch &gps, RemapGrid *rgrid, size_t *restrict
}
int
remapSearchSquare(RemapSearch &rsearch, double plon, double plat, size_t *src_add, double *src_lats, double *src_lons)
remapSearchSquare(RemapSearch &rsearch, const LonLatPoint &llp, size_t *src_add, double *src_lats, double *src_lons)
{
int searchResult;
if (rsearch.srcGrid->type == RemapGridType::Reg2D)
searchResult = gridSearchSquareReg2d(rsearch.srcGrid, src_add, src_lats, src_lons, plat, plon);
return gridSearchSquareReg2d(rsearch.srcGrid, src_add, src_lats, src_lons, llp.lat, llp.lon);
else if (rsearch.gps.in_use)
searchResult = gridSearchSquareCurv2d(rsearch.gps, rsearch.srcGrid, src_add, src_lats, src_lons, plat, plon);
return gridSearchSquareCurv2d(rsearch.gps, rsearch.srcGrid, src_add, src_lats, src_lons, llp.lat, llp.lon);
else
searchResult = gridSearchSquareCurv2dScrip(rsearch.srcGrid, src_add, src_lats, src_lons, plat, plon, rsearch.srcBins);
return searchResult;
return gridSearchSquareCurv2dScrip(rsearch.srcGrid, src_add, src_lats, src_lons, llp.lat, llp.lon, rsearch.srcBins);
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment