25 const float *geo_lat,
const float *geo_lon,
27 const float latexts[2],
const float lonexts[2]
34 void interp2D(
const float* sourceData,
float* resultData,
float srcMV,
float dstMV,
const size_t* dims);
40 float getAngle(
int ilon,
int ilat)
const;
46 float bestLatLonPolar(
int ulon,
int ulat);
47 float bestLatLon(
int ulon,
int ulat);
55 void findWeight(
float plon,
float plat,
int nlon,
int nlat,
float* alpha,
float *beta);
57 void findWeight2(
float x,
float y,
int nlon,
int nlat,
float* alpha,
float *beta);
60 float testInQuad(
float plon,
float plat,
int nlon,
int nlat);
62 float testInQuad2(
float x,
float y,
int nlon,
int nlat);
64 float finterp(
float A,
float B,
float th[4]) {
return (1.-A)*(1.-B)*th[0]+A*(1.-B)*th[1]+A*B*th[2]+(1.-A)*B*th[3];}
66 float COMDIF2(
float th[4],
float C){
return th[1]-th[0]+C*(th[0]-th[3]+th[2]-th[1]);}
68 float COMDIF4(
float th[4],
float C) {
return th[3]-th[0]+C*(th[0]-th[3]+th[2]-th[1]);}
70 float DET(
float A,
float B,
float th[4],
float ph[4]){
return COMDIF2(th,B)*COMDIF4(ph,A) - COMDIF4(th,A)*COMDIF2(ph,B);}
72 float DELT(
float theta,
float A,
float B,
float th[4]){
73 return (theta-finterp(A,B,th));
75 float DELA(
float delth,
float delph,
float th[4],
float ph[4],
float A,
float B){
76 float num = delth*COMDIF4(ph,A) - delph*COMDIF4(th,A);
77 float det = DET(A,B,th,ph);
78 if (det == 0.f)
return 1.e30f;
81 float DELB(
float delth,
float delph,
float th[4],
float ph[4],
float A,
float B){
82 float num = delph*COMDIF2(th,B) - delth*COMDIF2(ph,B);
83 float det = DET(A,B,th,ph);
84 if (det == 0.f)
return 1.e30f;
88 float errP(
float theta,
float phi,
float A,
float B,
float th[4],
float ph[4]){
89 return abs(theta-finterp(A,B,th)+abs(phi-finterp(A,B,ph)));
97 float NEWA(
float A,
float B,
float theta,
float phi,
float th[4],
float ph[4]){
98 float delth = DELT(theta,A,B,th);
99 float delph = DELT(phi,A,B,ph);
100 float dela = DELA(delth,delph,th,ph,A,B);
101 if (dela == 1.e30f)
return 1.e30f;
104 float NEWB(
float A,
float B,
float theta,
float phi,
float th[4],
float ph[4]){
105 float delth = DELT(theta,A,B,th);
106 float delph = DELT(phi,A,B,ph);
107 float delb = DELB(delth,delph,th,ph,A,B);
108 if (delb == 1.e30f)
return 1.e30f;
127 float _lonLatExtents[4];
128 float _epsilon, _epsRect;
129 float _deltaLat, _deltaLon;
130 bool _wrapLon, _wrapLat;
const float * getGeoLats() const