修补高分三号文件读写错误

pull/10/head
陈增辉 2025-04-18 03:30:28 +08:00
parent 9fd7bab1f3
commit d2ee22b0f1
15 changed files with 428 additions and 191 deletions

View File

@ -38,7 +38,10 @@
#include <xmmintrin.h> // 包含SSE指令集头文件 #include <xmmintrin.h> // 包含SSE指令集头文件
#include <emmintrin.h> // 包含SSE2指令集头文件 #include <emmintrin.h> // 包含SSE2指令集头文件
#include <omp.h> // 包含OpenMP头文件 #include <omp.h> // 包含OpenMP头文件
#include <iostream>
#include <string>
#include <boost/date_time/posix_time/posix_time.hpp>
#include <boost/date_time/posix_time/conversion.hpp>
QString longDoubleToQStringScientific(long double value) { QString longDoubleToQStringScientific(long double value) {
std::ostringstream stream; std::ostringstream stream;
@ -702,3 +705,71 @@ Eigen::MatrixXd BASECONSTVARIABLEAPI dB2Amp(Eigen::MatrixXd& sigma0)
} }
QDateTime parseCustomDateTime(const QString& dateTimeStr) {
// 手动解析日期时间字符串
int year = dateTimeStr.left(4).toInt();
int month = dateTimeStr.mid(5, 2).toInt();
int day = dateTimeStr.mid(8, 2).toInt();
int hour = dateTimeStr.mid(11, 2).toInt();
int minute = dateTimeStr.mid(14, 2).toInt();
int second = dateTimeStr.mid(17, 2).toInt();
int msec = dateTimeStr.mid(20, 6).toInt(); // 只取毫秒的前三位因为QDateTime支持到毫秒
// 创建 QDate 和 QTime 对象
QDate date(year, month, day);
QTime time(hour, minute, second, msec ); // 转换为微秒但QTime只支持毫秒精度
// 构造 QDateTime 对象
QDateTime result(date, time);
return result;
}
bool isLeapYear(int year) {
return (year % 4 == 0 && (year % 100 != 0 || year % 400 == 0));
}
int daysInMonth(int year, int month) {
if (month == 2) return isLeapYear(year) ? 29 : 28;
else if (month == 4 || month == 6 || month == 9 || month == 11) return 30;
else return 31;
}
TimestampMicroseconds parseAndConvert( std::string dateTimeStr) {
// 解析年、月、日、时、分、秒和微秒
int year = std::stoi(dateTimeStr.substr(0, 4));
int month = std::stoi(dateTimeStr.substr(5, 2));
int day = std::stoi(dateTimeStr.substr(8, 2));
int hour = std::stoi(dateTimeStr.substr(11, 2));
int minute = std::stoi(dateTimeStr.substr(14, 2));
int second = std::stoi(dateTimeStr.substr(17, 2));
int microsec = std::stoi(dateTimeStr.substr(20, 6));
// 计算从1970年至目标年份前一年的总天数
long long totalDays = 0;
for (int y = 1970; y < year; ++y) {
totalDays += isLeapYear(y) ? 366 : 365;
}
// 加上目标年份从1月到上一个月的天数
for (int m = 1; m < month; ++m) {
totalDays += daysInMonth(year, m);
}
// 加上本月的天数
totalDays += day - 1;
// 转换为总秒数,再加上小时、分钟、秒
long long totalSeconds = totalDays * 24 * 60 * 60 + hour * 60 * 60 + minute * 60 + second;
// 转换为毫秒和微秒
long long msecsSinceEpoch = totalSeconds * 1000 + microsec / 1000;
int microseconds = microsec % 1000;
return { msecsSinceEpoch, microseconds };
}

View File

@ -31,7 +31,8 @@
#include <QDebug> #include <QDebug>
#include <iomanip> #include <iomanip>
#include <sstream> #include <sstream>
#include <QDatetime>
#include <boost/cstdint.hpp>
///////////////////////////////////// 基础数学函数 ///////////////////////////////////////////////////////////// ///////////////////////////////////// 基础数学函数 /////////////////////////////////////////////////////////////
@ -101,7 +102,7 @@ Eigen::Matrix3d BASECONSTVARIABLEAPI rotationMatrix(const Eigen::Vector3d& axis
long double BASECONSTVARIABLEAPI convertToMilliseconds(const std::string& dateTimeStr); long double BASECONSTVARIABLEAPI convertToMilliseconds(const std::string& dateTimeStr);
QDateTime BASECONSTVARIABLEAPI parseCustomDateTime(const QString& dateTimeStr);
/// <summary> /// <summary>
/// list 应该是按照从小到大的顺序排好 /// list 应该是按照从小到大的顺序排好
/// </summary> /// </summary>
@ -132,6 +133,19 @@ void initializeMatrixWithSSE2(Eigen::MatrixXf& mat, const float* data, long rowc
Eigen::MatrixXd BASECONSTVARIABLEAPI MuhlemanSigmaArray(Eigen::MatrixXd& eta_deg); Eigen::MatrixXd BASECONSTVARIABLEAPI MuhlemanSigmaArray(Eigen::MatrixXd& eta_deg);
Eigen::MatrixXd BASECONSTVARIABLEAPI dB2Amp(Eigen::MatrixXd& sigma0); Eigen::MatrixXd BASECONSTVARIABLEAPI dB2Amp(Eigen::MatrixXd& sigma0);
struct TimestampMicroseconds {
boost::int64_t msecsSinceEpoch; // 自1970-01-01T00:00:00 UTC以来的毫秒数
int microseconds; // 额外的微秒(精确到微秒)
};
bool BASECONSTVARIABLEAPI isLeapYear(int year);
int BASECONSTVARIABLEAPI daysInMonth(int year, int month);
TimestampMicroseconds BASECONSTVARIABLEAPI parseAndConvert( std::string dateTimeStr);
/** 模板函数类 ***********************************************************************************************************/ /** 模板函数类 ***********************************************************************************************************/
inline double calculate_MuhlemanSigma(double eta_deg) { inline double calculate_MuhlemanSigma(double eta_deg) {

View File

@ -93,7 +93,8 @@ QString getFileNameFromPath(const QString& path)
QString getFileNameWidthoutExtend(QString path) QString getFileNameWidthoutExtend(QString path)
{ {
QFileInfo fileInfo(path); QFileInfo fileInfo(path);
QString fileNameWithoutExtension = fileInfo.baseName(); // 获取无后缀文件名 QString fileNameWithoutExtension = fileInfo.completeBaseName(); // 获取无后缀文件名
qDebug() << u8"File name without extension: " << fileNameWithoutExtension;
return fileNameWithoutExtension; return fileNameWithoutExtension;
} }

View File

@ -18,7 +18,9 @@
#include <fstream> #include <fstream>
#include <proj.h> #include <proj.h>
#include "GeoOperator.h" #include "GeoOperator.h"
#include <ogr_spatialref.h> // OGRSpatialReference 用于空间参考转换
#include <gdal_alg.h> // 用于 GDALWarp 操作
#include <ogr_spatialref.h>
Landpoint operator +(const Landpoint& p1, const Landpoint& p2) Landpoint operator +(const Landpoint& p1, const Landpoint& p2)
@ -446,3 +448,53 @@ double getlocalIncAngle(Vector3D& satepoint, Vector3D& landpoint, Vector3D& slop
return angle; return angle;
} }
} }
bool BASECONSTVARIABLEAPI ConvertResolutionToDegrees(int sourceEPSG, double resolutionMeters, double refLon, double refLat, double& degreePerPixelX, double& degreePerPixelY){
// 初始化源坐标系平面投影和目标坐标系WGS84 经纬度)
OGRSpatialReference sourceSRS, targetSRS;
sourceSRS.importFromEPSG(sourceEPSG); // 源坐标系需明确 EPSG
targetSRS.importFromEPSG(4326); // 目标为 WGS84 经纬度
// 创建坐标转换器:经纬度 -> 平面坐标
OGRCoordinateTransformation* toPlane = OGRCreateCoordinateTransformation(&targetSRS, &sourceSRS);
if (!toPlane) return false;
// 将参考点经纬度转换为平面坐标
double x = refLon, y = refLat;
if (!toPlane->Transform(1, &x, &y)) {
OGRCoordinateTransformation::DestroyCT(toPlane);
return false;
}
// 创建坐标转换器:平面坐标 -> 经纬度
OGRCoordinateTransformation* toGeo = OGRCreateCoordinateTransformation(&sourceSRS, &targetSRS);
if (!toGeo) {
OGRCoordinateTransformation::DestroyCT(toPlane);
return false;
}
// 计算东向分辨率(经度变化量)
double eastX = x + resolutionMeters, eastY = y;
double eastLon = eastX, eastLat = eastY;
if (!toGeo->Transform(1, &eastLon, &eastLat)) {
OGRCoordinateTransformation::DestroyCT(toPlane);
OGRCoordinateTransformation::DestroyCT(toGeo);
return false;
}
degreePerPixelX = (eastLon - refLon) / resolutionMeters; // 经度方向每米对应度数
// 计算北向分辨率(纬度变化量)
double northX = x, northY = y + resolutionMeters;
double northLon = northX, northLat = northY;
if (!toGeo->Transform(1, &northLon, &northLat)) {
OGRCoordinateTransformation::DestroyCT(toPlane);
OGRCoordinateTransformation::DestroyCT(toGeo);
return false;
}
degreePerPixelY = (northLat - refLat) / resolutionMeters; // 纬度方向每米对应度数
// 释放资源
OGRCoordinateTransformation::DestroyCT(toPlane);
OGRCoordinateTransformation::DestroyCT(toGeo);
return true;
}

View File

@ -124,4 +124,24 @@ CartesianCoordinates BASECONSTVARIABLEAPI sphericalToCartesian(const Spheric
double BASECONSTVARIABLEAPI getlocalIncAngle(Vector3D& satepoint, Vector3D& landpoint, Vector3D& slopeVector); double BASECONSTVARIABLEAPI getlocalIncAngle(Vector3D& satepoint, Vector3D& landpoint, Vector3D& slopeVector);
/**
* @brief
* @param sourceEPSG EPSG UTM Zone 50N 32650
* @param resolutionMeters
* @param refLon
* @param refLat
* @param[out] degreePerPixelX /
* @param[out] degreePerPixelY /
* @return
*/
bool BASECONSTVARIABLEAPI ConvertResolutionToDegrees(
int sourceEPSG,
double resolutionMeters,
double refLon,
double refLat,
double& degreePerPixelX,
double& degreePerPixelY
);
#endif #endif

View File

@ -89,7 +89,7 @@ enum GDALREADARRCOPYMETHOD {
/// \param long 经度 /// \param long 经度
/// \param lat 纬度 /// \param lat 纬度
/// \return 对应投影坐标系统的 EPSG编码,-1 表示计算错误 /// \return 对应投影坐标系统的 EPSG编码,-1 表示计算错误
long BASECONSTVARIABLEAPI getProjectEPSGCodeByLon_Lat(double long, double lat, ProjectStripDelta stripState); long BASECONSTVARIABLEAPI getProjectEPSGCodeByLon_Lat(double lon, double lat, ProjectStripDelta stripState= ProjectStripDelta::Strip_6);
long BASECONSTVARIABLEAPI getProjectEPSGCodeByLon_Lat_inStrip3(double lon, double lat); long BASECONSTVARIABLEAPI getProjectEPSGCodeByLon_Lat_inStrip3(double lon, double lat);

View File

@ -106,7 +106,7 @@ ErrorCode SARSimulationImageL1Dataset::OpenOrNew(QString folder, QString filenam
this->saveToXml(); this->saveToXml();
} }
if (this->Rasterlevel!=RasterL2||QFile(this->GPSPointFilePath).exists() == false) { if (this->Rasterlevel==RasterL2||QFile(this->GPSPointFilePath).exists() == false) {
// 创建新文件 // 创建新文件
omp_lock_t lock; omp_lock_t lock;
omp_init_lock(&lock); omp_init_lock(&lock);
@ -122,7 +122,7 @@ ErrorCode SARSimulationImageL1Dataset::OpenOrNew(QString folder, QString filenam
omp_destroy_lock(&lock); omp_destroy_lock(&lock);
} }
if (this->Rasterlevel == RasterLevel::RasterSLC || QFile(this->ImageRasterPath).exists() == false) { else if (this->Rasterlevel == RasterLevel::RasterSLC || QFile(this->ImageRasterPath).exists() == false) {
// 创建新文件 // 创建新文件
omp_lock_t lock; omp_lock_t lock;
@ -140,7 +140,7 @@ ErrorCode SARSimulationImageL1Dataset::OpenOrNew(QString folder, QString filenam
} }
if (this->Rasterlevel != RasterLevel::RasterSLC || QFile(this->ImageRasterPath).exists() == false) { else if (this->Rasterlevel == RasterLevel::RasterL1B || QFile(this->ImageRasterPath).exists() == false) {
// 创建新文件 // 创建新文件
omp_lock_t lock; omp_lock_t lock;
@ -150,11 +150,11 @@ ErrorCode SARSimulationImageL1Dataset::OpenOrNew(QString folder, QString filenam
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->ImageRasterPath.toUtf8().constData(), colCount, rowCount, 1, GDT_CFloat32, NULL)); std::shared_ptr<GDALDataset> poDstDS(poDriver->Create(this->GPSPointFilePath.toUtf8().constData(), 19, rowCount, 1, GDT_Float64, NULL));
GDALFlushCache((GDALDatasetH)poDstDS.get()); GDALFlushCache((GDALDatasetH)poDstDS.get());
poDstDS.reset(); poDstDS.reset();
omp_unset_lock(&lock); // omp_unset_lock(&lock);
omp_destroy_lock(&lock); // omp_destroy_lock(&lock);
} }
@ -203,7 +203,7 @@ ErrorCode SARSimulationImageL1Dataset::Open(QString xmlPath)
QFileInfo fileInfo(xmlPath); QFileInfo fileInfo(xmlPath);
QString fileName = fileInfo.fileName(); // 获取文件名 QString fileName = fileInfo.fileName(); // 获取文件名
QString fileSuffix = fileInfo.suffix(); // 获取后缀名 QString fileSuffix = fileInfo.suffix(); // 获取后缀名
QString fileNameWithoutSuffix = fileInfo.baseName(); // »ñÈ¡²»´øºó׺µÄÎļþÃû QString fileNameWithoutSuffix = fileInfo.completeBaseName(); // »ñÈ¡²»´øºó׺µÄÎļþÃû
QString directoryPath = fileInfo.path(); // 获取文件夹路径 QString directoryPath = fileInfo.path(); // 获取文件夹路径
if (fileSuffix.toLower() == "xml" || fileSuffix.toLower() == ".xml") { if (fileSuffix.toLower() == "xml" || fileSuffix.toLower() == ".xml") {
return this->Open(directoryPath, fileNameWithoutSuffix); return this->Open(directoryPath, fileNameWithoutSuffix);
@ -246,12 +246,12 @@ void SARSimulationImageL1Dataset::saveToXml()
xmlWriter.writeTextElement("RowCount", QString::number(this->rowCount)); xmlWriter.writeTextElement("RowCount", QString::number(this->rowCount));
xmlWriter.writeTextElement("ColCount", QString::number(this->colCount)); xmlWriter.writeTextElement("ColCount", QString::number(this->colCount));
xmlWriter.writeTextElement("Rnear", QString::number(this->Rnear)); xmlWriter.writeTextElement("Rnear", QString::number(this->Rnear, 'e', 18));
xmlWriter.writeTextElement("Rfar", QString::number(this->Rfar)); xmlWriter.writeTextElement("Rfar", QString::number(this->Rfar, 'e', 18));
xmlWriter.writeTextElement("Rref", QString::number(this->Rref)); xmlWriter.writeTextElement("Rref", QString::number(this->Rref, 'e', 18));
xmlWriter.writeTextElement("CenterFreq", QString::number(this->centerFreq)); xmlWriter.writeTextElement("CenterFreq", QString::number(this->centerFreq, 'e', 18));
xmlWriter.writeTextElement("Fs", QString::number(this->Fs)); xmlWriter.writeTextElement("Fs", QString::number(this->Fs, 'e', 18));
xmlWriter.writeTextElement("CenterAngle", QString::number(this->CenterAngle)); xmlWriter.writeTextElement("CenterAngle", QString::number(this->CenterAngle, 'e', 18));
xmlWriter.writeTextElement("LookSide", this->LookSide); xmlWriter.writeTextElement("LookSide", this->LookSide);
// 保存sateantpos // 保存sateantpos
@ -259,60 +259,60 @@ void SARSimulationImageL1Dataset::saveToXml()
for (long i = 0; i < this->sateposes.count(); i++) { for (long i = 0; i < this->sateposes.count(); i++) {
xmlWriter.writeStartElement("AntPosParam"); xmlWriter.writeStartElement("AntPosParam");
xmlWriter.writeTextElement("time", QString::number(this->sateposes[i].time)); // time xmlWriter.writeTextElement("time", QString::number(this->sateposes[i].time, 'e', 18)); // time
xmlWriter.writeTextElement("Px", QString::number(this->sateposes[i].Px)); // Px xmlWriter.writeTextElement("Px", QString::number(this->sateposes[i].Px, 'e', 18)); // Px
xmlWriter.writeTextElement("Py", QString::number(this->sateposes[i].Py)); // Py xmlWriter.writeTextElement("Py", QString::number(this->sateposes[i].Py, 'e', 18)); // Py
xmlWriter.writeTextElement("Pz", QString::number(this->sateposes[i].Pz)); // Pz xmlWriter.writeTextElement("Pz", QString::number(this->sateposes[i].Pz, 'e', 18)); // Pz
xmlWriter.writeTextElement("Vx", QString::number(this->sateposes[i].Vx)); // Vx xmlWriter.writeTextElement("Vx", QString::number(this->sateposes[i].Vx, 'e', 18)); // Vx
xmlWriter.writeTextElement("Vy", QString::number(this->sateposes[i].Vy)); // Vy xmlWriter.writeTextElement("Vy", QString::number(this->sateposes[i].Vy, 'e', 18)); // Vy
xmlWriter.writeTextElement("Vz", QString::number(this->sateposes[i].Vz)); // Vz xmlWriter.writeTextElement("Vz", QString::number(this->sateposes[i].Vz, 'e', 18)); // Vz
xmlWriter.writeTextElement("AntDirectX", QString::number(this->sateposes[i].AntDirectX)); // AntDirectX xmlWriter.writeTextElement("AntDirectX", QString::number(this->sateposes[i].AntDirectX, 'e', 18)); // AntDirectX
xmlWriter.writeTextElement("AntDirectY", QString::number(this->sateposes[i].AntDirectY)); // AntDirectY xmlWriter.writeTextElement("AntDirectY", QString::number(this->sateposes[i].AntDirectY, 'e', 18)); // AntDirectY
xmlWriter.writeTextElement("AntDirectZ", QString::number(this->sateposes[i].AntDirectZ)); // AntDirectZ xmlWriter.writeTextElement("AntDirectZ", QString::number(this->sateposes[i].AntDirectZ, 'e', 18)); // AntDirectZ
xmlWriter.writeTextElement("AVx", QString::number(this->sateposes[i].AVx)); // AVx xmlWriter.writeTextElement("AVx", QString::number(this->sateposes[i].AVx, 'e', 18)); // AVx
xmlWriter.writeTextElement("AVy", QString::number(this->sateposes[i].AVy)); // AVy xmlWriter.writeTextElement("AVy", QString::number(this->sateposes[i].AVy, 'e', 18)); // AVy
xmlWriter.writeTextElement("AVz", QString::number(this->sateposes[i].AVz)); // AVz xmlWriter.writeTextElement("AVz", QString::number(this->sateposes[i].AVz, 'e', 18)); // AVz
xmlWriter.writeTextElement("lon", QString::number(this->sateposes[i].lon)); // lon xmlWriter.writeTextElement("lon", QString::number(this->sateposes[i].lon, 'e', 18)); // lon
xmlWriter.writeTextElement("lat", QString::number(this->sateposes[i].lat)); // lat xmlWriter.writeTextElement("lat", QString::number(this->sateposes[i].lat, 'e', 18)); // lat
xmlWriter.writeTextElement("ati", QString::number(this->sateposes[i].ati)); // ati xmlWriter.writeTextElement("ati", QString::number(this->sateposes[i].ati, 'e', 18)); // ati
xmlWriter.writeEndElement(); // 结束 <AntPosParam> xmlWriter.writeEndElement(); // 结束 <AntPosParam>
} }
xmlWriter.writeTextElement("ImageStartTime", QString::number(this->startImageTime)); xmlWriter.writeTextElement("ImageStartTime", QString::number(this->startImageTime, 'e', 18));
xmlWriter.writeTextElement("ImageEndTime", QString::number(this->EndImageTime)); xmlWriter.writeTextElement("ImageEndTime", QString::number(this->EndImageTime, 'e', 18));
xmlWriter.writeTextElement("incidenceAngleNearRange", QString::number(this->incidenceAngleNearRange)); xmlWriter.writeTextElement("incidenceAngleNearRange", QString::number(this->incidenceAngleNearRange, 'e', 18));
xmlWriter.writeTextElement("incidenceAngleFarRange", QString::number(this->incidenceAngleFarRange)); xmlWriter.writeTextElement("incidenceAngleFarRange", QString::number(this->incidenceAngleFarRange, 'e', 18));
xmlWriter.writeTextElement("TotalProcessedAzimuthBandWidth", QString::number(this->TotalProcessedAzimuthBandWidth)); xmlWriter.writeTextElement("TotalProcessedAzimuthBandWidth", QString::number(this->TotalProcessedAzimuthBandWidth, 'e', 18));
xmlWriter.writeTextElement("DopplerParametersReferenceTime", QString::number(this->DopplerParametersReferenceTime)); xmlWriter.writeTextElement("DopplerParametersReferenceTime", QString::number(this->DopplerParametersReferenceTime, 'e', 18));
xmlWriter.writeStartElement("DopplerCentroidCoefficients"); xmlWriter.writeStartElement("DopplerCentroidCoefficients");
xmlWriter.writeTextElement("d0", QString::number(this->d0)); xmlWriter.writeTextElement("d0", QString::number(this->d0, 'e', 18));
xmlWriter.writeTextElement("d1", QString::number(this->d1)); xmlWriter.writeTextElement("d1", QString::number(this->d1, 'e', 18));
xmlWriter.writeTextElement("d2", QString::number(this->d2)); xmlWriter.writeTextElement("d2", QString::number(this->d2, 'e', 18));
xmlWriter.writeTextElement("d3", QString::number(this->d3)); xmlWriter.writeTextElement("d3", QString::number(this->d3, 'e', 18));
xmlWriter.writeTextElement("d4", QString::number(this->d4)); xmlWriter.writeTextElement("d4", QString::number(this->d4, 'e', 18));
xmlWriter.writeEndElement(); // DopplerCentroidCoefficients xmlWriter.writeEndElement(); // DopplerCentroidCoefficients
xmlWriter.writeStartElement("DopplerRateValuesCoefficients"); xmlWriter.writeStartElement("DopplerRateValuesCoefficients");
xmlWriter.writeTextElement("r0", QString::number(this->r0)); xmlWriter.writeTextElement("r0", QString::number(this->r0, 'e', 18));
xmlWriter.writeTextElement("r1", QString::number(this->r1)); xmlWriter.writeTextElement("r1", QString::number(this->r1, 'e', 18));
xmlWriter.writeTextElement("r2", QString::number(this->r2)); xmlWriter.writeTextElement("r2", QString::number(this->r2, 'e', 18));
xmlWriter.writeTextElement("r3", QString::number(this->r3)); xmlWriter.writeTextElement("r3", QString::number(this->r3, 'e', 18));
xmlWriter.writeTextElement("r4", QString::number(this->r4)); xmlWriter.writeTextElement("r4", QString::number(this->r4, 'e', 18));
xmlWriter.writeEndElement(); // DopplerRateValuesCoefficients xmlWriter.writeEndElement(); // DopplerRateValuesCoefficients
xmlWriter.writeTextElement("latitude_center", QString::number(this->latitude_center)); xmlWriter.writeTextElement("latitude_center", QString::number(this->latitude_center, 'e', 18));
xmlWriter.writeTextElement("longitude_center", QString::number(this->longitude_center)); xmlWriter.writeTextElement("longitude_center", QString::number(this->longitude_center, 'e', 18));
xmlWriter.writeTextElement("latitude_topLeft", QString::number(this->latitude_topLeft)); xmlWriter.writeTextElement("latitude_topLeft", QString::number(this->latitude_topLeft, 'e', 18));
xmlWriter.writeTextElement("longitude_topLeft", QString::number(this->longitude_topLeft)); xmlWriter.writeTextElement("longitude_topLeft", QString::number(this->longitude_topLeft, 'e', 18));
xmlWriter.writeTextElement("latitude_topRight", QString::number(this->latitude_topRight)); xmlWriter.writeTextElement("latitude_topRight", QString::number(this->latitude_topRight, 'e', 18));
xmlWriter.writeTextElement("longitude_topRight", QString::number(this->longitude_topRight)); xmlWriter.writeTextElement("longitude_topRight", QString::number(this->longitude_topRight, 'e', 18));
xmlWriter.writeTextElement("latitude_bottomLeft", QString::number(this->latitude_bottomLeft)); xmlWriter.writeTextElement("latitude_bottomLeft", QString::number(this->latitude_bottomLeft, 'e', 18));
xmlWriter.writeTextElement("longitude_bottomLeft", QString::number(this->longitude_bottomLeft)); xmlWriter.writeTextElement("longitude_bottomLeft", QString::number(this->longitude_bottomLeft, 'e', 18));
xmlWriter.writeTextElement("latitude_bottomRight", QString::number(this->latitude_bottomRight)); xmlWriter.writeTextElement("latitude_bottomRight", QString::number(this->latitude_bottomRight, 'e', 18));
xmlWriter.writeTextElement("longitude_bottomRight", QString::number(this->longitude_bottomRight)); xmlWriter.writeTextElement("longitude_bottomRight", QString::number(this->longitude_bottomRight, 'e', 18));
xmlWriter.writeEndElement(); // Parameters xmlWriter.writeEndElement(); // Parameters
xmlWriter.writeEndDocument(); xmlWriter.writeEndDocument();

View File

@ -1401,6 +1401,15 @@ gdalImage CreategdalImage(const QString& img_path, int height, int width, int ba
GDALDataset* poDstDS = poDriver->Create(img_path.toUtf8().constData(), width, height, band_num, GDALDataset* poDstDS = poDriver->Create(img_path.toUtf8().constData(), width, height, band_num,
datetype, NULL); // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> datetype, NULL); // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
if (NULL == poDstDS)
{
qDebug() << "Create image failed!";
throw "Create image failed!";
exit(1);
}
if (need_gt) { if (need_gt) {
if (!projection.isEmpty()) { if (!projection.isEmpty()) {
poDstDS->SetProjection(projection.toUtf8().constData()); poDstDS->SetProjection(projection.toUtf8().constData());

View File

@ -209,6 +209,7 @@ int ENVI2TIFF(QString in_envi_path, QString out_tiff_path)
void ConvertCoordinateSystem(QString inRasterPath, QString outRasterPath, long outepsgcode) { void ConvertCoordinateSystem(QString inRasterPath, QString outRasterPath, long outepsgcode) {
// 注册所有GDAL驱动 // 注册所有GDAL驱动
GDALAllRegister(); GDALAllRegister();
CPLSetConfigOption("GDAL_FILENAME_IS_UTF8", "YES");
// 打开输入栅格文件 // 打开输入栅格文件
GDALDataset* srcDataset = (GDALDataset*)GDALOpen(inRasterPath.toUtf8().constData(), GA_ReadOnly); GDALDataset* srcDataset = (GDALDataset*)GDALOpen(inRasterPath.toUtf8().constData(), GA_ReadOnly);
@ -294,7 +295,7 @@ void ConvertCoordinateSystem(QString inRasterPath, QString outRasterPath, long o
void ResampleByReferenceRasterB(QString pszSrcFile, QString RefrasterBPath, QString pszOutFile, GDALResampleAlg eResample) { void ResampleByReferenceRasterB(QString pszSrcFile, QString RefrasterBPath, QString pszOutFile, GDALResampleAlg eResample) {
GDALAllRegister(); GDALAllRegister();
CPLSetConfigOption("GDAL_FILENAME_IS_UTF8", "YES"); CPLSetConfigOption("GDAL_FILENAME_IS_UTF8", "YES");
CPLSetConfigOption("GDAL_FILENAME_IS_UTF8", "NO");
GDALDataset* pDSrc = (GDALDataset*)GDALOpen(pszSrcFile.toLocal8Bit().constData(), GA_ReadOnly); GDALDataset* pDSrc = (GDALDataset*)GDALOpen(pszSrcFile.toLocal8Bit().constData(), GA_ReadOnly);
if (pDSrc == NULL) { if (pDSrc == NULL) {
qDebug() << u8"do not open In Raster file: " << pszSrcFile; qDebug() << u8"do not open In Raster file: " << pszSrcFile;
@ -565,6 +566,7 @@ void ResampleByReferenceRasterB(QString InrasterAPath, QString RefrasterBPath, Q
void cropRasterByLatLon(const char* inputFile, const char* outputFile, double minLon, double maxLon, double minLat, double maxLat) { void cropRasterByLatLon(const char* inputFile, const char* outputFile, double minLon, double maxLon, double minLat, double maxLat) {
// 初始化 GDAL 库 // 初始化 GDAL 库
GDALAllRegister(); GDALAllRegister();
CPLSetConfigOption("GDAL_FILENAME_IS_UTF8", "YES");
// 打开栅格数据集 // 打开栅格数据集
GDALDataset* poDataset = (GDALDataset*)GDALOpen(inputFile, GA_ReadOnly); GDALDataset* poDataset = (GDALDataset*)GDALOpen(inputFile, GA_ReadOnly);
@ -762,7 +764,7 @@ void resampleRaster(const char* inputRaster, const char* outputRaster, double ta
// 计算目标栅格的尺寸 // 计算目标栅格的尺寸
double targetXSize = (adfGeoTransform[1] * nXSize) / targetPixelSizeX; double targetXSize = (adfGeoTransform[1] * nXSize) / targetPixelSizeX;
double targetYSize = (adfGeoTransform[5] * nYSize) / targetPixelSizeY; double targetYSize = std::abs((adfGeoTransform[5] * nYSize) / targetPixelSizeY);
// 创建目标数据集(输出栅格) // 创建目标数据集(输出栅格)
GDALDriver* poDriver = GetGDALDriverManager()->GetDriverByName("GTiff"); GDALDriver* poDriver = GetGDALDriverManager()->GetDriverByName("GTiff");
@ -967,14 +969,16 @@ long GetEPSGFromRasterFile(QString filepath)
long getProjectEPSGCodeByLon_Lat(double long, double lat, ProjectStripDelta stripState) long getProjectEPSGCodeByLon_Lat(double lon, double lat, ProjectStripDelta stripState)
{ {
long EPSGCode = 0; long EPSGCode = 0;
switch (stripState) { switch (stripState) {
case ProjectStripDelta::Strip_3: { case ProjectStripDelta::Strip_3: {
EPSGCode = getProjectEPSGCodeByLon_Lat_inStrip3(lon, lat);
break; break;
}; };
case ProjectStripDelta::Strip_6: { case ProjectStripDelta::Strip_6: {
EPSGCode = getProjectEPSGCodeByLon_Lat_inStrip6(lon, lat);
break; break;
} }
default: { default: {

View File

@ -26,7 +26,7 @@ ErrorCode GF3CalibrationRaster(QString inRasterPath, QString outRasterPath, doub
double quayCoff = Qualifyvalue * 1.0 / 32767; double quayCoff = Qualifyvalue * 1.0 / 32767;
double caliCoff = std::pow(10.0, (calibrationConst * 1.0 / 20)); double caliCoff = std::pow(10.0, (calibrationConst * 1.0 / 20));
qDebug() << "定标系数:\t" << quayCoff / caliCoff; qDebug() << u8"定标系数:\t" << quayCoff / caliCoff;
long startrow = 0; long startrow = 0;
for (startrow = 0; startrow < imgraster.height; startrow = startrow + blocklines) { for (startrow = 0; startrow < imgraster.height; startrow = startrow + blocklines) {
@ -37,7 +37,7 @@ ErrorCode GF3CalibrationRaster(QString inRasterPath, QString outRasterPath, doub
imgArr.imag() = imgArrb2.array() * quayCoff / caliCoff; imgArr.imag() = imgArrb2.array() * quayCoff / caliCoff;
outraster.saveImage(imgArr, startrow, 0, 1); outraster.saveImage(imgArr, startrow, 0, 1);
} }
qDebug() << "影像写入到:" << outRasterPath; qDebug() << u8"影像写入到:" << outRasterPath;
return ErrorCode::SUCCESS; return ErrorCode::SUCCESS;
} }
@ -80,29 +80,29 @@ ErrorCode ImportGF3L1ARasterToWorkspace(QString inMetaxmlPath, QString inRasterP
QString outRasterpath = l1dataset.getImageRasterPath(); QString outRasterpath = l1dataset.getImageRasterPath();
ErrorCode errorcode = ErrorCode::SUCCESS; ErrorCode errorcode = ErrorCode::SUCCESS;
qDebug() << "导入数据:\t" << inRasterPath; qDebug() << u8"导入数据:\t" << inRasterPath;
switch (polsartype) switch (polsartype)
{ {
case POLARHH: case POLARHH:
qDebug() << "极化HH"; qDebug() << u8"极化HH";
errorcode = GF3CalibrationRaster(inRasterPath, outRasterpath, gf3xml.HH_QualifyValue, gf3xml.HH_CalibrationConst); errorcode = GF3CalibrationRaster(inRasterPath, outRasterpath, gf3xml.HH_QualifyValue, gf3xml.HH_CalibrationConst);
break; break;
case POLARHV: case POLARHV:
qDebug() << "极化HH"; qDebug() << u8"极化HH";
errorcode = GF3CalibrationRaster(inRasterPath, outRasterpath, gf3xml.HV_QualifyValue, gf3xml.HV_CalibrationConst); errorcode = GF3CalibrationRaster(inRasterPath, outRasterpath, gf3xml.HV_QualifyValue, gf3xml.HV_CalibrationConst);
break; break;
case POLARVH: case POLARVH:
qDebug() << "极化VH"; qDebug() << u8"极化VH";
errorcode = GF3CalibrationRaster(inRasterPath, outRasterpath, gf3xml.VH_QualifyValue, gf3xml.VH_CalibrationConst); errorcode = GF3CalibrationRaster(inRasterPath, outRasterpath, gf3xml.VH_QualifyValue, gf3xml.VH_CalibrationConst);
break; break;
case POLARVV: case POLARVV:
qDebug() << "极化VV"; qDebug() << u8"极化VV";
errorcode = GF3CalibrationRaster(inRasterPath, outRasterpath, gf3xml.VV_QualifyValue, gf3xml.VV_CalibrationConst); errorcode = GF3CalibrationRaster(inRasterPath, outRasterpath, gf3xml.VV_QualifyValue, gf3xml.VV_CalibrationConst);
break; break;
default: default:
break; break;
} }
qDebug() << "导入数据状态:\t" << QString::fromStdString(errorCode2errInfo(errorcode)); qDebug() << u8"导入数据状态:\t" << QString::fromStdString(errorCode2errInfo(errorcode));
return errorcode; return errorcode;
} }
@ -115,7 +115,7 @@ QVector<QString> SearchGF3DataTiff(QString inMetaxmlPath)
// 获取路径所在的目录 // 获取路径所在的目录
QDir directory(absPath); QDir directory(absPath);
if (!directory.exists()) { if (!directory.exists()) {
qDebug() << "Directory does not exist:" << directory.absolutePath(); qDebug() << u8"Directory does not exist:" << directory.absolutePath();
return QVector<QString>(0); return QVector<QString>(0);
} }
@ -124,7 +124,7 @@ QVector<QString> SearchGF3DataTiff(QString inMetaxmlPath)
filters << "*.tif" << "*.TIF" << "*.tiff" << "*.TIFF"; filters << "*.tif" << "*.TIF" << "*.tiff" << "*.TIFF";
QStringList files = directory.entryList(filters, QDir::Files); QStringList files = directory.entryList(filters, QDir::Files);
qDebug() << "TIFF Files in the directory" << directory.absolutePath() << ":"; qDebug() << u8"TIFF Files in the directory" << directory.absolutePath() << ":";
QVector<QString> filepath(0); QVector<QString> filepath(0);
for (long i = 0; i < files.count(); i++) { for (long i = 0; i < files.count(); i++) {
@ -144,7 +144,7 @@ POLARTYPEENUM getDatasetGF3FilePolsarType(QString fileName)
if (match.hasMatch()) { if (match.hasMatch()) {
polarization = match.captured(1); polarization = match.captured(1);
polarization = polarization.toLower().replace("_", ""); polarization = polarization.toLower().replace("_", "");
qDebug() << "Polarization extracted:" << polarization; qDebug() << u8"Polarization extracted:" << polarization;
if (polarization == "hh") { if (polarization == "hh") {
return POLARTYPEENUM::POLARHH; return POLARTYPEENUM::POLARHH;
} }
@ -162,7 +162,7 @@ POLARTYPEENUM getDatasetGF3FilePolsarType(QString fileName)
} }
} }
else { else {
qDebug() << "No polarization found in the path."; qDebug() << u8"No polarization found in the path.";
return POLARTYPEENUM::POLARUNKOWN; return POLARTYPEENUM::POLARUNKOWN;
} }
@ -199,7 +199,7 @@ ErrorCode ImportGF3L1AProcess(QString inMetaxmlPath, QString outWorkDirPath)
break; break;
} }
if (errorcode == ErrorCode::SUCCESS) { if (errorcode == ErrorCode::SUCCESS) {
return errorcode; continue;
} }
else { else {
QMessageBox::warning(nullptr, u8"错误", u8"数据导入错误"); QMessageBox::warning(nullptr, u8"错误", u8"数据导入错误");
@ -305,18 +305,18 @@ ErrorCode GF3RDCreateLookTable(QString inxmlPath, QString indemPath, QString out
polyfitmodel.polyFit(3, false); polyfitmodel.polyFit(3, false);
qDebug() << "-----------------------------------"; qDebug() << "-----------------------------------";
qDebug() << "satellite polyfit model params:\n"; qDebug() << u8"satellite polyfit model params:\n";
qDebug() << polyfitmodel.getSatelliteOribtModelParamsString(); qDebug() << polyfitmodel.getSatelliteOribtModelParamsString();
qDebug() << "-----------------------------------"; qDebug() << "-----------------------------------";
// 开始计算查找表 // 开始计算查找表
//1.计算分块 //1.计算分块
long cpucore_num = std::thread::hardware_concurrency(); long cpucore_num = std::thread::hardware_concurrency();
long blockline = Memory1MB * 500 / 8 / cpucore_num / 4 / l1dataset.getcolCount(); long blocklineinit = Memory1MB / 8 / cpucore_num / 4 / l1dataset.getcolCount() * 4000;
blockline = blockline < 50 ? 50 : blockline; blocklineinit = blocklineinit < 50 ? 50 : blocklineinit;
//2.迭代计算 //2.迭代计算
long colcount = l1dataset.getcolCount(); long colcount = rasterRC.width;//l1dataset.getcolCount();
long rowcount = l1dataset.getrowCount(); long rowcount = rasterRC.height;//l1dataset.getrowCount();
long startRId = 0; long startRId = 0;
long processNumber = 0; long processNumber = 0;
@ -334,7 +334,11 @@ ErrorCode GF3RDCreateLookTable(QString inxmlPath, QString indemPath, QString out
#pragma omp parallel for num_threads(cpucore_num-1) #pragma omp parallel for num_threads(cpucore_num-1)
for (startRId = 0; startRId < rowcount; startRId = startRId + blockline) { for (startRId = 0; startRId < rowcount; startRId = startRId + blocklineinit) {
long blockline = blocklineinit;
if (startRId + blockline > rowcount) {
blockline = rowcount - startRId;
}
Eigen::MatrixXd sar_r = rasterRC.getData(startRId, 0, blockline, colcount, 1); Eigen::MatrixXd sar_r = rasterRC.getData(startRId, 0, blockline, colcount, 1);
Eigen::MatrixXd sar_c = rasterRC.getData(startRId, 0, blockline, colcount, 2); Eigen::MatrixXd sar_c = rasterRC.getData(startRId, 0, blockline, colcount, 2);
Eigen::MatrixXd dem_x = demxyz.getData(startRId, 0, blockline, colcount, 1); Eigen::MatrixXd dem_x = demxyz.getData(startRId, 0, blockline, colcount, 1);
@ -409,7 +413,7 @@ ErrorCode GF3RDCreateLookTable(QString inxmlPath, QString indemPath, QString out
} }
else {} else {}
processNumber = processNumber + blockrows; processNumber = processNumber + blockrows;
qDebug() << "\rprocess bar:\t" << processNumber * 100.0 / rowcount << " % " << "\t\t\t"; qDebug() << u8"\rprocess bar:\t" << processNumber * 100.0 / rowcount << " % " << "\t\t\t";
if (progressDialog.maximum() <= processNumber) { if (progressDialog.maximum() <= processNumber) {
processNumber = progressDialog.maximum() - 1; processNumber = progressDialog.maximum() - 1;
} }
@ -430,7 +434,7 @@ ErrorCode GF3OrthSLC( QString inRasterPath, QString inlooktablePath, QString out
gdalImage outRaster(outRasterPath);// gdalImage outRaster(outRasterPath);//
if (outRaster.height != looktableRaster.height || outRaster.width != looktableRaster.width) { if (outRaster.height != looktableRaster.height || outRaster.width != looktableRaster.width) {
qDebug() << "look table size is not same as outRaster size"<< looktableRaster.height <<"!="<<outRaster.height<<" "<<looktableRaster.width<<"!="<<outRaster.width; qDebug() << u8"look table size is not same as outRaster size"<< looktableRaster.height <<"!="<<outRaster.height<<" "<<looktableRaster.width<<"!="<<outRaster.width;
return ErrorCode::FAIL; return ErrorCode::FAIL;
} }
@ -501,6 +505,35 @@ ErrorCode GF3RDProcess(QString inxmlPath, QString indemPath, QString outworkdir,
double minlon = box.min_lon - dlon; double minlon = box.min_lon - dlon;
double maxlat = box.max_lat + dlat; double maxlat = box.max_lat + dlat;
double maxlon = box.max_lon + dlon; double maxlon = box.max_lon + dlon;
qDebug() << u8"影像范围:";
qDebug() << u8"Bounding Box:";
qDebug() << u8"Latitude:" << minlat <<" - "<< maxlat;
qDebug() << u8"Longitude:" << minlon <<" - "<< maxlon;
double centerlat = (minlat + maxlat) / 2;
double centerlon = (minlon + maxlon) / 2;
long sourceespgcode = getProjectEPSGCodeByLon_Lat(centerlon, centerlat);
long demespgcode = GetEPSGFromRasterFile(indemPath);
double grid_resolution = gridx < gridy ? gridx : gridy;
double degreePerPixelX = grid_resolution / 110000.0;
double degreePerPixelY = grid_resolution / 110000.0;
bool meter2degreeflag = ConvertResolutionToDegrees(
sourceespgcode,
grid_resolution,
centerlon,
centerlat,
degreePerPixelX,
degreePerPixelY
);
if (!meter2degreeflag) {
qDebug() << u8"转换分辨率为经纬度失败";
degreePerPixelX = grid_resolution / 110000.0;
degreePerPixelY = grid_resolution / 110000.0;
}
qDebug() << u8"DEM影像范围:";
qDebug() << u8"输入分辨率:"<<gridx<<" \t" << gridy;
qDebug() << u8"影像分辨率:\t" << grid_resolution;
qDebug() << u8"分辨率转换为经纬度:\t" << degreePerPixelX << "\t" << degreePerPixelY;
// 计算DEM的分辨率
// 裁剪DEM // 裁剪DEM
QString filename = getFileNameWidthoutExtend(l1dataset.getxmlFilePath()); QString filename = getFileNameWidthoutExtend(l1dataset.getxmlFilePath());
@ -508,7 +541,7 @@ ErrorCode GF3RDProcess(QString inxmlPath, QString indemPath, QString outworkdir,
QString clipDEMPath = JoinPath(outworkdir, getFileNameWidthoutExtend(indemPath) + filename + "_clip.tif"); QString clipDEMPath = JoinPath(outworkdir, getFileNameWidthoutExtend(indemPath) + filename + "_clip.tif");
cropRasterByLatLon(indemPath.toUtf8().constData(), clipDEMPath.toUtf8().constData(), minlon, maxlon, minlat, maxlat); cropRasterByLatLon(indemPath.toUtf8().constData(), clipDEMPath.toUtf8().constData(), minlon, maxlon, minlat, maxlat);
QString resampleDEMPath = JoinPath(outworkdir, getFileNameWidthoutExtend(indemPath) + filename + "_clip_resample.tif"); QString resampleDEMPath = JoinPath(outworkdir, getFileNameWidthoutExtend(indemPath) + filename + "_clip_resample.tif");
resampleRaster(clipDEMPath.toUtf8().constData(), resampleDEMPath.toUtf8().constData(), gridx, gridy); resampleRaster(clipDEMPath.toUtf8().constData(), resampleDEMPath.toUtf8().constData(), degreePerPixelX, degreePerPixelY);
QString outlooktablePath = JoinPath(outworkdir, getFileNameWidthoutExtend(l1dataset.getxmlFilePath()) + "_looktable.tif"); QString outlooktablePath = JoinPath(outworkdir, getFileNameWidthoutExtend(l1dataset.getxmlFilePath()) + "_looktable.tif");
@ -516,7 +549,7 @@ ErrorCode GF3RDProcess(QString inxmlPath, QString indemPath, QString outworkdir,
QString outOrthPath=JoinPath(outworkdir, getFileNameWidthoutExtend(l1dataset.getxmlFilePath()) + "_orth.tif"); QString outOrthPath=JoinPath(outworkdir, getFileNameWidthoutExtend(l1dataset.getxmlFilePath()) + "_orth.tif");
if (GF3RDCreateLookTable(inxmlPath, resampleDEMPath, outworkdir, outlooktablePath, outlocalAnglePath,true) != ErrorCode::SUCCESS) { if (GF3RDCreateLookTable(inxmlPath, resampleDEMPath, outworkdir, outlooktablePath, outlocalAnglePath,true) != ErrorCode::SUCCESS) {
qDebug() << "查找表生成错误:\t" + getFileNameWidthoutExtend(inxmlPath); qDebug() << u8"查找表生成错误:\t" + getFileNameWidthoutExtend(inxmlPath);
return ErrorCode::FAIL; return ErrorCode::FAIL;
} }
return ErrorCode::SUCCESS; return ErrorCode::SUCCESS;

View File

@ -66,7 +66,7 @@ QString GF3PolyfitSatelliteOribtModel::getSatelliteOribtModelParamsString()
result += QString::number(this->polyfitVz[i], 'e', 6) + "\n"; result += QString::number(this->polyfitVz[i], 'e', 6) + "\n";
} }
result += "------------------------------------------------------\n"; result += "------------------------------------------------------\n";
printf("%s\n", result.toUtf8().constData());
return result; return result;
} }

View File

@ -16,7 +16,8 @@ QComplex2AmpPhase::QComplex2AmpPhase(QWidget *parent)
QObject::connect(ui.radioButtonAmp,SIGNAL(toggled(bool)),this,SLOT(radioButtonAmptoggled(bool))); QObject::connect(ui.radioButtonAmp,SIGNAL(toggled(bool)),this,SLOT(radioButtonAmptoggled(bool)));
QObject::connect(ui.radioButtonPhase, SIGNAL(toggled(bool)), this, SLOT(radioButtonPhasetoggled(bool))); QObject::connect(ui.radioButtonPhase, SIGNAL(toggled(bool)), this, SLOT(radioButtonPhasetoggled(bool)));
QObject::connect(ui.radioButtonSigma0, SIGNAL(toggled(bool)), this, SLOT(radioButtonSigma0toggled(bool))); QObject::connect(ui.radioButtonSigma0, SIGNAL(toggled(bool)), this, SLOT(radioButtonSigma0toggled(bool)));
QObject::connect(ui.buttonBox, SIGNAL(accept()), this, SLOT(onaccept())); QObject::connect(ui.pushButtonWorkSpace, SIGNAL(clicked(bool)), this, SLOT(onpushButtonWorkSpaceClicked(bool)));
QObject::connect(ui.buttonBox, SIGNAL(accepted()), this, SLOT(onaccept()));
QObject::connect(ui.buttonBox, SIGNAL(rejected()), this, SLOT(onreject())); QObject::connect(ui.buttonBox, SIGNAL(rejected()), this, SLOT(onreject()));
//toggled(bool ) //toggled(bool )
} }
@ -47,19 +48,19 @@ void QComplex2AmpPhase::onaccept()
slcl1.Open(folderpath, filename); slcl1.Open(folderpath, filename);
QString l2bfilename = filename + ui.lineEditHZ->text(); QString l2bfilename = filename + ui.lineEditHZ->text();
SARSimulationImageL1Dataset l1B(RasterLevel::RasterL1B); SARSimulationImageL1Dataset l1B(RasterLevel::RasterL1B);
slcl1.OpenOrNew(outworkdir, l2bfilename,slcl1.getrowCount(),slcl1.getcolCount()); l1B.OpenOrNew(outworkdir, l2bfilename,slcl1.getrowCount(),slcl1.getcolCount());
QString srcxmlpath = slcl1.getxmlFilePath(); QString srcxmlpath = slcl1.getxmlFilePath();
QString tarxmlpath = l1B.getxmlFilePath(); QString tarxmlpath = l1B.getxmlFilePath();
copyAndReplaceFile(srcxmlpath, tarxmlpath); copyAndReplaceFile(srcxmlpath, tarxmlpath);
l1B.loadFromXml(); l1B.loadFromXml();
if (ui.radioButtonAmp->isChecked()) { if (ui.radioButtonAmp->isChecked()) {
Complex2AmpRaster(imgfilepath, slcl1.getImageRasterPath()); Complex2AmpRaster(imgfilepath, l1B.getImageRasterPath());
} }
else if (ui.radioButtonPhase->isChecked()) { else if (ui.radioButtonPhase->isChecked()) {
Complex2PhaseRaster(imgfilepath, slcl1.getImageRasterPath()); Complex2PhaseRaster(imgfilepath, l1B.getImageRasterPath());
} }
else if (ui.radioButtonSigma0->isChecked()) { else if (ui.radioButtonSigma0->isChecked()) {
Complex2dBRaster(imgfilepath, slcl1.getImageRasterPath()); Complex2dBRaster(imgfilepath, l1B.getImageRasterPath());
} }
progressDialog.setValue(i); progressDialog.setValue(i);
} }

View File

@ -7,10 +7,9 @@ QImportGF3StripL1ADataset::QImportGF3StripL1ADataset(QWidget *parent)
{ {
ui.setupUi(this); ui.setupUi(this);
QListWidget* listWidgetMetaxml; QObject::connect(ui.pushButtonAdd,SIGNAL(clicked(bool)),this,SLOT(onpushButtonAddClicked(bool)));
QObject::connect(ui.pushButtonAdd,SIGNAL(clicked(clicked)),this,SLOT(onpushButtonAddClicked(bool))); QObject::connect(ui.pushButtonRemove, SIGNAL(clicked(bool)), this, SLOT(onpushButtonRemoveClicked(bool)));
QObject::connect(ui.pushButtonRemove, SIGNAL(clicked(clicked)), this, SLOT(onpushButtonRemoveClicked(bool))); QObject::connect(ui.pushButtonWorkSpace, SIGNAL(clicked(bool)), this, SLOT(onpushButtonWorkSpaceClicked(bool)));
QObject::connect(ui.pushButtonWorkSpace, SIGNAL(clicked(clicked)), this, SLOT(onpushButtonWorkSpaceClicked(bool)));
QObject::connect(ui.buttonBox, SIGNAL(rejected()), this, SLOT(onreject())); QObject::connect(ui.buttonBox, SIGNAL(rejected()), this, SLOT(onreject()));
QObject::connect(ui.buttonBox, SIGNAL(accepted()), this, SLOT(onaccept())); QObject::connect(ui.buttonBox, SIGNAL(accepted()), this, SLOT(onaccept()));

View File

@ -10,8 +10,8 @@ QRDOrthProcessClass::QRDOrthProcessClass(QWidget *parent)
connect(ui.pushButtonAdd,SIGNAL(clicked(bool)),this,SLOT(onpushButtonAddClicked(bool))); connect(ui.pushButtonAdd,SIGNAL(clicked(bool)),this,SLOT(onpushButtonAddClicked(bool)));
connect(ui.pushButtonRemove,SIGNAL(clicked(bool)),this,SLOT(onpushButtonRemoveClicked(bool))); connect(ui.pushButtonRemove,SIGNAL(clicked(bool)),this,SLOT(onpushButtonRemoveClicked(bool)));
connect(ui.pushButtonDEMSelect,SIGNAL(clicked(bool)),this,SLOT(onpushButtonWorkSpaceClicked(bool))); connect(ui.pushButtonWorkSpace,SIGNAL(clicked(bool)),this,SLOT(onpushButtonWorkSpaceClicked(bool)));
connect(ui.pushButtonWorkSpace, SIGNAL(clicked(bool)), this, SLOT(pushButtonDEMSelectClicked(bool))); connect(ui.pushButtonDEMSelect, SIGNAL(clicked(bool)), this, SLOT(pushButtonDEMSelectClicked(bool)));
QObject::connect(ui.buttonBox, SIGNAL(rejected()), this, SLOT(onreject())); QObject::connect(ui.buttonBox, SIGNAL(rejected()), this, SLOT(onreject()));
QObject::connect(ui.buttonBox, SIGNAL(accepted()), this, SLOT(onaccept())); QObject::connect(ui.buttonBox, SIGNAL(accepted()), this, SLOT(onaccept()));
// QDialogButtonBox* buttonBox; // QDialogButtonBox* buttonBox;

View File

@ -5,24 +5,41 @@
bool SatelliteGF3xmlParser::loadFile(const QString& filename) { bool SatelliteGF3xmlParser::loadFile(const QString& filename) {
QFile file(filename); QFile file(filename);
if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) { if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) {
qWarning() << "Cannot open file:" << filename; qWarning() << u8"Cannot open file:" << filename;
return false; return false;
} }
QDomDocument doc; QDomDocument doc;
if (!doc.setContent(&file)) { if (!doc.setContent(&file)) {
file.close(); file.close();
qWarning() << "Failed to parse the file into a DOM tree."; qWarning() << u8"Failed to parse the file into a DOM tree.";
return false; return false;
} }
file.close(); file.close();
xml = doc; xml = doc;
this->parseAdditionalData();
this->parseImageInfo();
this->parsePlatform();
this->parseGPS();
//处理时间
double tempreftime = start + (end - start) / 2;
for (long i = 0;i < antposs.size();i++)
{
antposs[i].time = antposs[i].time - tempreftime;
}
start = start- tempreftime;
end = end- tempreftime;
return true; return true;
} }
void SatelliteGF3xmlParser::parsePlatform() { void SatelliteGF3xmlParser::parsePlatform() {
QDomElement platform = xml.firstChildElement("root").firstChildElement("platform"); QDomElement platform = xml.firstChildElement("product").firstChildElement("platform");
if (!platform.isNull()) { if (!platform.isNull()) {
CenterTime = platform.firstChildElement("CenterTime").text(); CenterTime = platform.firstChildElement("CenterTime").text();
Rs = platform.firstChildElement("Rs").text().toDouble(); Rs = platform.firstChildElement("Rs").text().toDouble();
@ -37,24 +54,24 @@ void SatelliteGF3xmlParser::parsePlatform() {
Vys = platform.firstChildElement("Vys").text().toDouble(); Vys = platform.firstChildElement("Vys").text().toDouble();
Vzs = platform.firstChildElement("Vzs").text().toDouble(); Vzs = platform.firstChildElement("Vzs").text().toDouble();
qDebug() << "Platform Data:"; qDebug() << u8"Platform Data:";
qDebug() << "CenterTime:" << CenterTime; qDebug() << u8"CenterTime:" << CenterTime;
qDebug() << "Rs:" << Rs; qDebug() << u8"Rs:" << Rs;
qDebug() << "satVelocity:" << satVelocity; qDebug() << u8"satVelocity:" << satVelocity;
qDebug() << "RollAngle:" << RollAngle; qDebug() << u8"RollAngle:" << RollAngle;
qDebug() << "PitchAngle:" << PitchAngle; qDebug() << u8"PitchAngle:" << PitchAngle;
qDebug() << "YawAngle:" << YawAngle; qDebug() << u8"YawAngle:" << YawAngle;
qDebug() << "Xs:" << Xs; qDebug() << u8"Xs:" << Xs;
qDebug() << "Ys:" << Ys; qDebug() << u8"Ys:" << Ys;
qDebug() << "Zs:" << Zs; qDebug() << u8"Zs:" << Zs;
qDebug() << "Vxs:" << Vxs; qDebug() << u8"Vxs:" << Vxs;
qDebug() << "Vys:" << Vys; qDebug() << u8"Vys:" << Vys;
qDebug() << "Vzs:" << Vzs; qDebug() << u8"Vzs:" << Vzs;
} }
} }
void SatelliteGF3xmlParser::parseGPS() { void SatelliteGF3xmlParser::parseGPS() {
QDomElement GPS = xml.firstChildElement("root").firstChildElement("GPS"); QDomElement GPS = xml.firstChildElement("product").firstChildElement("GPS");
if (!GPS.isNull()) { if (!GPS.isNull()) {
QDomNodeList GPSParams = GPS.elementsByTagName("GPSParam"); QDomNodeList GPSParams = GPS.elementsByTagName("GPSParam");
for (int i = 0; i < GPSParams.count(); ++i) { for (int i = 0; i < GPSParams.count(); ++i) {
@ -69,37 +86,52 @@ void SatelliteGF3xmlParser::parseGPS() {
QString yVelocity = GPSParam.firstChildElement("yVelocity").text(); QString yVelocity = GPSParam.firstChildElement("yVelocity").text();
QString zVelocity = GPSParam.firstChildElement("zVelocity").text(); QString zVelocity = GPSParam.firstChildElement("zVelocity").text();
QDateTime dateTime = QDateTime::fromString(TimeStamp, "yyyy-MM-dd HH:mm:ss.zzzzzz");
satepos.time = dateTime.toMSecsSinceEpoch() / 1000.0; TimestampMicroseconds dateTime = parseAndConvert(TimeStamp.toStdString());
satepos.Px = xPosition.toDouble(); satepos.time = dateTime.msecsSinceEpoch / 1000.0 + dateTime.microseconds / 100000.0;
satepos.Py = yPosition.toDouble(); satepos.Px = xPosition.toDouble();
satepos.Pz = zPosition.toDouble(); satepos.Py = yPosition.toDouble();
satepos.Vx = xVelocity.toDouble(); satepos.Pz = zPosition.toDouble();
satepos.Vy = yVelocity.toDouble(); satepos.Vx = xVelocity.toDouble();
satepos.Vz = zVelocity.toDouble(); satepos.Vy = yVelocity.toDouble();
satepos.Vz = zVelocity.toDouble();
this->antposs.append(satepos); this->antposs.append(satepos);
qDebug() << "\nGPS Param Data:"; qDebug() << u8"\nGPS Param Data:";
qDebug() << "TimeStamp:" << TimeStamp; qDebug() << u8"TimeStamp:" << TimeStamp;
qDebug() << "xPosition:" << xPosition; qDebug() << u8"xPosition:" << xPosition;
qDebug() << "yPosition:" << yPosition; qDebug() << u8"yPosition:" << yPosition;
qDebug() << "zPosition:" << zPosition; qDebug() << u8"zPosition:" << zPosition;
qDebug() << "xVelocity:" << xVelocity; qDebug() << u8"xVelocity:" << xVelocity;
qDebug() << "yVelocity:" << yVelocity; qDebug() << u8"yVelocity:" << yVelocity;
qDebug() << "zVelocity:" << zVelocity; qDebug() << u8"zVelocity:" << zVelocity;
} }
} }
} }
void SatelliteGF3xmlParser::parseImageInfo() { void SatelliteGF3xmlParser::parseImageInfo() {
QDomElement imageinfo = xml.firstChildElement("root").firstChildElement("imageinfo"); QDomElement imageinfo = xml.firstChildElement("product").firstChildElement("imageinfo");
if (!imageinfo.isNull()) { if (!imageinfo.isNull()) {
QDomElement imagingTime = imageinfo.firstChildElement("imagingTime"); QDomElement imagingTime = imageinfo.firstChildElement("imagingTime");
;
start = QDateTime::fromString(imagingTime.firstChildElement("start").text(), "yyyy-MM-dd HH:mm:ss.zzzzzz").toMSecsSinceEpoch()/1000.0; QString starttimestr = imagingTime.firstChildElement("start").text().trimmed();
end = QDateTime::fromString(imagingTime.firstChildElement("end").text(), "yyyy-MM-dd HH:mm:ss.zzzzzz").toMSecsSinceEpoch() / 1000.0; QString endtimestr = imagingTime.firstChildElement("end").text().trimmed();
TimestampMicroseconds starttime = parseAndConvert(starttimestr.toStdString());
TimestampMicroseconds endtime = parseAndConvert(endtimestr.toStdString());
start = starttime.msecsSinceEpoch / 1000.0 + starttime.microseconds / 100000.0;
end = endtime.msecsSinceEpoch / 1000.0 + endtime.microseconds / 100000.0;
// 打印starttime,endtime
qDebug() << u8"成像开始时间(parse)" << starttime.msecsSinceEpoch << "\t" << starttime.microseconds;
qDebug() << u8"成像结束时间(parse)" << endtime.msecsSinceEpoch << "\t" << endtime.microseconds;
qDebug() << u8"成像开始时间:" << start <<"\t"<< starttimestr;
qDebug() << u8"成像结束时间:" << end << "\t" << endtimestr;
nearRange = imageinfo.firstChildElement("nearRange").text().toDouble(); nearRange = imageinfo.firstChildElement("nearRange").text().toDouble();
refRange = imageinfo.firstChildElement("refRange").text().toDouble(); refRange = imageinfo.firstChildElement("refRange").text().toDouble();
eqvFs = imageinfo.firstChildElement("eqvFs").text().toDouble(); eqvFs = imageinfo.firstChildElement("eqvFs").text().toDouble();
@ -154,35 +186,36 @@ void SatelliteGF3xmlParser::parseImageInfo() {
incidenceAngleNearRange = imageinfo.firstChildElement("incidenceAngleNearRange").text().toDouble(); incidenceAngleNearRange = imageinfo.firstChildElement("incidenceAngleNearRange").text().toDouble();
incidenceAngleFarRange = imageinfo.firstChildElement("incidenceAngleFarRange").text().toDouble(); incidenceAngleFarRange = imageinfo.firstChildElement("incidenceAngleFarRange").text().toDouble();
qDebug() << "\nImage Info Data:"; qDebug() << u8"\nImage Info Data:";
qDebug() << "Start:" << start; qDebug() << u8"Start:" << start;
qDebug() << "End:" << end; qDebug() << u8"End:" << end;
qDebug() << "Near Range:" << nearRange; qDebug() << u8"Near Range:" << nearRange;
qDebug() << "Ref Range:" << refRange; qDebug() << u8"Ref Range:" << refRange;
qDebug() << "Eqv Fs:" << eqvFs; qDebug() << u8"Eqv Fs:" << eqvFs;
qDebug() << "Eqv PRF:" << eqvPRF; qDebug() << u8"Eqv PRF:" << eqvPRF;
qDebug() << "Center Latitude:" << latitude_center << ", Longitude:" << longitude_center; qDebug() << u8"Center Latitude:" << latitude_center << ", Longitude:" << longitude_center;
qDebug() << "Top Left Corner Latitude:" << latitude_topLeft << ", Longitude:" << longitude_topLeft; qDebug() << u8"Top Left Corner Latitude:" << latitude_topLeft << ", Longitude:" << longitude_topLeft;
qDebug() << "Top Right Corner Latitude:" << latitude_topRight << ", Longitude:" << longitude_topRight; qDebug() << u8"Top Right Corner Latitude:" << latitude_topRight << ", Longitude:" << longitude_topRight;
qDebug() << "Bottom Left Corner Latitude:" << latitude_bottomLeft << ", Longitude:" << longitude_bottomLeft; qDebug() << u8"Bottom Left Corner Latitude:" << latitude_bottomLeft << ", Longitude:" << longitude_bottomLeft;
qDebug() << "Bottom Right Corner Latitude:" << latitude_bottomRight << ", Longitude:" << longitude_bottomRight; qDebug() << u8"Bottom Right Corner Latitude:" << latitude_bottomRight << ", Longitude:" << longitude_bottomRight;
qDebug() << "Width:" << width; qDebug() << u8"Width:" << width;
qDebug() << "Height:" << height; qDebug() << u8"Height:" << height;
qDebug() << "Width Space:" << widthspace; qDebug() << u8"Width Space:" << widthspace;
qDebug() << "Height Space:" << heightspace; qDebug() << u8"Height Space:" << heightspace;
qDebug() << "Scene Shift:" << sceneShift; qDebug() << u8"Scene Shift:" << sceneShift;
qDebug() << "Image Bit:" << imagebit; qDebug() << u8"Image Bit:" << imagebit;
qDebug() << "HH Qualify Value:" << HH_QualifyValue; qDebug() << u8"HH Qualify Value:" << HH_QualifyValue;
qDebug() << "HV Qualify Value:" << HV_QualifyValue; qDebug() << u8"HV Qualify Value:" << HV_QualifyValue;
qDebug() << "HH Echo Saturation:" << HH_echoSaturation; qDebug() << u8"HH Echo Saturation:" << HH_echoSaturation;
qDebug() << "HV Echo Saturation:" << HV_echoSaturation; qDebug() << u8"HV Echo Saturation:" << HV_echoSaturation;
qDebug() << "incidenceAngleNearRange:" << incidenceAngleNearRange; qDebug() << u8"incidenceAngleNearRange:" << incidenceAngleNearRange;
qDebug() << "incidenceAngleFarRange:" << incidenceAngleFarRange; qDebug() << u8"incidenceAngleFarRange:" << incidenceAngleFarRange;
} }
} }
void SatelliteGF3xmlParser::parseAdditionalData() { void SatelliteGF3xmlParser::parseAdditionalData() {
QDomElement calibrationConst = xml.firstChildElement("root").firstChildElement("CalibrationConst"); QDomElement processinfo = xml.firstChildElement("product").firstChildElement("processinfo");
QDomElement calibrationConst = processinfo.firstChildElement("CalibrationConst");
if (!calibrationConst.isNull()) { if (!calibrationConst.isNull()) {
bool HH_CalibrationConstISNULL=false; bool HH_CalibrationConstISNULL=false;
@ -201,50 +234,50 @@ void SatelliteGF3xmlParser::parseAdditionalData() {
qDebug() << "\nCalibration Const Data:"; qDebug() << u8"\nCalibration Const Data:";
qDebug() << "HH Calibration Const:" << HH_CalibrationConst; qDebug() << u8"HH Calibration Const:" << HH_CalibrationConst;
qDebug() << "HV Calibration Const:" << HV_CalibrationConst; qDebug() << u8"HV Calibration Const:" << HV_CalibrationConst;
qDebug() << "VH Calibration Const:" << VH_CalibrationConst; qDebug() << u8"VH Calibration Const:" << VH_CalibrationConst;
qDebug() << "VV Calibration Const:" << VV_CalibrationConst; qDebug() << u8"VV Calibration Const:" << VV_CalibrationConst;
} }
AzFdc0 = xml.firstChildElement("root").firstChildElement("AzFdc0").text().toDouble(); AzFdc0 = processinfo.firstChildElement("AzFdc0").text().toDouble();
AzFdc1 = xml.firstChildElement("root").firstChildElement("AzFdc1").text().toDouble(); AzFdc1 = processinfo.firstChildElement("AzFdc1").text().toDouble();
QDomElement sensorNode = xml.firstChildElement("product").firstChildElement("sensor");
sensorID = sensorNode.firstChildElement("sensorID").text();
imagingMode = sensorNode.firstChildElement("imagingMode").text();
lamda = sensorNode.firstChildElement("lamda").text().toDouble();
RadarCenterFrequency = sensorNode.firstChildElement("RadarCenterFrequency").text().toDouble();
sensorID = xml.firstChildElement("root").firstChildElement("sensorID").text(); TotalProcessedAzimuthBandWidth = processinfo.firstChildElement("TotalProcessedAzimuthBandWidth").text().toDouble();
imagingMode = xml.firstChildElement("root").firstChildElement("imagingMode").text(); DopplerParametersReferenceTime = processinfo.firstChildElement("DopplerParametersReferenceTime").text().toDouble();
lamda = xml.firstChildElement("root").firstChildElement("lamda").text().toDouble();
RadarCenterFrequency = xml.firstChildElement("root").firstChildElement("RadarCenterFrequency").text().toDouble();
TotalProcessedAzimuthBandWidth = xml.firstChildElement("root").firstChildElement("TotalProcessedAzimuthBandWidth").text().toDouble(); QDomElement dopplerCentroidCoefficients = processinfo.firstChildElement("DopplerCentroidCoefficients");
DopplerParametersReferenceTime = xml.firstChildElement("root").firstChildElement("DopplerParametersReferenceTime").text().toDouble();
QDomElement dopplerCentroidCoefficients = xml.firstChildElement("root").firstChildElement("DopplerCentroidCoefficients");
d0 = dopplerCentroidCoefficients.firstChildElement("d0").text().toDouble(); d0 = dopplerCentroidCoefficients.firstChildElement("d0").text().toDouble();
d1 = dopplerCentroidCoefficients.firstChildElement("d1").text().toDouble(); d1 = dopplerCentroidCoefficients.firstChildElement("d1").text().toDouble();
d2 = dopplerCentroidCoefficients.firstChildElement("d2").text().toDouble(); d2 = dopplerCentroidCoefficients.firstChildElement("d2").text().toDouble();
d3 = dopplerCentroidCoefficients.firstChildElement("d3").text().toDouble(); d3 = dopplerCentroidCoefficients.firstChildElement("d3").text().toDouble();
d4 = dopplerCentroidCoefficients.firstChildElement("d4").text().toDouble(); d4 = dopplerCentroidCoefficients.firstChildElement("d4").text().toDouble();
QDomElement dopplerRateValuesCoefficients = xml.firstChildElement("root").firstChildElement("DopplerRateValuesCoefficients"); QDomElement dopplerRateValuesCoefficients = processinfo.firstChildElement("DopplerRateValuesCoefficients");
r0 = dopplerRateValuesCoefficients.firstChildElement("r0").text().toDouble(); r0 = dopplerRateValuesCoefficients.firstChildElement("r0").text().toDouble();
r1 = dopplerRateValuesCoefficients.firstChildElement("r1").text().toDouble(); r1 = dopplerRateValuesCoefficients.firstChildElement("r1").text().toDouble();
r2 = dopplerRateValuesCoefficients.firstChildElement("r2").text().toDouble(); r2 = dopplerRateValuesCoefficients.firstChildElement("r2").text().toDouble();
r3 = dopplerRateValuesCoefficients.firstChildElement("r3").text().toDouble(); r3 = dopplerRateValuesCoefficients.firstChildElement("r3").text().toDouble();
r4 = dopplerRateValuesCoefficients.firstChildElement("r4").text().toDouble(); r4 = dopplerRateValuesCoefficients.firstChildElement("r4").text().toDouble();
DEM = xml.firstChildElement("root").firstChildElement("DEM").text().toDouble(); DEM = processinfo.firstChildElement("DEM").text().toDouble();
qDebug() << "\nAdditional Data:"; qDebug() << u8"\nAdditional Data:";
qDebug() << "AzFdc0:" << AzFdc0; qDebug() << u8"AzFdc0:" << AzFdc0;
qDebug() << "AzFdc1:" << AzFdc1; qDebug() << u8"AzFdc1:" << AzFdc1;
qDebug() << "Sensor ID:" << sensorID; qDebug() << u8"Sensor ID:" << sensorID;
qDebug() << "Imaging Mode:" << imagingMode; qDebug() << u8"Imaging Mode:" << imagingMode;
qDebug() << "Lambda:" << lamda; qDebug() << u8"Lambda:" << lamda;
qDebug() << "Radar Center Frequency:" << RadarCenterFrequency; qDebug() << u8"Radar Center Frequency:" << RadarCenterFrequency;
qDebug() << "Total Processed Azimuth Band Width:" << TotalProcessedAzimuthBandWidth; qDebug() << u8"Total Processed Azimuth Band Width:" << TotalProcessedAzimuthBandWidth;
qDebug() << "Doppler Parameters Reference Time:" << DopplerParametersReferenceTime; qDebug() << u8"Doppler Parameters Reference Time:" << DopplerParametersReferenceTime;
qDebug() << "Doppler Centroid Coefficients: d0=" << d0 << ", d1=" << d1 << ", d2=" << d2 << ", d3=" << d3 << ", d4=" << d4; qDebug() << u8"Doppler Centroid Coefficients: d0=" << d0 << ", d1=" << d1 << ", d2=" << d2 << ", d3=" << d3 << ", d4=" << d4;
qDebug() << "Doppler Rate Values Coefficients: r0=" << r0 << ", r1=" << r1 << ", r2=" << r2 << ", r3=" << r3 << ", r4=" << r4; qDebug() << u8"Doppler Rate Values Coefficients: r0=" << r0 << ", r1=" << r1 << ", r2=" << r2 << ", r3=" << r3 << ", r4=" << r4;
qDebug() << "DEM:" << DEM; qDebug() << u8"DEM:" << DEM;
} }