修复查找表生成工具bug

pull/4/head
chenzenghui 2025-02-19 22:49:46 +08:00
parent b5263a1760
commit 2040d42ff8
6 changed files with 57 additions and 30 deletions

View File

@ -141,7 +141,7 @@
<ProjectReference Include="..\LAMPDataProcessEXE\LAMPDataProcessEXE.vcxproj">
<Project>{4e6e79a3-048c-4fb4-bbb0-43c518a3e6d4}</Project>
</ProjectReference>
<ProjectReference Include="..\LAMPSARProcessProgram\RasterProcessTool.vcxproj">
<ProjectReference Include="..\RasterProcessToolWidget\RasterProcessTool.vcxproj">
<Project>{7ef67daa-dbc0-4b7f-80e8-11b4d2cb7ec2}</Project>
</ProjectReference>
<ProjectReference Include="..\RasterMainWidgetGUI\RasterMainWidgetGUI.vcxproj">

View File

@ -16,10 +16,6 @@
#include "ToolBoxWidget.h"
namespace Ui {
class RasterMainWidget;
}

View File

@ -232,8 +232,9 @@ namespace LookTableSimualtionMainProcessSpace {
break;
}
// 处理分块
long GPUMemoryline = floor((Memory1MB * 2.0 / 8.0/3.0 / demimg.width*1000));//2GB
long GPUMemoryline = floor((Memory1MB * 2.0 / 8.0/3.0 / demimg.width*2000));//2GB
GPUMemoryline = GPUMemoryline < 1 ? 1 : GPUMemoryline;
// 内存预分配
@ -261,8 +262,10 @@ namespace LookTableSimualtionMainProcessSpace {
long colcount = 0;
double fact_lamda = 1 / lamda;
for (long rid = 0; rid < demimg.height; rid = rid + GPUMemoryline) {
rowcount = GPUMemoryline;
colcount = demimg.width;
qDebug() << "computer read file : " << rid << "~" << rowcount + rid << "\t:" << demimg.height;
std::shared_ptr<double> demX = readDataArr<double>(demimg, rid, 0, rowcount, colcount, 1,GDALREADARRCOPYMETHOD::MEMCPYMETHOD);// 行列数修改
std::shared_ptr<double> demY = readDataArr<double>(demimg, rid, 0, rowcount, colcount, 2,GDALREADARRCOPYMETHOD::MEMCPYMETHOD);
std::shared_ptr<double> demZ = readDataArr<double>(demimg, rid, 0, rowcount, colcount, 3,GDALREADARRCOPYMETHOD::MEMCPYMETHOD);
@ -279,7 +282,7 @@ namespace LookTableSimualtionMainProcessSpace {
HostToDevice(host_demY.get(), device_demY.get(), sizeof(double)* GPUMemoryline* demimg.width);
HostToDevice(host_demZ.get(), device_demZ.get(), sizeof(double)* GPUMemoryline* demimg.width);
qDebug() << "GPU computer start: " << rid << "~" << rowcount + rid << "\t:" << demimg.height;
RDProcess_dopplerGPU(
device_demX.get(), device_demY.get(), device_demZ.get(),
device_Rid.get(), device_Cid.get(),
@ -299,10 +302,11 @@ namespace LookTableSimualtionMainProcessSpace {
// GPU -> 内存
DeviceToHost(host_Rid.get(), device_Rid.get(), sizeof(float)* GPUMemoryline* demimg.width);
DeviceToHost(host_Cid.get(), device_Cid.get(), sizeof(float)* GPUMemoryline* demimg.width);
qDebug() << "GPU computer finished!!: " << rid << "~" << rowcount + rid << "\t:" << demimg.height;
// 数据存储
outLookTable.saveImage(host_Rid, rid, 0, rowcount, colcount,1);
outLookTable.saveImage(host_Cid, rid, 0, rowcount, colcount,2);
qDebug() << "GPU computer result write finished: " << rid << "~" << rowcount + rid << "\t:" << demimg.height;
}
qDebug() << "look table computed finished!!!";

View File

@ -8,6 +8,15 @@ QSimulationLookTableDialog::QSimulationLookTableDialog(QWidget *parent)
: QDialog(parent),ui(new Ui::QSimulationLookTableDialogClass)
{
ui->setupUi(this);
connect(ui->buttonBox, SIGNAL(accepted()), this, SLOT(onaccepted()));
connect(ui->buttonBox, SIGNAL(rejected()), this, SLOT(onrejected()));
connect(ui->pushButtonDEM, SIGNAL(clicked(bool)), this, SLOT(onpushButtonDEMClicked(bool)));
connect(ui->pushButtonOrbitModel, SIGNAL(clicked(bool)), this, SLOT(onpushButtonOrbitModelClicked(bool)));
connect(ui->pushButtonOutDir, SIGNAL(clicked(bool)), this, SLOT(onpushButtonOutDirClicked(bool)));
connect(ui->pushButtonSataSetting, SIGNAL(clicked(bool)), this, SLOT(onpushButtonSataSettingClicked(bool)));
}
QSimulationLookTableDialog::~QSimulationLookTableDialog()

View File

@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>763</width>
<height>400</height>
<height>387</height>
</rect>
</property>
<property name="windowTitle">
@ -35,6 +35,9 @@
<height>30</height>
</size>
</property>
<property name="text">
<string>D:\FZSimulation\LT1A\L20250210\LT1A_DEM_20250210_resampleXYZ.dat</string>
</property>
</widget>
</item>
<item row="5" column="1">
@ -46,7 +49,7 @@
</size>
</property>
<property name="text">
<string>D:/Programme/vs2022/RasterMergeTest/simulationData/demdataset/demxyz.bin</string>
<string>D:\FZSimulation\LT1A\L20250210\Looktable</string>
</property>
</widget>
</item>
@ -121,7 +124,7 @@
</size>
</property>
<property name="text">
<string>D:/Programme/vs2022/RasterMergeTest/simulationData/demdataset/demxyz.bin</string>
<string>D:\FZSimulation\LT1A\L20250210\LT1_Simulation_Setting.xml</string>
</property>
</widget>
</item>
@ -224,7 +227,7 @@
</size>
</property>
<property name="text">
<string>D:/Programme/vs2022/RasterMergeTest/simulationData/demdataset/demxyz.bin</string>
<string>D:\FZSimulation\LT1A\L20250210\LT1_Simulation_OrbitModel.xml</string>
</property>
</widget>
</item>
@ -311,7 +314,7 @@
</size>
</property>
<property name="text">
<string/>
<string>LT1A_20250210</string>
</property>
</widget>
</item>

View File

@ -497,16 +497,6 @@ void PolyfitSatelliteOribtModel::writeVector(QXmlStreamWriter& xmlWriter, const
}
void PolyfitSatelliteOribtModel::readVector(QXmlStreamReader& xmlReader, const QString& name, std::vector<double>& vec) {
if (xmlReader.name() == name) {
while (xmlReader.readNextStartElement()) {
if (xmlReader.name() == "Value") {
vec.push_back(xmlReader.readElementText().toDouble());
}
}
}
}
bool PolyfitSatelliteOribtModel::loadFromXml(const QString& filePath) {
QFile file(filePath);
@ -529,13 +519,24 @@ bool PolyfitSatelliteOribtModel::loadFromXml(const QString& filePath) {
Vxchisq = xmlReader.attributes().value("Vxchisq").toDouble();
Vychisq = xmlReader.attributes().value("Vychisq").toDouble();
Vzchisq = xmlReader.attributes().value("Vzchisq").toDouble();
readVector(xmlReader, "polyfitPx", polyfitPx);
readVector(xmlReader, "polyfitPy", polyfitPy);
readVector(xmlReader, "polyfitPz", polyfitPz);
readVector(xmlReader, "polyfitVx", polyfitVx);
readVector(xmlReader, "polyfitVy", polyfitVy);
readVector(xmlReader, "polyfitVz", polyfitVz);
}
else if (xmlReader.name() == "polyfitPx") {
this->readVector(xmlReader, QString("polyfitPx"), polyfitPx);
}
else if (xmlReader.name() == "polyfitPy") {
this->readVector(xmlReader, QString("polyfitPy"), polyfitPy);
}
else if (xmlReader.name() == "polyfitPz") {
this->readVector(xmlReader, QString("polyfitPz"), polyfitPz);
}
else if (xmlReader.name() == "polyfitVx") {
this->readVector(xmlReader, QString("polyfitVx"), polyfitVx);
}
else if (xmlReader.name() == "polyfitVy") {
this->readVector(xmlReader, QString("polyfitVy"), polyfitVy);
}
else if (xmlReader.name() == "polyfitVz") {
this->readVector(xmlReader, QString("polyfitVz"), polyfitVz);
}
}
}
@ -549,6 +550,20 @@ bool PolyfitSatelliteOribtModel::loadFromXml(const QString& filePath) {
return true;
}
void PolyfitSatelliteOribtModel::readVector(QXmlStreamReader& xmlReader, const QString& name, std::vector<double>& vec) {
if (xmlReader.name() == name) {
qDebug() << "read orbit model ,key " << name;
while (xmlReader.readNextStartElement()) {
if (xmlReader.name() == "Value") {
vec.push_back(xmlReader.readElementText().toDouble());
}
}
}
}
long double PolyfitSatelliteOribtModel::getOribtStartTime()
{
return oribtStartTime;