修补bug
parent
e3bcfe3e98
commit
9fd7bab1f3
|
@ -293,7 +293,8 @@ Eigen::MatrixXcd gdalImageComplex::getDataComplex(int start_row, int start_col,
|
||||||
// 获取数据集的第一个波段
|
// 获取数据集的第一个波段
|
||||||
GDALRasterBand* poBand;
|
GDALRasterBand* poBand;
|
||||||
poBand = poDataset->GetRasterBand(1);
|
poBand = poDataset->GetRasterBand(1);
|
||||||
|
rows_count = start_row + rows_count <= this->height ? rows_count : this->height - start_row;
|
||||||
|
cols_count = start_col + cols_count <= this->width ? cols_count : this->width - start_col;
|
||||||
// 读取波段信息,假设是复数类型
|
// 读取波段信息,假设是复数类型
|
||||||
int nXSize = cols_count; poBand->GetXSize();
|
int nXSize = cols_count; poBand->GetXSize();
|
||||||
int nYSize = rows_count; poBand->GetYSize();
|
int nYSize = rows_count; poBand->GetYSize();
|
||||||
|
|
|
@ -1680,18 +1680,16 @@ ErrorCode Complex2AmpRaster(QString inComplexPath, QString outRasterPath)
|
||||||
|
|
||||||
long blocklines = Memory1GB * 2 / 8 / inimg.width;
|
long blocklines = Memory1GB * 2 / 8 / inimg.width;
|
||||||
blocklines = blocklines < 100 ? 100 : blocklines;
|
blocklines = blocklines < 100 ? 100 : blocklines;
|
||||||
Eigen::MatrixXd imgArrb1 = Eigen::MatrixXd::Zero(blocklines, ampimg.width);
|
|
||||||
Eigen::MatrixXcd imgArr = Eigen::MatrixXcd::Zero(blocklines, inimg.width);
|
|
||||||
|
|
||||||
long startrow = 0;
|
long startrow = 0;
|
||||||
for (startrow = 0; startrow < inimg.height; startrow = startrow + blocklines) {
|
for (startrow = 0; startrow < inimg.height; startrow = startrow + blocklines) {
|
||||||
|
|
||||||
imgArrb1 = ampimg.getData(startrow, 0, blocklines, inimg.width, 1);
|
Eigen::MatrixXd imgArrb1 = ampimg.getData(startrow, 0, blocklines, inimg.width, 1);
|
||||||
imgArr = inimg.getData(startrow, 0, blocklines, inimg.width, 2);
|
Eigen::MatrixXcd imgArr = inimg.getDataComplex(startrow, 0, blocklines, inimg.width, 1);
|
||||||
imgArrb1 = imgArr.array().abs();
|
imgArrb1 = imgArr.array().abs();
|
||||||
ampimg.saveImage(imgArrb1, startrow, 0, 1);
|
ampimg.saveImage(imgArrb1, startrow, 0, 1);
|
||||||
}
|
}
|
||||||
qDebug() << "影像写入到:" << outRasterPath;
|
qDebug() << u8"影像写入到:" << outRasterPath;
|
||||||
return ErrorCode::SUCCESS;
|
return ErrorCode::SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -45,8 +45,8 @@ void QL1ASARProcessDialog::onpushButtonL1BSelect_clicked()
|
||||||
);
|
);
|
||||||
// 如果用户选择了文件
|
// 如果用户选择了文件
|
||||||
if (!fileNames.isEmpty()) {
|
if (!fileNames.isEmpty()) {
|
||||||
QString message = "选择的文件有:\n";
|
QString message = u8"选择的文件有:\n";
|
||||||
this->ui->lineEditL1ADataPath->setText(fileNames);
|
this->ui->lineEditL1BDataPath->setText(fileNames);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
QMessageBox::information(this, tr(u8"没有选择文件"), tr(u8"没有选择任何文件。"));
|
QMessageBox::information(this, tr(u8"没有选择文件"), tr(u8"没有选择任何文件。"));
|
||||||
|
@ -64,7 +64,7 @@ void QL1ASARProcessDialog::onpushButtonL1ASelect_clicked()
|
||||||
);
|
);
|
||||||
// 如果用户选择了文件
|
// 如果用户选择了文件
|
||||||
if (!fileNames.isEmpty()) {
|
if (!fileNames.isEmpty()) {
|
||||||
QString message = "选择的文件有:\n";
|
QString message = u8"选择的文件有:\n";
|
||||||
this->ui->lineEditL1ADataPath->setText(fileNames);
|
this->ui->lineEditL1ADataPath->setText(fileNames);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -82,7 +82,7 @@ void QL1ASARProcessDialog::onpushButtonS1ASelect_clicked()
|
||||||
);
|
);
|
||||||
// 如果用户选择了文件
|
// 如果用户选择了文件
|
||||||
if (!fileNames.isEmpty()) {
|
if (!fileNames.isEmpty()) {
|
||||||
QString message = "选择的文件有:\n";
|
QString message = u8"选择的文件有:\n";
|
||||||
this->ui->lineSlAPath->setText(fileNames);
|
this->ui->lineSlAPath->setText(fileNames);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -99,10 +99,10 @@ void QL1ASARProcessDialog::onbuttonBox_accepted()
|
||||||
long nlaz = ui->spinBoxLNAz->value();
|
long nlaz = ui->spinBoxLNAz->value();
|
||||||
long nlra = ui->spinBoxLNRa->value();
|
long nlra = ui->spinBoxLNRa->value();
|
||||||
|
|
||||||
qDebug() << "单视斜距复数产品 转 单视斜距幅度产品";
|
qDebug() << u8"单视斜距复数产品 转 单视斜距幅度产品";
|
||||||
Complex2AmpRaster(l1arasterpath, s1arasterpath);
|
Complex2AmpRaster(l1arasterpath, s1arasterpath);
|
||||||
|
|
||||||
qDebug() << "单视斜距幅度产品 转 多视斜距幅度产品";
|
qDebug() << u8"单视斜距幅度产品 转 多视斜距幅度产品";
|
||||||
MultiLookRaster(s1arasterpath, l1brasterpath, nlaz, nlra);
|
MultiLookRaster(s1arasterpath, l1brasterpath, nlaz, nlra);
|
||||||
|
|
||||||
QMessageBox::information(this, tr(u8"提示"), tr(u8"多视处理完成"));
|
QMessageBox::information(this, tr(u8"提示"), tr(u8"多视处理完成"));
|
||||||
|
|
|
@ -109,8 +109,8 @@ __global__ void processPulseKernel(
|
||||||
phCorr.y = rc_interp.x * sin_phase + rc_interp.y * cos_phase;
|
phCorr.y = rc_interp.x * sin_phase + rc_interp.y * cos_phase;
|
||||||
|
|
||||||
// amp correction
|
// amp correction
|
||||||
phCorr.x = ampcorrect * phCorr.x;
|
//phCorr.x = ampcorrect * phCorr.x;
|
||||||
phCorr.y = ampcorrect * phCorr.y;
|
//phCorr.y = ampcorrect * phCorr.y;
|
||||||
|
|
||||||
// Accumulate
|
// Accumulate
|
||||||
im_final[idx].x += phCorr.x;
|
im_final[idx].x += phCorr.x;
|
||||||
|
|
|
@ -700,15 +700,10 @@ extern "C" void ProcessRFPCTask(RFPCTask& task, long devid, float* h_R, float* h
|
||||||
);
|
);
|
||||||
PrintLasterError("CUDA_Kernel_Computer_echo");
|
PrintLasterError("CUDA_Kernel_Computer_echo");
|
||||||
cudaDeviceSynchronize();
|
cudaDeviceSynchronize();
|
||||||
if ((sTi * 100.0 / task.targetnum) - process >= 10) {
|
if ((sTi * 100.0 / task.targetnum) - process >= 1) {
|
||||||
process = sTi * 100.0 / task.targetnum;
|
process = sTi * 100.0 / task.targetnum;
|
||||||
PRINT("device ID : %d , TargetID [%f]: %d / %d finished %d\n", devid, sTi * 100.0 / task.targetnum, sTi, task.targetnum, devid);
|
PRINT("device ID : %d , TargetID [%f]: %d / %d finished %d\n", devid, sTi * 100.0 / task.targetnum, sTi, task.targetnum, devid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -929,6 +929,8 @@ ErrorCode RFPCProcessCls::RFPCMainProcess_GPU() {
|
||||||
|
|
||||||
ErrorCode RFPCProcessCls::RFPCMainProcess_MultiGPU_NoAntPattern()
|
ErrorCode RFPCProcessCls::RFPCMainProcess_MultiGPU_NoAntPattern()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
int num_devices = 0;
|
int num_devices = 0;
|
||||||
cudaGetDeviceCount(&num_devices);
|
cudaGetDeviceCount(&num_devices);
|
||||||
PRINT("GPU Count : %d \n", num_devices);
|
PRINT("GPU Count : %d \n", num_devices);
|
||||||
|
@ -943,7 +945,11 @@ ErrorCode RFPCProcessCls::RFPCMainProcess_MultiGPU_NoAntPattern()
|
||||||
std::shared_ptr<SatelliteOribtNode[]> sateOirbtNodes = this->getSatelliteOribtNodes(prf_time, dt, antflag, imageStarttime);
|
std::shared_ptr<SatelliteOribtNode[]> sateOirbtNodes = this->getSatelliteOribtNodes(prf_time, dt, antflag, imageStarttime);
|
||||||
|
|
||||||
|
|
||||||
|
for (int devid = 0; devid < num_devices; devid++) {
|
||||||
|
printf("GPU ID: %d \n", devid);
|
||||||
|
printDeviceInfo(devid);
|
||||||
|
printf("----------------------------------------\n");
|
||||||
|
}
|
||||||
|
|
||||||
#pragma omp parallel for
|
#pragma omp parallel for
|
||||||
for (int devid = 0; devid < num_devices; devid++) {
|
for (int devid = 0; devid < num_devices; devid++) {
|
||||||
|
@ -969,6 +975,16 @@ ErrorCode RFPCProcessCls::RFPCMainProcess_GPU_NoAntPattern(size_t startprfid, si
|
||||||
std::map<long, SigmaParam> clssigmaParamsDict = this->SigmaDatabasePtr->getsigmaParams(polartype);;
|
std::map<long, SigmaParam> clssigmaParamsDict = this->SigmaDatabasePtr->getsigmaParams(polartype);;
|
||||||
std::map<long, CUDASigmaParam> clsCUDASigmaParamsDict;
|
std::map<long, CUDASigmaParam> clsCUDASigmaParamsDict;
|
||||||
for (const auto& pair : clssigmaParamsDict) {
|
for (const auto& pair : clssigmaParamsDict) {
|
||||||
|
|
||||||
|
if (abs(pair.second.p1)<1e-5&&
|
||||||
|
abs(pair.second.p2) < 1e-5 &&
|
||||||
|
abs(pair.second.p3) < 1e-5 &&
|
||||||
|
abs(pair.second.p4) < 1e-5 &&
|
||||||
|
abs(pair.second.p5) < 1e-5 &&
|
||||||
|
abs(pair.second.p6) < 1e-5) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
clsCUDASigmaParamsDict.insert(std::pair<long, CUDASigmaParam>(pair.first,
|
clsCUDASigmaParamsDict.insert(std::pair<long, CUDASigmaParam>(pair.first,
|
||||||
CUDASigmaParam{
|
CUDASigmaParam{
|
||||||
float(pair.second.p1),
|
float(pair.second.p1),
|
||||||
|
@ -994,7 +1010,7 @@ ErrorCode RFPCProcessCls::RFPCMainProcess_GPU_NoAntPattern(size_t startprfid, si
|
||||||
gdalImage demlandcls(this->LandCoverPath);// 地表覆盖类型
|
gdalImage demlandcls(this->LandCoverPath);// 地表覆盖类型
|
||||||
gdalImage slpxyz(this->demsloperPath);// 地面坡向
|
gdalImage slpxyz(this->demsloperPath);// 地面坡向
|
||||||
|
|
||||||
long allDemRow = Memory1MB/demxyz.width/8/3*6000;
|
long allDemRow = Memory1GB/demxyz.width/8/3*6;
|
||||||
//allDemRow = allDemRow < demxyz.height ? allDemRow : demxyz.height;
|
//allDemRow = allDemRow < demxyz.height ? allDemRow : demxyz.height;
|
||||||
for(long demId=0;demId< demxyz.height;demId=demId+ allDemRow){
|
for(long demId=0;demId< demxyz.height;demId=demId+ allDemRow){
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue