修改为分块
parent
fbb2a3707e
commit
1e2b811c73
|
@ -788,119 +788,120 @@ int ResampleEChoDataFromGeoEcho(QString L2echodataPath, QString RangeLooktablePa
|
||||||
gdalImageComplex echodata(L2echodataPath);
|
gdalImageComplex echodata(L2echodataPath);
|
||||||
gdalImage looktable(RangeLooktablePath);
|
gdalImage looktable(RangeLooktablePath);
|
||||||
gdalImageComplex l1adata = CreategdalImageComplexNoProj(L1AEchoDataPath, looktable.height, looktable.width, 1, true);
|
gdalImageComplex l1adata = CreategdalImageComplexNoProj(L1AEchoDataPath, looktable.height, looktable.width, 1, true);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Eigen::MatrixXcd echoArr = echodata.getDataComplex(0, 0, echodata.height, echodata.width, 1);
|
Eigen::MatrixXcd echoArr = echodata.getDataComplex(0, 0, echodata.height, echodata.width, 1);
|
||||||
|
|
||||||
|
long blockHeight = Memory1GB / looktable.width / 8 * 2;
|
||||||
|
|
||||||
Eigen::MatrixXd imglonArr = looktable.getData(0, 0, looktable.height, looktable.width, 1);
|
for (long startRow = 0; startRow < looktable.height; startRow = startRow + blockHeight) {
|
||||||
Eigen::MatrixXd imglatArr = looktable.getData(0, 0, looktable.height, looktable.width, 2);
|
printf("\rGEC: process:%f precent\t\t\t", startRow * 100.0 / looktable.height);
|
||||||
Eigen::MatrixXcd l1aArr= l1adata.getDataComplex(0, 0, l1adata.height, l1adata.width, 1);
|
blockHeight = blockHeight + startRow < looktable.height ? blockHeight : looktable.height - startRow;
|
||||||
l1aArr = l1aArr.array() * 0;
|
Eigen::MatrixXd imglonArr = looktable.getData(startRow, 0, blockHeight, looktable.width, 1);
|
||||||
|
Eigen::MatrixXd imglatArr = looktable.getData(startRow, 0, blockHeight, looktable.width, 2);
|
||||||
|
Eigen::MatrixXcd l1aArr = l1adata.getDataComplex(0, 0, blockHeight, l1adata.width, 1);
|
||||||
|
l1aArr = l1aArr.array() * 0;
|
||||||
|
|
||||||
long imgheight = looktable.height;
|
long imgheight = blockHeight;
|
||||||
long imgwidth = looktable.width;
|
long imgwidth = looktable.width;
|
||||||
for (long i = 0; i < imgheight; i++) {
|
for (long i = 0; i < imgheight; i++) {
|
||||||
printf("\rGEC: process:%f precent\t\t\t",i*100.0/imgheight);
|
|
||||||
for (long j = 0; j < imgwidth; j++) {
|
for (long j = 0; j < imgwidth; j++) {
|
||||||
double lon = imglonArr(i, j);
|
double lon = imglonArr(i, j);
|
||||||
double lat = imglatArr(i, j);
|
double lat = imglatArr(i, j);
|
||||||
Landpoint point = echodata.getRow_Col(lon, lat);
|
Landpoint point = echodata.getRow_Col(lon, lat);
|
||||||
|
|
||||||
|
if (point.lon<1 || point.lon>echodata.width - 2 || point.lat < 1 || point.lat >echodata.height - 2) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
else {}
|
||||||
|
// ʵ²¿²åÖµ
|
||||||
|
{
|
||||||
|
Landpoint p0, p11, p21, p12, p22;
|
||||||
|
|
||||||
|
p0.lon = point.lon;
|
||||||
|
p0.lat = point.lat;
|
||||||
|
|
||||||
|
p11.lon = floor(p0.lon);
|
||||||
|
p11.lat = floor(p0.lat);
|
||||||
|
p11.ati = echoArr(long(p11.lat), long(p11.lon)).real();
|
||||||
|
|
||||||
|
p12.lon = ceil(p0.lon);
|
||||||
|
p12.lat = floor(p0.lat);
|
||||||
|
p12.ati = echoArr(long(p12.lat), long(p12.lon)).real();
|
||||||
|
|
||||||
|
p21.lon = floor(p0.lon);
|
||||||
|
p21.lat = ceil(p0.lat);
|
||||||
|
p21.ati = echoArr(long(p21.lat), long(p21.lon)).real();
|
||||||
|
|
||||||
|
p22.lon = ceil(p0.lon);
|
||||||
|
p22.lat = ceil(p0.lat);
|
||||||
|
p22.ati = echoArr(long(p22.lat), long(p22.lon)).real();
|
||||||
|
|
||||||
|
p0.lon = p0.lon - p11.lon;
|
||||||
|
p0.lat = p0.lat - p11.lat;
|
||||||
|
|
||||||
|
p12.lon = p12.lon - p11.lon;
|
||||||
|
p12.lat = p12.lat - p11.lat;
|
||||||
|
|
||||||
|
p21.lon = p21.lon - p11.lon;
|
||||||
|
p21.lat = p21.lat - p11.lat;
|
||||||
|
|
||||||
|
p22.lon = p22.lon - p11.lon;
|
||||||
|
p22.lat = p22.lat - p11.lat;
|
||||||
|
|
||||||
|
p11.lon = p11.lon - p11.lon;
|
||||||
|
p11.lat = p11.lat - p11.lat;
|
||||||
|
|
||||||
|
p0.ati = Bilinear_interpolation(p0, p11, p21, p12, p22);
|
||||||
|
l1aArr(i, j).real(p0.ati);
|
||||||
|
}
|
||||||
|
//Ð鲿²åÖµ
|
||||||
|
{
|
||||||
|
Landpoint p0, p11, p21, p12, p22;
|
||||||
|
|
||||||
|
p0.lon = point.lon;
|
||||||
|
p0.lat = point.lat;
|
||||||
|
|
||||||
|
p11.lon = floor(p0.lon);
|
||||||
|
p11.lat = floor(p0.lat);
|
||||||
|
p11.ati = echoArr(long(p11.lat), long(p11.lon)).imag();
|
||||||
|
|
||||||
|
p12.lon = ceil(p0.lon);
|
||||||
|
p12.lat = floor(p0.lat);
|
||||||
|
p12.ati = echoArr(long(p12.lat), long(p12.lon)).imag();
|
||||||
|
|
||||||
|
p21.lon = floor(p0.lon);
|
||||||
|
p21.lat = ceil(p0.lat);
|
||||||
|
p21.ati = echoArr(long(p21.lat), long(p21.lon)).imag();
|
||||||
|
|
||||||
|
p22.lon = ceil(p0.lon);
|
||||||
|
p22.lat = ceil(p0.lat);
|
||||||
|
p22.ati = echoArr(long(p22.lat), long(p22.lon)).imag();
|
||||||
|
|
||||||
|
p0.lon = p0.lon - p11.lon;
|
||||||
|
p0.lat = p0.lat - p11.lat;
|
||||||
|
|
||||||
|
p12.lon = p12.lon - p11.lon;
|
||||||
|
p12.lat = p12.lat - p11.lat;
|
||||||
|
|
||||||
|
p21.lon = p21.lon - p11.lon;
|
||||||
|
p21.lat = p21.lat - p11.lat;
|
||||||
|
|
||||||
|
p22.lon = p22.lon - p11.lon;
|
||||||
|
p22.lat = p22.lat - p11.lat;
|
||||||
|
|
||||||
|
p11.lon = p11.lon - p11.lon;
|
||||||
|
p11.lat = p11.lat - p11.lat;
|
||||||
|
|
||||||
|
p0.ati = Bilinear_interpolation(p0, p11, p21, p12, p22);
|
||||||
|
l1aArr(i, j).imag(p0.ati);
|
||||||
|
}
|
||||||
|
|
||||||
if (point.lon<1 || point.lon>echodata.width - 2 || point.lat < 1 || point.lat >echodata.height - 2) {
|
|
||||||
continue;
|
|
||||||
}
|
}
|
||||||
else {}
|
|
||||||
// ʵ²¿²åÖµ
|
|
||||||
{
|
|
||||||
Landpoint p0, p11, p21, p12, p22;
|
|
||||||
|
|
||||||
p0.lon = point.lon;
|
|
||||||
p0.lat = point.lat;
|
|
||||||
|
|
||||||
p11.lon = floor(p0.lon);
|
|
||||||
p11.lat = floor(p0.lat);
|
|
||||||
p11.ati = echoArr(long(p11.lat), long(p11.lon)).real();
|
|
||||||
|
|
||||||
p12.lon = ceil(p0.lon);
|
|
||||||
p12.lat = floor(p0.lat);
|
|
||||||
p12.ati = echoArr(long(p12.lat), long(p12.lon)).real();
|
|
||||||
|
|
||||||
p21.lon = floor(p0.lon);
|
|
||||||
p21.lat = ceil(p0.lat);
|
|
||||||
p21.ati = echoArr(long(p21.lat), long(p21.lon)).real();
|
|
||||||
|
|
||||||
p22.lon = ceil(p0.lon);
|
|
||||||
p22.lat = ceil(p0.lat);
|
|
||||||
p22.ati = echoArr(long(p22.lat), long(p22.lon)).real();
|
|
||||||
|
|
||||||
p0.lon = p0.lon - p11.lon;
|
|
||||||
p0.lat = p0.lat - p11.lat;
|
|
||||||
|
|
||||||
p12.lon = p12.lon - p11.lon;
|
|
||||||
p12.lat = p12.lat - p11.lat;
|
|
||||||
|
|
||||||
p21.lon = p21.lon - p11.lon;
|
|
||||||
p21.lat = p21.lat - p11.lat;
|
|
||||||
|
|
||||||
p22.lon = p22.lon - p11.lon;
|
|
||||||
p22.lat = p22.lat - p11.lat;
|
|
||||||
|
|
||||||
p11.lon = p11.lon - p11.lon;
|
|
||||||
p11.lat = p11.lat - p11.lat;
|
|
||||||
|
|
||||||
p0.ati = Bilinear_interpolation(p0, p11, p21, p12, p22);
|
|
||||||
l1aArr(i, j).real(p0.ati);
|
|
||||||
}
|
|
||||||
//Ð鲿²åÖµ
|
|
||||||
{
|
|
||||||
Landpoint p0, p11, p21, p12, p22;
|
|
||||||
|
|
||||||
p0.lon = point.lon;
|
|
||||||
p0.lat = point.lat;
|
|
||||||
|
|
||||||
p11.lon = floor(p0.lon);
|
|
||||||
p11.lat = floor(p0.lat);
|
|
||||||
p11.ati = echoArr(long(p11.lat), long(p11.lon)).imag();
|
|
||||||
|
|
||||||
p12.lon = ceil(p0.lon);
|
|
||||||
p12.lat = floor(p0.lat);
|
|
||||||
p12.ati = echoArr(long(p12.lat), long(p12.lon)).imag();
|
|
||||||
|
|
||||||
p21.lon = floor(p0.lon);
|
|
||||||
p21.lat = ceil(p0.lat);
|
|
||||||
p21.ati = echoArr(long(p21.lat), long(p21.lon)).imag();
|
|
||||||
|
|
||||||
p22.lon = ceil(p0.lon);
|
|
||||||
p22.lat = ceil(p0.lat);
|
|
||||||
p22.ati = echoArr(long(p22.lat), long(p22.lon)).imag();
|
|
||||||
|
|
||||||
p0.lon = p0.lon - p11.lon;
|
|
||||||
p0.lat = p0.lat - p11.lat;
|
|
||||||
|
|
||||||
p12.lon = p12.lon - p11.lon;
|
|
||||||
p12.lat = p12.lat - p11.lat;
|
|
||||||
|
|
||||||
p21.lon = p21.lon - p11.lon;
|
|
||||||
p21.lat = p21.lat - p11.lat;
|
|
||||||
|
|
||||||
p22.lon = p22.lon - p11.lon;
|
|
||||||
p22.lat = p22.lat - p11.lat;
|
|
||||||
|
|
||||||
p11.lon = p11.lon - p11.lon;
|
|
||||||
p11.lat = p11.lat - p11.lat;
|
|
||||||
|
|
||||||
p0.ati = Bilinear_interpolation(p0, p11, p21, p12, p22);
|
|
||||||
l1aArr(i, j).imag(p0.ati);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
l1adata.saveImage(l1aArr, startRow, 0, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
l1adata.saveImage(l1aArr, 0, 0, 1);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Reference in New Issue