修改前同步

pull/3/head
陈增辉 2024-12-25 22:47:56 +08:00
parent d5cc984434
commit f9537bdaf8
4 changed files with 11 additions and 10 deletions

View File

@ -163,7 +163,7 @@ ErrorCode EchoL0Dataset::OpenOrNew(QString folder, QString filename, long PluseC
CPLSetConfigOption("GDAL_FILENAME_IS_UTF8", "YES"); CPLSetConfigOption("GDAL_FILENAME_IS_UTF8", "YES");
GDALDriver* poDriver = GetGDALDriverManager()->GetDriverByName("ENVI"); GDALDriver* poDriver = GetGDALDriverManager()->GetDriverByName("ENVI");
std::shared_ptr<GDALDataset> poDstDS(poDriver->Create(this->echoDataFilePath.toUtf8().constData(), PlusePoints, PluseCount, 1, GDT_CFloat64, NULL)); std::shared_ptr<GDALDataset> poDstDS(poDriver->Create(this->echoDataFilePath.toUtf8().constData(), PlusePoints, PluseCount, 1, GDT_CFloat32, NULL));
GDALFlushCache((GDALDatasetH)poDstDS.get()); GDALFlushCache((GDALDatasetH)poDstDS.get());
poDstDS.reset(); poDstDS.reset();
omp_unset_lock(&lock); // omp_unset_lock(&lock); //
@ -500,7 +500,7 @@ std::shared_ptr<double> EchoL0Dataset::getAntPos()
return temp; return temp;
} }
std::shared_ptr<std::complex<double>> EchoL0Dataset::getEchoArr(long startPRF, long PRFLen) std::shared_ptr<std::complex<float>> EchoL0Dataset::getEchoArr(long startPRF, long PRFLen)
{ {
if (!(startPRF < this->PluseCount)) { if (!(startPRF < this->PluseCount)) {
qDebug() << QString::fromStdString(errorCode2errInfo(ErrorCode::ECHO_L0DATA_PRFIDXOUTRANGE))<<startPRF<<" "<<this->PluseCount; qDebug() << QString::fromStdString(errorCode2errInfo(ErrorCode::ECHO_L0DATA_PRFIDXOUTRANGE))<<startPRF<<" "<<this->PluseCount;
@ -527,13 +527,13 @@ std::shared_ptr<std::complex<double>> EchoL0Dataset::getEchoArr(long startPRF, l
long width = rasterDataset->GetRasterXSize(); long width = rasterDataset->GetRasterXSize();
long height = rasterDataset->GetRasterYSize(); long height = rasterDataset->GetRasterYSize();
long band_num = rasterDataset->GetRasterCount(); long band_num = rasterDataset->GetRasterCount();
std::shared_ptr<std::complex<double>> temp = nullptr; std::shared_ptr<std::complex<float>> temp = nullptr;
if (height != this->PluseCount || width != this->PlusePoints) { if (height != this->PluseCount || width != this->PlusePoints) {
qDebug() << QString::fromStdString(errorCode2errInfo(ErrorCode::ECHO_L0DATA_ECHOFILEFORMATERROR)); qDebug() << QString::fromStdString(errorCode2errInfo(ErrorCode::ECHO_L0DATA_ECHOFILEFORMATERROR));
} }
else { else {
if (gdal_datatype == GDT_CFloat64) { if (gdal_datatype == GDT_CFloat64) {
temp= std::shared_ptr<std::complex<double>>(new std::complex<double>[PRFLen * width ], delArrPtr); temp= std::shared_ptr<std::complex<float>>(new std::complex<float>[PRFLen * width ], delArrPtr);
poBand->RasterIO(GF_Read, 0, startPRF, width, PRFLen, temp.get(), width, PRFLen, GDT_CFloat64, 0, 0); poBand->RasterIO(GF_Read, 0, startPRF, width, PRFLen, temp.get(), width, PRFLen, GDT_CFloat64, 0, 0);
GDALFlushCache((GDALDatasetH)rasterDataset.get()); GDALFlushCache((GDALDatasetH)rasterDataset.get());
} }
@ -548,7 +548,7 @@ std::shared_ptr<std::complex<double>> EchoL0Dataset::getEchoArr(long startPRF, l
return temp; return temp;
} }
std::shared_ptr<std::complex<double>> EchoL0Dataset::getEchoArr() std::shared_ptr<std::complex<float>> EchoL0Dataset::getEchoArr()
{ {
return this->getEchoArr(0,this->PluseCount); return this->getEchoArr(0,this->PluseCount);
} }
@ -583,7 +583,7 @@ ErrorCode EchoL0Dataset::saveAntPos(std::shared_ptr<double> ptr)
return ErrorCode::SUCCESS; return ErrorCode::SUCCESS;
} }
ErrorCode EchoL0Dataset::saveEchoArr(std::shared_ptr<std::complex<double>> echoPtr, long startPRF, long PRFLen) ErrorCode EchoL0Dataset::saveEchoArr(std::shared_ptr<std::complex<float>> echoPtr, long startPRF, long PRFLen)
{ {
if (!(startPRF < this->PluseCount)) { if (!(startPRF < this->PluseCount)) {
qDebug() << QString::fromStdString(errorCode2errInfo(ErrorCode::ECHO_L0DATA_PRFIDXOUTRANGE)); qDebug() << QString::fromStdString(errorCode2errInfo(ErrorCode::ECHO_L0DATA_PRFIDXOUTRANGE));

View File

@ -176,11 +176,11 @@ public: //
public: public:
// 读取文件 // 读取文件
std::shared_ptr<double> getAntPos(); std::shared_ptr<double> getAntPos();
std::shared_ptr<std::complex<double>> getEchoArr(long startPRF, long PRFLen); std::shared_ptr<std::complex<float>> getEchoArr(long startPRF, long PRFLen);
std::shared_ptr<std::complex<double>> getEchoArr(); std::shared_ptr<std::complex<float>> getEchoArr();
//保存文件 //保存文件
ErrorCode saveAntPos(std::shared_ptr<double> ptr); // 注意这个方法很危险,请写入前检查数据是否正确 ErrorCode saveAntPos(std::shared_ptr<double> ptr); // 注意这个方法很危险,请写入前检查数据是否正确
ErrorCode saveEchoArr(std::shared_ptr<std::complex<double>> echoPtr, long startPRF, long PRFLen); ErrorCode saveEchoArr(std::shared_ptr<std::complex<float>> echoPtr, long startPRF, long PRFLen);

View File

@ -978,6 +978,7 @@ void RTPCProcessMain(long num_thread, QString TansformPatternFilePath, QString R
qDebug() << "BandWidth: " << task->getBandWidth(); qDebug() << "BandWidth: " << task->getBandWidth();
qDebug() << "CenterFreq: " << task->getCenterFreq(); qDebug() << "CenterFreq: " << task->getCenterFreq();
qDebug() << "PRF: " << task->getPRF(); qDebug() << "PRF: " << task->getPRF();
qDebug() << "Lamda: " << task->getCenterLamda();
qDebug() << "Fs: " << task->getFs(); qDebug() << "Fs: " << task->getFs();
qDebug() << "POLAR: " << task->getPolarType(); qDebug() << "POLAR: " << task->getPolarType();
qDebug() << "NearRange: " << task->getNearRange(); qDebug() << "NearRange: " << task->getNearRange();

View File

@ -26,7 +26,7 @@ void CreatePixelXYZ(std::shared_ptr<EchoL0Dataset> echoL0ds, QString outPixelXYZ
double dx = LIGHTSPEED / 2 / echoL0ds->getFs(); double dx = LIGHTSPEED / 2 / echoL0ds->getFs();
double Rnear = echoL0ds->getNearRange(); double Rnear = echoL0ds->getNearRange();
long echocol = 1073741824 / 8 / 4 / prfcount*32; long echocol = 1073741824 / 8 / 4 / prfcount*8;
std::cout << "echocol:\t " << echocol << std::endl; std::cout << "echocol:\t " << echocol << std::endl;
echocol = echocol < 3000 ? 3000 : echocol; echocol = echocol < 3000 ? 3000 : echocol;
long startcolidx = 0; long startcolidx = 0;