This commit is contained in:
KenanZhu111 committed 2024-09-23 10:44:47 +08:00
1 parent 1d5ab4cb1c
commit dbecbe95cb
26 files changed
+255 -243

No files matched your search

+6 -1
View File
@@ -1,5 +1,10 @@
{ {
"files.associations": { "files.associations": {
"unistd.h": "c" "unistd.h": "c",
"select_epo.h": "c",
"xyz2blh.h": "c",
"deg2dms.h": "c",
"blh2enu.h": "c",
"terminal.h": "c"
} }
} }
@@ -19343,7 +19343,7 @@ G12[sPRN] 8° 52′ 46″ 68° 05′ 27″ 20210521.21327
G30[sPRN] -16° 03′ 27″ 178° 50′ 25″ 20290461.70428 G30[sPRN] -16° 03′ 27″ 178° 50′ 25″ 20290461.70428
G05[sPRN] 17° 44′ 46″ 80° 37′ 42″ 20058204.33160 G05[sPRN] 17° 44′ 46″ 80° 37′ 42″ 20058204.33160
G14[sPRN] -54° 30′ 08″ 168° 29′ 53″ 20202945.59449 G14[sPRN] -54° 30′ 08″ 168° 29′ 53″ 20202945.59449
G17[sPRN] -23° 46′ 16″ 150° 41′ 08″ 20032545.37168 G17[sPRN] -23° 46′ 16″ 150° 41′ 08″ 20032545.37167
G07[sPRN] 3° 11′ 44″ -167° 24′ 02″ 20472840.48542 G07[sPRN] 3° 11′ 44″ -167° 24′ 02″ 20472840.48542
G13[sPRN] -29° 17′ 16″ 115° 04′ 45″ 20188988.11695 G13[sPRN] -29° 17′ 16″ 115° 04′ 45″ 20188988.11695
G19[sPRN] -9° 04′ 54″ 142° 15′ 47″ 20121519.14606 G19[sPRN] -9° 04′ 54″ 142° 15′ 47″ 20121519.14606
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -19343,7 +19343,7 @@ G12[sPRN] 8.87968 68.09086 20210521.21327
G30[sPRN] -16.05758 178.84031 20290461.70428 G30[sPRN] -16.05758 178.84031 20290461.70428
G05[sPRN] 17.74627 80.62854 20058204.33160 G05[sPRN] 17.74627 80.62854 20058204.33160
G14[sPRN] -54.50226 168.49819 20202945.59449 G14[sPRN] -54.50226 168.49819 20202945.59449
G17[sPRN] -23.77119 150.68578 20032545.37168 G17[sPRN] -23.77119 150.68578 20032545.37167
G07[sPRN] 3.19562 -167.40058 20472840.48542 G07[sPRN] 3.19562 -167.40058 20472840.48542
G13[sPRN] -29.28788 115.07943 20188988.11695 G13[sPRN] -29.28788 115.07943 20188988.11695
G19[sPRN] -9.08185 142.26320 20121519.14606 G19[sPRN] -9.08185 142.26320 20121519.14606
File renamed without changes.
@@ -1,5 +1,6 @@
function [ENU] = Station_Site_Solving()
% 打开坐标文件 % 打开坐标文件
file=fopen('LLA_result_for_Matlab.txt'); file=fopen('LLA_result.txt');
sPRN = []; sPRN = [];
satX = []; satX = [];
satY = []; satY = [];
View File
File renamed without changes.
View File
File renamed without changes.
+10 -8
View File
@@ -4,6 +4,8 @@
#include<stdlib.h> #include<stdlib.h>
#include<math.h> #include<math.h>
#include"public.h"
#include"read.h" #include"read.h"
#include"2gpst.h" #include"2gpst.h"
#include"select_epo.h" #include"select_epo.h"
@@ -82,13 +84,13 @@ int sat_gps_pos_clac(FILE * result_file,
station = (pstation)malloc(sizeof(pstation) * o_epochnum* 256); station = (pstation)malloc(sizeof(pstation) * o_epochnum* 256);
for (int i = 0; i < o_epochnum; i++)//第i个历元 for (int i = 0; i < o_epochnum; i++)//第i个历元
{ {
result_file = fopen(".\\Pos_out\\LLA_result_for_read.txt", "a+"); result_file = fopen(".\\Pos_out\\LLA_result.txt", "a+");
fprintf(result_file, "\n>%04d %04d %02d %02d %02d %02d %07.04f",i + 1 ,obs_e[i].y ,obs_e[i].m ,obs_e[i].d ,obs_e[i].h ,obs_e[i].min ,obs_e[i].sec); fprintf(result_file, "\n>%04d %04d %02d %02d %02d %02d %07.04f",i + 1 ,obs_e[i].y ,obs_e[i].m ,obs_e[i].d ,obs_e[i].h ,obs_e[i].min ,obs_e[i].sec);
fclose(result_file); fclose(result_file);
result_file = fopen(".\\Draw the Track[by PyGMT]\\LLA_result_for_PyGMT.txt", "a+"); result_file = fopen(".\\PyGMT_out\\LLA_result.txt", "a+");
fprintf(result_file, "\n>%04d %04d %02d %02d %02d %02d %07.04f",i + 1 ,obs_e[i].y ,obs_e[i].m ,obs_e[i].d ,obs_e[i].h ,obs_e[i].min ,obs_e[i].sec); fprintf(result_file, "\n>%04d %04d %02d %02d %02d %02d %07.04f",i + 1 ,obs_e[i].y ,obs_e[i].m ,obs_e[i].d ,obs_e[i].h ,obs_e[i].min ,obs_e[i].sec);
fclose(result_file); fclose(result_file);
result_file = fopen(".\\Observation_Station_Site-Solving_by_Matlab\\LLA_result_for_Matlab.txt", "a+"); result_file = fopen(".\\Result_out\\LLA_result.txt", "a+");
fprintf(result_file, "\n>%04d %04d %02d %02d %02d %02d %07.04f",i + 1 ,obs_e[i].y ,obs_e[i].m ,obs_e[i].d ,obs_e[i].h ,obs_e[i].min ,obs_e[i].sec); fprintf(result_file, "\n>%04d %04d %02d %02d %02d %02d %07.04f",i + 1 ,obs_e[i].y ,obs_e[i].m ,obs_e[i].d ,obs_e[i].h ,obs_e[i].min ,obs_e[i].sec);
fclose(result_file); fclose(result_file);
@@ -161,20 +163,20 @@ int sat_gps_pos_clac(FILE * result_file,
blh->L_m = teml.M; blh->L_m = teml.M;
blh->L_s = teml.S; blh->L_s = teml.S;
result_file = fopen(".\\Pos_out\\LLA_result_for_read.txt", "a+"); result_file = fopen(".\\Pos_out\\LLA_result.txt", "a+");
fprintf(result_file, "\nG%02d[sPRN] %4d° %02d′ %02d″ %4d° %02d′ %02d″ %15.05f",sPRN, blh->B_d, blh->B_m, blh->B_s, blh->L_d, blh->L_m, blh->L_s, blh->H); fprintf(result_file, "\nG%02d[sPRN] %4d° %02d′ %02d″ %4d° %02d′ %02d″ %15.05f",sPRN, blh->B_d, blh->B_m, blh->B_s, blh->L_d, blh->L_m, blh->L_s, blh->H);
fclose(result_file); fclose(result_file);
result_file = fopen(".\\Draw the Track[by PyGMT]\\LLA_result_for_PyGMT.txt", "a+"); result_file = fopen(".\\PyGMT_out\\LLA_result.txt", "a+");
fprintf(result_file, "\nG%02d[sPRN] %10.05f %10.05f %15.05f",sPRN, blh->B, blh->L, blh->H); fprintf(result_file, "\nG%02d[sPRN] %10.05f %10.05f %15.05f",sPRN, blh->B, blh->L, blh->H);
fclose(result_file); fclose(result_file);
result_file = fopen(".\\Observation_Station_Site-Solving_by_Matlab\\LLA_result_for_Matlab.txt", "a+"); result_file = fopen(".\\Result_out\\LLA_result.txt", "a+");
fprintf(result_file, "\nG%02d[sPRN] %15.05f %15.05f %15.05f %15.05f %15.05f %15.05f %15.12f %16.13f" fprintf(result_file, "\nG%02d[sPRN] %15.05f %15.05f %15.05f %15.05f %15.05f %15.05f %15.12f %16.13f"
,sPRN, pos_t[i].X[sPRN], pos_t[i].Y[sPRN], pos_t[i].Z[sPRN], obs_b[i].obs_gps[j][C1], obs_b[i].obs_gps[j][10], rah->H, nav_b[best_epoch].TGD, pos_t[i].delta_clk[sPRN]); ,sPRN, pos_t[i].X[sPRN], pos_t[i].Y[sPRN], pos_t[i].Z[sPRN], obs_b[i].obs_gps[j][C1], obs_b[i].obs_gps[j][10], rah->H, nav_b[best_epoch].TGD, pos_t[i].delta_clk[sPRN]);
fclose(result_file); fclose(result_file);
} }
} }
result_file = fopen(".\\Observation_Station_Site-Solving_by_Matlab\\LLA_result_for_Matlab.txt", "a+"); result_file = fopen(".\\Result_out\\LLA_result.txt", "a+");
fprintf(result_file, "\n"); fprintf(result_file, "\n");
fclose(result_file); fclose(result_file);
@@ -197,7 +199,7 @@ int sat_gps_pos_clac(FILE * result_file,
/* -------------------------------------------------------------------------- */ /* -------------------------------------------------------------------------- */
} }
result_file = fopen(".\\Observation_Station_Site-Solving_by_Matlab\\LLA_result_for_Matlab.txt", "a+"); result_file = fopen(".\\Result_out\\LLA_result.txt", "a+");
fprintf(result_file, "\nEND"); fprintf(result_file, "\nEND");
fclose(result_file); fclose(result_file);
free(blh);blh = NULL; free(blh);blh = NULL;
View File
File renamed without changes.
+1 -1
View File
@@ -1,7 +1,7 @@
#ifndef _DEGRRAD_H_ #ifndef _DEGRRAD_H_
#define _DEGRRAD_H_ #define _DEGRRAD_H_
#include"read.h" #include"public.h"
/* -------------------------------------------------------------------------- */ /* -------------------------------------------------------------------------- */
/// @brief 角度转弧度 /// @brief 角度转弧度
+227
View File
@@ -0,0 +1,227 @@
#ifndef _PUBLIC_H_
#define _PUBLIC_H_
/* ------------------------------ WGS-84 CONST ------------------------------ */
#define a 6378137.0
#define e2 (0.0033528106647475*(2 - 0.0033528106647475))
#define C_V 299792458
#define GM 398600500000000
#define math_e 2.718281828459
#define PI 3.141592653589793
#define Earth_e 7.2921151467e-5
#define C1 0
/* ----------------------------- GPS OBSERV TYPE ---------------------------- */
#define C1C 101
#define C1S 102
#define C1L 103
#define C1X 104
#define C1P 105
#define C1W 106
#define C1Y 107
#define C1M 108
#define C2C 201
#define C2S 202
#define C2L 203
#define C2X 204
#define C2P 205
#define C2W 206
#define C2Y 207
#define C2M 208
#define C5I 501
#define C5Q 502
#define C5X 503
/* ------------------------------ FOR CALMOD.H ------------------------------ */
#define MAXRINEX 1000
//卫星位置结构体
typedef struct
{
double X[36];
double Y[36];
double Z[36];
double deltat[36];//改正前的信号传播时间
double delta_t[36];//改正后的信号传播时间
double delta_clk[36];
}pos_t, *ppos_t;
//测站位置结构体
typedef struct
{
double X;
double Y;
double Z;
double B;
double L;
double H;
double delta_TR;
}station, *pstation;
//经纬高结构体
typedef struct
{
double B;
int B_d;
int B_m;
int B_s;
double L;
int L_d;
int L_m;
int L_s;
double H;
}blh, *pblh;
//东北天结构体
typedef struct enu
{
double E;
double N;
double U;
}enu, *penu;
//高度方位角结构体
typedef struct rah
{
double R;
double A;
double H;
}rah, *prah;
/* ------------------------------- FOR READ.H ------------------------------- */
//导航头文件结构体
typedef struct nav_head
{
double ver;//rinex 版本号
char type[20];//读取的数据类型
double ION_GPSA[4];//8个电离层参数
double ION_GPSB[4];
double ION_BDSA[4];//8个电离层参数
double ION_BDSB[4];
double ION_QZSA[4];//8个电离层参数
double ION_QZSB[4];
double ION_IRNA[4];//8个电离层参数
double ION_IRNB[4];
double GPUT[4];
double GLUT[4];
double GAUT[4];
double BDUT[4];
double QZUT[4];
double IRUT[4];
double SBUT[4];
int leap;
}nav_head, *pnav_head;
//导航数据结构体
typedef struct nav_body
{
//数据块第一行内容:
int sPRN;//卫星PRN号
//历元:TOC中卫星钟的参考时刻
int TOC_Y;//年
int TOC_M;//月
int TOC_D;//日
int TOC_H;//时
int TOC_Min;//分
int TOC_Sec;//秒
double sa0;//卫星钟差
double sa1;//卫星钟偏
double sa2;//卫星钟漂
//数据块第二行内容:
double IODE;//数据、星历发布时间(数据期龄)
double Crs;//轨道半径的正弦调和改正项的振幅(单位:m)
double deltan;//卫星平均运动速率与计算值之差(rad/s)
double M0;//参考时间的平近点角(rad)
//数据块第三行内容:
double Cuc;//维度幅角的余弦调和改正项的振幅(rad)
double e;//轨道偏心率
double Cus;//轨道幅角的正弦调和改正项的振幅(rad)
double sqrtA;//长半轴平方根
//数据块第四行内容:
double TOE;//星历的参考时刻(GPS周内秒)
double Cic;//轨道倾角的余弦调和改正项的振幅(rad)
double OMEGA;//参考时刻的升交点赤经
double Cis;//维度倾角的正弦调和改正项的振幅(rad)
//数据块第五行内容:
double i0;//参考时间的轨道倾角(rad)
double Crc;//轨道平径的余弦调和改正项的振幅(m)
double omega;//近地点角距
double deltaomega;//升交点赤经变化率(rad)
//数据块第六行内容:
double IDOT;//近地点角距(rad/s)
double L2code;//L2上的码
double GPSweek;//GPS周,于TOE一同表示
double L2Pflag;//L2,p码数据标记
//数据块第七行内容
double sACC;//卫星精度
double sHEA;//卫星健康状态
double TGD;//sec
double IODC;//钟的数据龄期
//数据块第八行内容
double TTN;//电文发送时间
double fit;//拟合区间
double spare1;//空
double spare2;//空
}nav_body, *pnav_body;
//观测值头文件结构体
typedef struct obs_head
{
double ver;//RINEX文件版本号
char type[30];//文件类型
double apX;//测站近似位置XYZ(WGS84)
double apY;
double apZ;
double ANTH;//天线高
double ANTdeltaE;//天线中心对于测站标志在东方向上的偏移量
double ANTdeltaN;//天线中心对于测站标志在北方向上的偏移量
int WAFL1;//缺省的L1载波的波长因子
int WAFL2;//缺省的L2载波的波长因子
int WAFflag;
int obstypenum_gps;//GPS观测值类型数量
int obstypenum_bds;
char obstype_gps[36];//rinex3.04GPS观测值类型列表
char obstype_bds[36];
double interval;//观测值的历元间隔
int f_y;//第一个观测记录的时刻
int f_m;
int f_d;
int f_h;
int f_min;
double f_sec;
char tsys[5];//时间系统
}obs_head,*pobs_head;
//观测值历元数据结构体
typedef struct obs_epoch
{
//观测历元时刻
int y;
int m;
int d;
int h;
int min;
double sec;
int p_flag;//历元标志
int sat_num;//当前历元所观测到的卫星数量
int gps_num;//当前历元所观测到的GPS卫星数量
int bds_num;//当前历元所观测到的BDS卫星数量
int sPRN[84];//当前历元所能观测到的卫星的PRN列表
int sPRN_GPS[25];
int sPRN_BDS[36];
}obs_epoch,*pobs_epoch;
//观测值数据结构体
typedef struct obs_body
{
double obs_gps[100][24];//GPS观测值
double obs_bds[100][24];//BDS观测值
}obs_body,*pobs_body;
/* -------------------------------------------------------------------------- */
#endif
+1 -1
View File
@@ -4,7 +4,7 @@
#include<stdlib.h> #include<stdlib.h>
#include<math.h> #include<math.h>
#include"read.h" #include"public.h"
typedef struct typedef struct
{ {
+1 -224
View File
@@ -4,89 +4,7 @@
#include<stdio.h> #include<stdio.h>
#include<string.h> #include<string.h>
#define MAXRINEX 1000//一行最大字符数 #include"public.h"
/* ------------------------------ WGS-84 CONST ------------------------------ */
#define a 6378137.0
#define e2 (0.0033528106647475*(2 - 0.0033528106647475))
#define C_V 299792458
#define GM 398600500000000
#define math_e 2.718281828459
#define PI 3.141592653589793
#define Earth_e 7.2921151467e-5
#define C1 0
/* ----------------------------- GPS OBSERV TYPE ---------------------------- */
#define C1C 101
#define C1S 102
#define C1L 103
#define C1X 104
#define C1P 105
#define C1W 106
#define C1Y 107
#define C1M 108
#define C2C 201
#define C2S 202
#define C2L 203
#define C2X 204
#define C2P 205
#define C2W 206
#define C2Y 207
#define C2M 208
#define C5I 501
#define C5Q 502
#define C5X 503
/* ------------------------------ FOR CALMOD.H ------------------------------ */
//卫星位置结构体
typedef struct
{
double X[36];
double Y[36];
double Z[36];
double deltat[36];//改正前的信号传播时间
double delta_t[36];//改正后的信号传播时间
double delta_clk[36];
}pos_t, *ppos_t;
//测站位置结构体
typedef struct
{
double X;
double Y;
double Z;
double B;
double L;
double H;
double delta_TR;
}station, *pstation;
//经纬高结构体
typedef struct
{
double B;
int B_d;
int B_m;
int B_s;
double L;
int L_d;
int L_m;
int L_s;
double H;
}blh, *pblh;
//东北天结构体
typedef struct enu
{
double E;
double N;
double U;
}enu, *penu;
//高度方位角结构体
typedef struct rah
{
double R;
double A;
double H;
}rah, *prah;
/* ------------------------ 将字符串转换为浮点数,i起始位置,n输入多少个字符 ----------------------- */ /* ------------------------ 将字符串转换为浮点数,i起始位置,n输入多少个字符 ----------------------- */
static double strtonum(const char* buff, int i, int n) static double strtonum(const char* buff, int i, int n)
{ {
@@ -113,147 +31,6 @@ static double strtonum(const char* buff, int i, int n)
return sscanf(str, "%lf", &value) == 1 ? value : 0.0; return sscanf(str, "%lf", &value) == 1 ? value : 0.0;
} }
/* -------------------------------- 导航头文件结构体 -------------------------------- */
typedef struct nav_head
{
double ver;//rinex 版本号
char type[20];//读取的数据类型
double ION_GPSA[4];//8个电离层参数
double ION_GPSB[4];
double ION_BDSA[4];//8个电离层参数
double ION_BDSB[4];
double ION_QZSA[4];//8个电离层参数
double ION_QZSB[4];
double ION_IRNA[4];//8个电离层参数
double ION_IRNB[4];
double GPUT[4];
double GLUT[4];
double GAUT[4];
double BDUT[4];
double QZUT[4];
double IRUT[4];
double SBUT[4];
int leap;
}nav_head, *pnav_head;
/* --------------------------------- 导航数据结构体 -------------------------------- */
typedef struct nav_body
{
//数据块第一行内容:
int sPRN;//卫星PRN号
//历元:TOC中卫星钟的参考时刻
int TOC_Y;//年
int TOC_M;//月
int TOC_D;//日
int TOC_H;//时
int TOC_Min;//分
int TOC_Sec;//秒
double sa0;//卫星钟差
double sa1;//卫星钟偏
double sa2;//卫星钟漂
//数据块第二行内容:
double IODE;//数据、星历发布时间(数据期龄)
double Crs;//轨道半径的正弦调和改正项的振幅(单位:m)
double deltan;//卫星平均运动速率与计算值之差(rad/s)
double M0;//参考时间的平近点角(rad)
//数据块第三行内容:
double Cuc;//维度幅角的余弦调和改正项的振幅(rad)
double e;//轨道偏心率
double Cus;//轨道幅角的正弦调和改正项的振幅(rad)
double sqrtA;//长半轴平方根
//数据块第四行内容:
double TOE;//星历的参考时刻(GPS周内秒)
double Cic;//轨道倾角的余弦调和改正项的振幅(rad)
double OMEGA;//参考时刻的升交点赤经
double Cis;//维度倾角的正弦调和改正项的振幅(rad)
//数据块第五行内容:
double i0;//参考时间的轨道倾角(rad)
double Crc;//轨道平径的余弦调和改正项的振幅(m)
double omega;//近地点角距
double deltaomega;//升交点赤经变化率(rad)
//数据块第六行内容:
double IDOT;//近地点角距(rad/s)
double L2code;//L2上的码
double GPSweek;//GPS周,于TOE一同表示
double L2Pflag;//L2,p码数据标记
//数据块第七行内容
double sACC;//卫星精度
double sHEA;//卫星健康状态
double TGD;//sec
double IODC;//钟的数据龄期
//数据块第八行内容
double TTN;//电文发送时间
double fit;//拟合区间
double spare1;//空
double spare2;//空
}nav_body, *pnav_body;
/* --------------------------------- 观测值头文件结构体 --------------------------------- */
typedef struct obs_head
{
double ver;//RINEX文件版本号
char type[30];//文件类型
double apX;//测站近似位置XYZ(WGS84)
double apY;
double apZ;
double ANTH;//天线高
double ANTdeltaE;//天线中心对于测站标志在东方向上的偏移量
double ANTdeltaN;//天线中心对于测站标志在北方向上的偏移量
int WAFL1;//缺省的L1载波的波长因子
int WAFL2;//缺省的L2载波的波长因子
int WAFflag;
int obstypenum_gps;//GPS观测值类型数量
int obstypenum_bds;
char obstype_gps[36];//rinex3.04GPS观测值类型列表
char obstype_bds[36];
double interval;//观测值的历元间隔
int f_y;//第一个观测记录的时刻
int f_m;
int f_d;
int f_h;
int f_min;
double f_sec;
char tsys[5];//时间系统
}obs_head,*pobs_head;
/* ------------------------------- 观测值历元数据结构体 ------------------------------- */
typedef struct obs_epoch
{
//观测历元时刻
int y;
int m;
int d;
int h;
int min;
double sec;
int p_flag;//历元标志
int sat_num;//当前历元所观测到的卫星数量
int gps_num;//当前历元所观测到的GPS卫星数量
int bds_num;//当前历元所观测到的BDS卫星数量
int sPRN[84];//当前历元所能观测到的卫星的PRN列表
int sPRN_GPS[25];
int sPRN_BDS[36];
}obs_epoch,*pobs_epoch;
/* -------------------------------- 观测值数据结构体 -------------------------------- */
typedef struct obs_body
{
double obs_gps[100][24];//GPS观测值
double obs_bds[100][24];//BDS观测值
}obs_body,*pobs_body;
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */ /* -------------------------------------------------------------------------- */
/* 读取O文件 /* 读取O文件
/* -------------------------------------------------------------------------- */ /* -------------------------------------------------------------------------- */
+1 -1
View File
@@ -3,7 +3,7 @@
#include<math.h> #include<math.h>
#include"read.h" #include"public.h"
/* -------------------------------------------------------------------------- */ /* -------------------------------------------------------------------------- */
/// @brief 寻找与观测历元最近的卫星广播历元 /// @brief 寻找与观测历元最近的卫星广播历元
View File
File renamed without changes.
+1 -1
View File
@@ -4,7 +4,7 @@
#include<stdlib.h> #include<stdlib.h>
#include<math.h> #include<math.h>
#include"read.h" #include"public.h"
typedef struct typedef struct
{ {
+3 -3
View File
@@ -14,9 +14,9 @@
#include<string.h> #include<string.h>
#include<unistd.h> #include<unistd.h>
#include"read.h" #include"headers/read.h"
#include"cal_mod.h" #include"headers/cal_mod.h"
#include"terminal.h" #include"headers/terminal.h"
int main(void) int main(void)
{ {
BIN
View File
Binary file not shown.