同步修改

pull/13/head
陈增辉 2025-03-25 11:23:14 +08:00
parent 4bd1b24af0
commit 74296aa8be
8 changed files with 42 additions and 39 deletions

View File

@ -455,8 +455,11 @@ gdalImage::gdalImage(const QString& raster_path)
CPLSetConfigOption("GDAL_FILENAME_IS_UTF8", "YES"); // 注绞斤拷斤拷锟?1锟?7 CPLSetConfigOption("GDAL_FILENAME_IS_UTF8", "YES"); // 注绞斤拷斤拷锟?1锟?7
CPLSetConfigOption("GDAL_FILENAME_IS_UTF8", "YES"); CPLSetConfigOption("GDAL_FILENAME_IS_UTF8", "YES");
// 锟斤拷DEM影锟斤拷 // 锟斤拷DEM影锟斤拷
GDALDataset* rasterDataset = (GDALDataset*)(GDALOpen( GDALDataset* rasterDataset = (GDALDataset*)(GDALOpen(raster_path.toUtf8().constData(), GA_ReadOnly));
raster_path.toUtf8().constData(), GA_ReadOnly)); // 锟斤拷只斤拷式锟斤拷取斤拷影锟斤拷 if (nullptr == rasterDataset || NULL == rasterDataset) {
QMessageBox::warning(nullptr, u8"警告", QString(u8"文件无法打开:")+QString(raster_path));
exit(1);
}
this->width = rasterDataset->GetRasterXSize(); this->width = rasterDataset->GetRasterXSize();
this->height = rasterDataset->GetRasterYSize(); this->height = rasterDataset->GetRasterYSize();
this->band_num = rasterDataset->GetRasterCount(); this->band_num = rasterDataset->GetRasterCount();

View File

@ -131,7 +131,7 @@ __global__ void Kernel_RDProcess_doppler(
Rd_r = (ti - starttime) * PRF; Rd_r = (ti - starttime) * PRF;
Rd_c = Fs/LIGHTSPEED * (R - nearRange)*2; Rd_c = Fs/LIGHTSPEED * (R - nearRange)*2;
//printf("ti: %10.6f,starttime:%10.6f,PRF:%10.6f,Rd_r:%10.6f,Rd_c:%10.6f,R:%10.6f\n", ti, starttime, PRF, Rd_r, Rd_c, R); //printf("ti: %10.6f,starttime:%10.6f,PRF:%10.6f,Rd_r:%10.6f,Rd_c:%10.6f,R:%10.6f,nearRange:%e Fs: %e\n", ti, starttime, PRF, Rd_r, Rd_c, R, nearRange,Fs);
outRidx[idx] = Rd_r; outRidx[idx] = Rd_r;
outCidx[idx] = Rd_c;//Rd_c; outCidx[idx] = Rd_c;//Rd_c;
return; return;

View File

@ -585,6 +585,7 @@ __global__ void CUDA_Kernel_Computer_echo_NoAntPattern(
cuComplex echo = make_cuComplex(0, 0); cuComplex echo = make_cuComplex(0, 0);
float temp_phi = 0; float temp_phi = 0;
float temp_amp = 0; float temp_amp = 0;
for (long dataid = 0; dataid < SHAREMEMORY_FLOAT_HALF; dataid++) { for (long dataid = 0; dataid < SHAREMEMORY_FLOAT_HALF; dataid++) {
temp_phi = s_R[dataid] * factorjTemp; temp_phi = s_R[dataid] * factorjTemp;

View File

@ -30,10 +30,6 @@
//#include <Imageshow/ImageShowDialogClass.h> //#include <Imageshow/ImageShowDialogClass.h>
CUDA_AntSate_PtrList* malloc_AntSate_PtrList(long PRFCount) CUDA_AntSate_PtrList* malloc_AntSate_PtrList(long PRFCount)
{ {
CUDA_AntSate_PtrList* antlist = (CUDA_AntSate_PtrList*)malloc(sizeof(CUDA_AntSate_PtrList)); CUDA_AntSate_PtrList* antlist = (CUDA_AntSate_PtrList*)malloc(sizeof(CUDA_AntSate_PtrList));
@ -359,7 +355,7 @@ ErrorCode RFPCProcessCls::InitParams()
this->EchoSimulationData->setLookSide(this->TaskSetting->getIsRightLook() ? "R" : "L"); this->EchoSimulationData->setLookSide(this->TaskSetting->getIsRightLook() ? "R" : "L");
this->EchoSimulationData->OpenOrNew(OutEchoPath, TaskFileName, PluseCount, PlusePoint); this->EchoSimulationData->OpenOrNew(OutEchoPath, TaskFileName, PluseCount, PlusePoint);
this->EchoSimulationData->setRefPhaseRange(this->TaskSetting->getRefphaseRange()); this->EchoSimulationData->setRefPhaseRange(this->TaskSetting->getRefphaseRange());
this->EchoSimulationData->saveToXml();
QString tmpfolderPath = QDir(OutEchoPath).filePath("tmp"); QString tmpfolderPath = QDir(OutEchoPath).filePath("tmp");
if (QDir(tmpfolderPath).exists() == false) { if (QDir(tmpfolderPath).exists() == false) {
QDir(OutEchoPath).mkpath(tmpfolderPath); QDir(OutEchoPath).mkpath(tmpfolderPath);
@ -933,8 +929,8 @@ ErrorCode RFPCProcessCls::RFPCMainProcess_GPU() {
ErrorCode RFPCProcessCls::RFPCMainProcess_MultiGPU_NoAntPattern() ErrorCode RFPCProcessCls::RFPCMainProcess_MultiGPU_NoAntPattern()
{ {
int num_devices; int num_devices=1;
cudaGetDeviceCount(&num_devices); //cudaGetDeviceCount(&num_devices);
PRINT("GPU Count : %d \n", num_devices); PRINT("GPU Count : %d \n", num_devices);
long prfcount = this->EchoSimulationData->getPluseCount(); long prfcount = this->EchoSimulationData->getPluseCount();
@ -967,10 +963,6 @@ ErrorCode RFPCProcessCls::RFPCMainProcess_GPU_NoAntPattern(size_t startprfid, si
{ {
PRINT("dev ID:%d,start PRF ID: %d , PRF COUNT: %d \n", devId,startprfid,prfcount); PRINT("dev ID:%d,start PRF ID: %d , PRF COUNT: %d \n", devId,startprfid,prfcount);
/// 显存不限制 /// 显存不限制
cudaSetDevice(devId); // 确保当前线程操作指定的GPU设备 cudaSetDevice(devId); // 确保当前线程操作指定的GPU设备
POLARTYPEENUM polartype = this->TaskSetting->getPolarType(); POLARTYPEENUM polartype = this->TaskSetting->getPolarType();
@ -1144,22 +1136,26 @@ ErrorCode RFPCProcessCls::SaveBlockSimulationEchoArr(cuComplex* d_echoData,size_
for (size_t i = 0; i < prfcount; i++) { for (size_t i = 0; i < prfcount; i++) {
for (size_t j = 0; j < freqNum; j++) { for (size_t j = 0; j < freqNum; j++) {
//fileEchoArr.get()[i * freqNum + j] = std::complex<double>(1, 1);
std::complex<double> temp = fileEchoArr.get()[i * freqNum + j]; std::complex<double> temp = fileEchoArr.get()[i * freqNum + j];
fileEchoArr.get()[i * freqNum + j] = std::complex<double>( fileEchoArr.get()[i * freqNum + j] = std::complex<double>(
temp.real() + h_echoData[i * freqNum + j].x, temp.real() + h_echoData[i * freqNum + j].x,
temp.imag() + h_echoData[i * freqNum + j].y temp.imag() + h_echoData[i * freqNum + j].y
); );
} }
} }
qDebug() << "write echo :\t " << "prfcount:\t" << prfcount << " freqnum:\t" << freqNum;
testOutComplexDoubleArr(QString("testoutEcho.dat"),fileEchoArr.get(), prfcount_read, freqNum);
this->EchoSimulationData->saveEchoArr(fileEchoArr, startprfid, prfcount_read); this->EchoSimulationData->saveEchoArr(fileEchoArr, startprfid, prfcount_read);
omp_unset_lock(&lock); // 锟酵放伙拷斤拷 omp_unset_lock(&lock); // 锟酵放伙拷斤拷
omp_destroy_lock(&lock); // 劫伙拷斤拷 omp_destroy_lock(&lock); // 劫伙拷斤拷
FreeCUDAHost(h_echoData);
return ErrorCode::SUCCESS; return ErrorCode::SUCCESS;
} }

View File

@ -227,11 +227,12 @@ QVector<double> AbstractSARSatelliteModel::getFreqList()
void AbstractSARSatelliteModel::setRefphaseRange(double refRange) void AbstractSARSatelliteModel::setRefphaseRange(double refRange)
{ {
this->refRangePhase = refRange;
} }
double AbstractSARSatelliteModel::getRefphaseRange() double AbstractSARSatelliteModel::getRefphaseRange()
{ {
return 0.0; return this->refRangePhase;
} }
POLARTYPEENUM AbstractSARSatelliteModel::getPolarType() POLARTYPEENUM AbstractSARSatelliteModel::getPolarType()
@ -254,17 +255,17 @@ double AbstractSARSatelliteModel::getPRF()
double AbstractSARSatelliteModel::getFs() double AbstractSARSatelliteModel::getFs()
{ {
//double NearRange = this->getNearRange(); double NearRange = this->getNearRange();
//double FarRange = this->getFarRange(); double FarRange = this->getFarRange();
//QVector<double> freqpoints = this->getFreqList(); QVector<double> freqpoints = this->getFreqList();
//long freqNum = freqpoints.size(); long freqNum = freqpoints.size();
//double timeRange = 2 * (FarRange - NearRange) / LIGHTSPEED; double timeRange = 2 * (FarRange - NearRange) / LIGHTSPEED;
//double fs = freqNum / timeRange; double fs = (freqNum-1) / timeRange;
//return fs; return fs;
return 0.0; //return 0.0;
} }
void AbstractSARSatelliteModel::setFs(double fs) void AbstractSARSatelliteModel::setFs(double fs)

View File

@ -211,6 +211,7 @@ public:
virtual void setGri(double gri); virtual void setGri(double gri);
private: private:
double refRangePhase;
double DopplerParametersReferenceTime; double DopplerParametersReferenceTime;
std::vector<double> DopplerCentroidCoefficients; std::vector<double> DopplerCentroidCoefficients;
std::vector<double> DopplerRateValuesCoefficients; std::vector<double> DopplerRateValuesCoefficients;

View File

@ -143,15 +143,15 @@ double SARSimulationTaskSetting::getPRF()
return this->PRF; return this->PRF;
} }
void SARSimulationTaskSetting::setRefphaseRange(double refRange) //void SARSimulationTaskSetting::setRefphaseRange(double refRange)
{ //{
this->refPhaseRange = refRange; // this->refPhaseRange = refRange;
} //}
//
double SARSimulationTaskSetting::getRefphaseRange() //double SARSimulationTaskSetting::getRefphaseRange()
{ //{
return this->refPhaseRange; // return this->refPhaseRange;
} //}
double SARSimulationTaskSetting::getFs() double SARSimulationTaskSetting::getFs()
{ {

View File

@ -50,6 +50,7 @@ private:
double imageEndTime; double imageEndTime;
double NearRange; double NearRange;
double FarRange; double FarRange;
bool isR; bool isR;
@ -78,15 +79,15 @@ private:
public: // 设置PRF、FS public: // 设置PRF、FS
virtual void setPRF(double prf) override; // 方位向采样频率 virtual void setPRF(double prf) override; // 方位向采样频率
virtual double getPRF() override; virtual double getPRF() override;
virtual void setRefphaseRange(double refRange); //virtual void setRefphaseRange(double refRange) override;
virtual double getRefphaseRange(); //virtual double getRefphaseRange() override;
virtual double getFs() override; virtual double getFs() override;
virtual void setFs(double fs) override; virtual void setFs(double fs) override;
private: private:
double PRF; double PRF;
double Fs; double Fs;
double refPhaseRange; //double refPhaseRange;
double pt; double pt;
double Gri; double Gri;