修改为分块

pull/10/head
陈增辉 2025-04-08 12:19:06 +08:00
parent fbb2a3707e
commit 1e2b811c73
1 changed files with 106 additions and 105 deletions

View File

@ -788,21 +788,22 @@ int ResampleEChoDataFromGeoEcho(QString L2echodataPath, QString RangeLooktablePa
gdalImageComplex echodata(L2echodataPath);
gdalImage looktable(RangeLooktablePath);
gdalImageComplex l1adata = CreategdalImageComplexNoProj(L1AEchoDataPath, looktable.height, looktable.width, 1, true);
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);
Eigen::MatrixXd imglatArr = looktable.getData(0, 0, looktable.height, looktable.width, 2);
Eigen::MatrixXcd l1aArr= l1adata.getDataComplex(0, 0, l1adata.height, l1adata.width, 1);
for (long startRow = 0; startRow < looktable.height; startRow = startRow + blockHeight) {
printf("\rGEC: process:%f precent\t\t\t", startRow * 100.0 / looktable.height);
blockHeight = blockHeight + startRow < looktable.height ? blockHeight : looktable.height - startRow;
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;
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++) {
double lon = imglonArr(i, j);
double lat = imglatArr(i, j);
@ -898,8 +899,8 @@ int ResampleEChoDataFromGeoEcho(QString L2echodataPath, QString RangeLooktablePa
}
}
l1adata.saveImage(l1aArr, 0, 0, 1);
l1adata.saveImage(l1aArr, startRow, 0, 1);
}