Archived
See update notes
This commit is contained in:
1 parent
8d22576a73
commit
b28dd3e28d
9 files changed
+1732
-1738
No files matched your search
@@ -36,6 +36,12 @@ Features :
|
|||||||
|
|
||||||
## Project Update
|
## Project Update
|
||||||
|
|
||||||
|
Update: 2024/10/31:
|
||||||
|
1. KNZ_GeoTrackLab: Fix some bug, Modify some UI logic.
|
||||||
|
2. KNZ_GeoTrackLab: Optimize code structure.
|
||||||
|
3. KNZ_GeoTrackLab: New added:
|
||||||
|
Elevation angle option.
|
||||||
|
|
||||||
Update: 2024/10/28
|
Update: 2024/10/28
|
||||||
1. KNZ_GeoTrackLab: Fix some bug.
|
1. KNZ_GeoTrackLab: Fix some bug.
|
||||||
2. KNZ_GeoTrackLab: Optimize code structure.
|
2. KNZ_GeoTrackLab: Optimize code structure.
|
||||||
|
|||||||
@@ -36,6 +36,12 @@
|
|||||||
|
|
||||||
## 项目更新
|
## 项目更新
|
||||||
|
|
||||||
|
更新: 2024/10/31:
|
||||||
|
1. KNZ_GeoTrackLab: 修复一些bug, 优化UI逻辑.
|
||||||
|
2. KNZ_GeoTrackLab: 优化代码结构.
|
||||||
|
3. KNZ_GeoTrackLab: 新增:
|
||||||
|
截止高度角选项。
|
||||||
|
|
||||||
更新:2024/10/28
|
更新:2024/10/28
|
||||||
1. KNZ_GeoTrackLab:修复一些bug。
|
1. KNZ_GeoTrackLab:修复一些bug。
|
||||||
2. KNZ_GeoTrackLab:优化代码结构。
|
2. KNZ_GeoTrackLab:优化代码结构。
|
||||||
|
|||||||
+140
-138
@@ -39,8 +39,10 @@ ioncormode = ['OFF', 'Ion-Free LC', 'Broadcast']
|
|||||||
ioncorstate = 0
|
ioncorstate = 0
|
||||||
trocormode = ['OFF', 'Hopfield', 'Saastamoinen']
|
trocormode = ['OFF', 'Hopfield', 'Saastamoinen']
|
||||||
trocorstate = 0
|
trocorstate = 0
|
||||||
|
h_anglemode = ['0','5','10','15','20','25','30','35','40','45','50']
|
||||||
|
h_anglestate = 0
|
||||||
#Sat system register part
|
#Sat system register part
|
||||||
satsysdict = {1: "G", 4:"R", 2:"C", 3:"E", 5:"S"}
|
satsysdict = {1: "G", 2:"C", 3:"E", 4:"R", 5:"S"}
|
||||||
satellite_system = 1
|
satellite_system = 1
|
||||||
##Combox Count-er
|
##Combox Count-er
|
||||||
ComboxObsCount = 0
|
ComboxObsCount = 0
|
||||||
@@ -50,7 +52,7 @@ Navvalue = ('',)
|
|||||||
ComboxOutCount = 0
|
ComboxOutCount = 0
|
||||||
Outvalue = ('',)
|
Outvalue = ('',)
|
||||||
#
|
#
|
||||||
version = 'ver 1.5.3.1'
|
version = 'ver 1.5.4.1'
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
@@ -67,45 +69,60 @@ def Abo_windows():
|
|||||||
abo = tk.Toplevel(root)
|
abo = tk.Toplevel(root)
|
||||||
abo.title("About")
|
abo.title("About")
|
||||||
abo.attributes('-toolwindow', 2)
|
abo.attributes('-toolwindow', 2)
|
||||||
abo.geometry('200x100')
|
Move_center(abo,200,100)
|
||||||
abo.minsize(200, 100)
|
abo.minsize(200,100)
|
||||||
abo.maxsize(200, 100)
|
abo.maxsize(200,100)
|
||||||
|
|
||||||
About = tk.Label(abo, text="\nKNZ_GeoTrackLab %s\n\nCopyright (c) 2024 by KenanZhu\nAll Right Reserved."%version)
|
About = tk.Label(abo, text="\nKNZ_GeoTrackLab %s\n\nCopyright (c) 2024 by KenanZhu\nAll Right Reserved."%version)
|
||||||
About.pack(side=tk.TOP, expand=tk.YES)
|
About.pack(side=tk.TOP, expand=tk.YES)
|
||||||
|
|
||||||
|
def Move_center(hwnd, win_x, win_y):
|
||||||
|
|
||||||
|
position_x = int((hwnd.winfo_screenwidth() - win_x) / 2)
|
||||||
|
position_y = int((hwnd.winfo_screenheight() - win_y) / 2)
|
||||||
|
|
||||||
|
hwnd.geometry(f'{win_x}x{win_y}+{position_x}+{position_y}')
|
||||||
|
|
||||||
class FUNCTION:
|
class FUNCTION:
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def Colorchoose(i, label, mode):
|
def Colorchoose(hwnd,i, label, mode):
|
||||||
# Brief # choice to change the color of draw
|
# Brief # choice to change the color of draw
|
||||||
# Param # i : only for mode 1
|
# Param # i : for mode 0 & 1
|
||||||
# Param # label : match the label with the button
|
# Param # label : match the label with the button
|
||||||
# Param # mode : color register type
|
# Param # mode : color register type
|
||||||
# undo choice == 0 &
|
# undo choice == 0 &
|
||||||
# middle choice store == 1 &
|
# middle choice store == 1 &
|
||||||
# final confirm == 3 &
|
# final confirm == 3 &
|
||||||
# satn color == 4
|
# satn color == 4 &
|
||||||
|
# satn undo == 5
|
||||||
# Return# none
|
# Return# none
|
||||||
global enucolor
|
global enucolor
|
||||||
if mode == 0:
|
if mode == 0:
|
||||||
enucolor = ["#0080FF", "#0080FF", "#0080FF"]
|
#enucolor = ["#0080FF", "#0080FF", "#0080FF"]
|
||||||
satncolor[0] = "#0080FF"
|
#satncolor[0] = "#0080FF"
|
||||||
label.config(bg=enucolor[0])
|
label.config(bg=enucolor[i])
|
||||||
elif mode == 1:
|
elif mode == 1:
|
||||||
colorvalue = tk.colorchooser.askcolor()
|
colorvalue = tk.colorchooser.askcolor(parent=hwnd)
|
||||||
enucolormid[i] = str(colorvalue[1])
|
if colorvalue[1] is not None:
|
||||||
label.config(bg=str(colorvalue[1]))
|
enucolormid[i] = str(colorvalue[1])
|
||||||
|
label.config(bg=str(colorvalue[1]))
|
||||||
|
else:
|
||||||
|
return
|
||||||
elif mode == 3:
|
elif mode == 3:
|
||||||
enucolor[0] = enucolormid[0]
|
enucolor[0] = enucolormid[0]
|
||||||
enucolor[1] = enucolormid[1]
|
enucolor[1] = enucolormid[1]
|
||||||
enucolor[2] = enucolormid[2]
|
enucolor[2] = enucolormid[2]
|
||||||
satncolor[0] = satncolormid[0]
|
satncolor[0] = satncolormid[0]
|
||||||
elif mode == 4:
|
elif mode == 4:
|
||||||
colorvalue = tk.colorchooser.askcolor()
|
colorvalue = tk.colorchooser.askcolor(parent=hwnd)
|
||||||
satncolormid[0] = str(colorvalue[1])
|
if colorvalue[1] is not None:
|
||||||
label.config(bg=str(colorvalue[1]))
|
satncolormid[0] = str(colorvalue[1])
|
||||||
|
label.config(bg=str(colorvalue[1]))
|
||||||
|
else:
|
||||||
|
return
|
||||||
|
elif mode==5:
|
||||||
|
label.config(bg=satncolor[0])
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def Linewchoose(entry0, entry1, entry2, mode):
|
def Linewchoose(entry0, entry1, entry2, mode):
|
||||||
# Brief # input to change the width of line
|
# Brief # input to change the width of line
|
||||||
@@ -159,7 +176,7 @@ class FUNCTION:
|
|||||||
enulinew[1] = entry1.get()
|
enulinew[1] = entry1.get()
|
||||||
enulinew[2] = entry2.get()
|
enulinew[2] = entry2.get()
|
||||||
|
|
||||||
def Calcu_confirm(self, v, cboxi, cboxt):
|
def Calcu_confirm(self, v, cboxi, cboxt, cboxangle):
|
||||||
# Brief # choice to change the ion & tro correction && confirm the sat system
|
# Brief # choice to change the ion & tro correction && confirm the sat system
|
||||||
# Param # v sat system radio button value
|
# Param # v sat system radio button value
|
||||||
# Param # cboxi the combo box of ion correction
|
# Param # cboxi the combo box of ion correction
|
||||||
@@ -167,10 +184,12 @@ class FUNCTION:
|
|||||||
# Return# none
|
# Return# none
|
||||||
global ioncorstate
|
global ioncorstate
|
||||||
global trocorstate
|
global trocorstate
|
||||||
|
global h_anglestate
|
||||||
global satellite_system
|
global satellite_system
|
||||||
|
|
||||||
ioncorstate = self.Ion_and_Trocbox(cboxi, 0)
|
ioncorstate = self.ITA_cbox(cboxi, 0)
|
||||||
trocorstate = self.Ion_and_Trocbox(cboxt, 1)
|
trocorstate = self.ITA_cbox(cboxt, 1)
|
||||||
|
h_anglestate = self.ITA_cbox(cboxangle, 2)
|
||||||
satellite_system = self.Satsys_button(v)
|
satellite_system = self.Satsys_button(v)
|
||||||
|
|
||||||
print(ioncorstate, trocorstate, satellite_system)
|
print(ioncorstate, trocorstate, satellite_system)
|
||||||
@@ -184,11 +203,12 @@ class FUNCTION:
|
|||||||
return int(Systemdict.get(v.get()))
|
return int(Systemdict.get(v.get()))
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def Ion_and_Trocbox(cbox, cortype):
|
def ITA_cbox(cbox, cortype):
|
||||||
# Brief # get the value of combo box
|
# Brief # get the value of combo box
|
||||||
# Param # cortype: correction type of
|
# Param # cortype: correction type of
|
||||||
# ion == 0 &
|
# ion == 0 &
|
||||||
# tro == 1
|
# tro == 1 &
|
||||||
|
# angle == 2
|
||||||
# Param # cbox:
|
# Param # cbox:
|
||||||
# Return# ion | tro state code
|
# Return# ion | tro state code
|
||||||
count = -1
|
count = -1
|
||||||
@@ -204,11 +224,18 @@ class FUNCTION:
|
|||||||
if cbox.get() == tromode:
|
if cbox.get() == tromode:
|
||||||
return count
|
return count
|
||||||
|
|
||||||
|
elif cortype == 2:
|
||||||
|
for h_angle in h_anglemode:
|
||||||
|
count += 1
|
||||||
|
if cbox.get() == h_angle:
|
||||||
|
return count
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def GetObsFilePath(ObsFileSelectBox):
|
def GetObsFilePath(hwnd, ObsFileSelectBox):
|
||||||
global ComboxObsCount
|
global ComboxObsCount
|
||||||
global Obsvalue
|
global Obsvalue
|
||||||
path = filedialog.askopenfilename(title='RINEX OBS File',
|
path = filedialog.askopenfilename(parent=hwnd,
|
||||||
|
title='RINEX OBS File',
|
||||||
filetypes=[('RINEX OBS File(*.o*.*.*obs.*.*d)', '*.*o;*.*obs;*.*d'),
|
filetypes=[('RINEX OBS File(*.o*.*.*obs.*.*d)', '*.*o;*.*obs;*.*d'),
|
||||||
('All Files', '*.*')])
|
('All Files', '*.*')])
|
||||||
if path and path not in ObsFileSelectBox['value']:
|
if path and path not in ObsFileSelectBox['value']:
|
||||||
@@ -218,10 +245,11 @@ class FUNCTION:
|
|||||||
ObsFileSelectBox.current(ComboxObsCount)
|
ObsFileSelectBox.current(ComboxObsCount)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def GetNavFilePath(NavFileSelectBox):
|
def GetNavFilePath(hwnd, NavFileSelectBox):
|
||||||
global ComboxNavCount
|
global ComboxNavCount
|
||||||
global Navvalue
|
global Navvalue
|
||||||
path = filedialog.askopenfilename(title='RINEX NAV File',
|
path = filedialog.askopenfilename(parent=hwnd,
|
||||||
|
title='RINEX NAV File',
|
||||||
filetypes=[('RINEX NAV File(*.*nav.*.hnav.*.gnav.*.qnav.*.*n.*.*g.*.*h.*.*q.*.*p)',
|
filetypes=[('RINEX NAV File(*.*nav.*.hnav.*.gnav.*.qnav.*.*n.*.*g.*.*h.*.*q.*.*p)',
|
||||||
'*.*nav;*.hnav;*.gnav;*.qnav;*.*n;*.*g;*.*h;*.*q;*.*p'),
|
'*.*nav;*.hnav;*.gnav;*.qnav;*.*n;*.*g;*.*h;*.*q;*.*p'),
|
||||||
('All Files', '*.*')])
|
('All Files', '*.*')])
|
||||||
@@ -232,10 +260,10 @@ class FUNCTION:
|
|||||||
NavFileSelectBox.current(ComboxNavCount)
|
NavFileSelectBox.current(ComboxNavCount)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def AskDirectory(AskDirectorySelectBox):
|
def AskDirectory(hwnd, AskDirectorySelectBox):
|
||||||
global ComboxOutCount
|
global ComboxOutCount
|
||||||
global Outvalue
|
global Outvalue
|
||||||
path = filedialog.askdirectory()
|
path = filedialog.askdirectory(parent=hwnd)
|
||||||
if path and path not in AskDirectorySelectBox['value']:
|
if path and path not in AskDirectorySelectBox['value']:
|
||||||
Outvalue += (path,)
|
Outvalue += (path,)
|
||||||
AskDirectorySelectBox['value'] += (path + "/*.sp",)
|
AskDirectorySelectBox['value'] += (path + "/*.sp",)
|
||||||
@@ -305,7 +333,8 @@ class FUNCTION:
|
|||||||
|
|
||||||
dll = cdll.LoadLibrary('./brdm2pos.dll')
|
dll = cdll.LoadLibrary('./brdm2pos.dll')
|
||||||
dll.brdm2pos.restype = c_double
|
dll.brdm2pos.restype = c_double
|
||||||
match dll.brdm2pos(nav_path.encode(), obs_path.encode(), res_path.encode(), satellite_system):
|
match dll.brdm2pos(nav_path.encode(), obs_path.encode(), res_path.encode(),
|
||||||
|
satellite_system, int(h_anglemode[h_anglestate])):
|
||||||
case 0.0:
|
case 0.0:
|
||||||
ExecuteState.config(text='Generated successfully ! file : %s' % obsfile + ".sp")
|
ExecuteState.config(text='Generated successfully ! file : %s' % obsfile + ".sp")
|
||||||
case -1.0:
|
case -1.0:
|
||||||
@@ -322,9 +351,6 @@ class FUNCTION:
|
|||||||
ExecuteState.config(text='Error ! no obs data')
|
ExecuteState.config(text='Error ! no obs data')
|
||||||
windll.kernel32.FreeLibrary('./brdm2pos.dll')
|
windll.kernel32.FreeLibrary('./brdm2pos.dll')
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def _ExecuteFile(self,ExecuteState,
|
def _ExecuteFile(self,ExecuteState,
|
||||||
ObsSelectBoxVar,
|
ObsSelectBoxVar,
|
||||||
NavSelectBoxVar,
|
NavSelectBoxVar,
|
||||||
@@ -377,7 +403,7 @@ class MAINGUI:
|
|||||||
|
|
||||||
def initGUI(self, hwnd):
|
def initGUI(self, hwnd):
|
||||||
hwnd.title("KNZ_GeoTrackLab %s"%version)
|
hwnd.title("KNZ_GeoTrackLab %s"%version)
|
||||||
hwnd.geometry('1200x700')
|
Move_center(hwnd,1200,700)
|
||||||
hwnd.minsize(1200, 700)
|
hwnd.minsize(1200, 700)
|
||||||
|
|
||||||
icon_img = (b'AAABAAEAICAAAAEAIACoEAAAFgAAACgAAAAgAAAAQAAAAAEAIAAAAAAAgBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA'
|
icon_img = (b'AAABAAEAICAAAAEAIACoEAAAFgAAACgAAAAgAAAAQAAAAAEAIAAAAAAAgBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA'
|
||||||
@@ -614,7 +640,7 @@ class MAINGUI:
|
|||||||
self.canvas0.draw()
|
self.canvas0.draw()
|
||||||
|
|
||||||
self.satn.clear()
|
self.satn.clear()
|
||||||
self.satn.plot(satnumnarry[0, :], marker='_', linestyle=None, color=satncolor[0], linewidth=0)
|
self.satn.plot(satnumnarry[0, :], marker='|', ms=5, linestyle=None, color=satncolor[0], linewidth=0)
|
||||||
self.satn.set_title('Valid Sat Numbers', loc='left', fontsize=8)
|
self.satn.set_title('Valid Sat Numbers', loc='left', fontsize=8)
|
||||||
self.satn.set_xlabel('Epochs')
|
self.satn.set_xlabel('Epochs')
|
||||||
self.satn.grid(True, linestyle='--', alpha=0.7)
|
self.satn.grid(True, linestyle='--', alpha=0.7)
|
||||||
@@ -630,19 +656,6 @@ class MAINGUI:
|
|||||||
# Const define
|
# Const define
|
||||||
self.sattrack.clear()
|
self.sattrack.clear()
|
||||||
C_V = 299792458
|
C_V = 299792458
|
||||||
f1 = 1575.42
|
|
||||||
f2 = 1227.60
|
|
||||||
|
|
||||||
match satsysdict.get(satellite_system):
|
|
||||||
case 'G':
|
|
||||||
f1 = 1575.42
|
|
||||||
f2 = 1227.60
|
|
||||||
case 'E':
|
|
||||||
f1 = 1575.42
|
|
||||||
f2 = 1278.75
|
|
||||||
case 'C':
|
|
||||||
f1 = 1561.098
|
|
||||||
f2 = 1207.140
|
|
||||||
|
|
||||||
ENU_O = np.empty((3, 0))
|
ENU_O = np.empty((3, 0))
|
||||||
GDOP = np.empty((1, 0))
|
GDOP = np.empty((1, 0))
|
||||||
@@ -676,7 +689,7 @@ class MAINGUI:
|
|||||||
obspath = len(Obs)
|
obspath = len(Obs)
|
||||||
while obspath > 0:
|
while obspath > 0:
|
||||||
flag = Obs[obspath - 1:obspath]
|
flag = Obs[obspath - 1:obspath]
|
||||||
if flag == "/":
|
if flag == "/" or flag == "\\":
|
||||||
obsfile = satsysdict.get(satellite_system) + "-" + Obs[obspath:-4]
|
obsfile = satsysdict.get(satellite_system) + "-" + Obs[obspath:-4]
|
||||||
break
|
break
|
||||||
obspath -= 1
|
obspath -= 1
|
||||||
@@ -700,7 +713,7 @@ class MAINGUI:
|
|||||||
"@ GENERATE SYS : %s\n"
|
"@ GENERATE SYS : %s\n"
|
||||||
"@ IONOS OPT : %s\n"
|
"@ IONOS OPT : %s\n"
|
||||||
"@ TROPO OPT : %s\n"
|
"@ TROPO OPT : %s\n"
|
||||||
"@\n\n" % ( version
|
"@\n\n" % ( version
|
||||||
, time.asctime(time.localtime())
|
, time.asctime(time.localtime())
|
||||||
, satsysdict.get(satellite_system)
|
, satsysdict.get(satellite_system)
|
||||||
, ioncormode[ioncorstate]
|
, ioncormode[ioncorstate]
|
||||||
@@ -711,9 +724,9 @@ class MAINGUI:
|
|||||||
|
|
||||||
# Coordinate transformation matrix---------------#
|
# Coordinate transformation matrix---------------#
|
||||||
S = np.array([
|
S = np.array([
|
||||||
[-math.sin(apL), math.cos(apL), 0],
|
[-math.sin(apL) , math.cos(apL) , 0 ],
|
||||||
[-math.sin(apB) * math.cos(apL), -math.sin(apB) * math.sin(apL), math.cos(apB)],
|
[-math.sin(apB) * math.cos(apL), -math.sin(apB) * math.sin(apL), math.cos(apB)],
|
||||||
[math.cos(apB) * math.cos(apL), math.cos(apB) * math.sin(apL), math.sin(apB)]
|
[ math.cos(apB) * math.cos(apL), math.cos(apB) * math.sin(apL), math.sin(apB)]
|
||||||
])
|
])
|
||||||
# -----------------------------------------------#
|
# -----------------------------------------------#
|
||||||
self.plotstate.config(text="Reading...")
|
self.plotstate.config(text="Reading...")
|
||||||
@@ -733,9 +746,9 @@ class MAINGUI:
|
|||||||
satY = np.empty((1, 0))
|
satY = np.empty((1, 0))
|
||||||
satZ = np.empty((1, 0))
|
satZ = np.empty((1, 0))
|
||||||
C1 = np.empty((1, 0))
|
C1 = np.empty((1, 0))
|
||||||
C2 = np.empty((1, 0))
|
|
||||||
ma = np.empty((1, 0))
|
ma = np.empty((1, 0))
|
||||||
np.empty((1, 0))
|
|
||||||
Dt = np.empty((1, 0))
|
Dt = np.empty((1, 0))
|
||||||
|
|
||||||
year = int(line[6:10])
|
year = int(line[6:10])
|
||||||
@@ -798,39 +811,14 @@ class MAINGUI:
|
|||||||
n = -((satZ[0, count] - ap_Z) / R)
|
n = -((satZ[0, count] - ap_Z) / R)
|
||||||
B = np.vstack((B, [l, m, n, 1]))
|
B = np.vstack((B, [l, m, n, 1]))
|
||||||
Ptem.append(pow(math.sin(math.radians(ma[0, count])), 2))
|
Ptem.append(pow(math.sin(math.radians(ma[0, count])), 2))
|
||||||
Pl = 0
|
|
||||||
# Get the tropsphere correction
|
# Get the tropsphere correction
|
||||||
match trocorstate:
|
match trocorstate:
|
||||||
case 0:
|
case 0:Tro = 0
|
||||||
Tro = 0
|
case 1:Tro = Trocor.Hop_tro_cor(apH, ma[0, count])
|
||||||
case 1:
|
case 2:Tro = Trocor.Sas_tro_cor(apB, apH, ma[0, count])
|
||||||
Tro = Trocor.Hop_tro_cor(apH, ma[0, count])
|
|
||||||
case 2:
|
|
||||||
Tro = Trocor.Sas_tro_cor(apB, apH, ma[0, count])
|
|
||||||
pass
|
|
||||||
# Get the ionsphere correction
|
|
||||||
match ioncorstate:
|
|
||||||
case 0:
|
|
||||||
if C1[0, count] == 0 and C2[0, count] != 0:
|
|
||||||
Pl = C2[0, count]
|
|
||||||
|
|
||||||
elif C1[0, count] != 0 and C2[0, count] == 0:
|
|
||||||
Pl = C1[0, count]
|
|
||||||
case 1:
|
|
||||||
if C2[0, count] != 0 and C1[0, count] != 0:
|
|
||||||
Pl = (f1 * f1 * C1[0, count]) / (f1 * f1 - f2 * f2) - (
|
|
||||||
f2 * f2 * C2[0, count]) / (f1 * f1 - f2 * f2)
|
|
||||||
|
|
||||||
elif C1[0, count] == 0 and C2[0, count] != 0:
|
|
||||||
Pl = C2[0, count]
|
|
||||||
|
|
||||||
elif C1[0, count] != 0 and C2[0, count] == 0:
|
|
||||||
Pl = C1[0, count]
|
|
||||||
case 2:
|
|
||||||
pass
|
|
||||||
|
|
||||||
L = np.vstack(
|
L = np.vstack(
|
||||||
( L, [Pl - R + C_V * Dt[0, count] - Tro] )
|
( L, [C1[0, count] - R + C_V * Dt[0, count] - Tro] )
|
||||||
)
|
)
|
||||||
|
|
||||||
count += 1
|
count += 1
|
||||||
@@ -850,19 +838,18 @@ class MAINGUI:
|
|||||||
DeltaXYZ = np.array([[X - apX], [Y - apY], [Z - apZ]])
|
DeltaXYZ = np.array([[X - apX], [Y - apY], [Z - apZ]])
|
||||||
ENU = S @ DeltaXYZ
|
ENU = S @ DeltaXYZ
|
||||||
#if math.fabs(ENU[0, 0]) > 25 or math.fabs(ENU[1, 0]) > 25 or math.fabs(ENU[2, 0]) > 50:
|
#if math.fabs(ENU[0, 0]) > 25 or math.fabs(ENU[1, 0]) > 25 or math.fabs(ENU[2, 0]) > 50:
|
||||||
# ENU_O = np.hstack((ENU_O, [[0], [0], [0]]))
|
# ENU_O = np.hstack((ENU_O, [[0], [0], [0]]))
|
||||||
# print("------------ ANOMALY RESOLUTION", file=of)
|
# print("------------ ANOMALY RESOLUTION", file=of)
|
||||||
#else:
|
#else:
|
||||||
|
|
||||||
ENU_O = np.hstack((ENU_O, [[ENU[0, 0]], [ENU[1, 0]], [ENU[2, 0]]]))
|
ENU_O = np.hstack((ENU_O, [[ENU[0, 0]], [ENU[1, 0]], [ENU[2, 0]]]))
|
||||||
GDOP = np.hstack((GDOP, [ [math.sqrt(Qtrace)] ]))
|
GDOP = np.hstack((GDOP, [ [math.sqrt(Qtrace)] ]))
|
||||||
|
|
||||||
print(
|
print(
|
||||||
"%4d\\%02d\\%02d\\%02d\\%02d\\%04.1f %12.4f %12.4f %12.4f %3d %10.5f %10.5f %10.5f"
|
"%4d\\%02d\\%02d\\%02d\\%02d\\%04.1f %12.4f %12.4f %12.4f %3d %10.5f %10.5f %10.5f"
|
||||||
% (year, month, day, hour, min, sec, X, Y, Z, satnum,
|
% (year, month, day, hour, min, sec, X, Y, Z, satnum,
|
||||||
float(ENU[0, 0]),
|
float(ENU[0, 0]),
|
||||||
float(ENU[1, 0]),
|
float(ENU[1, 0]),
|
||||||
float(ENU[2, 0]) ), file=of)
|
float(ENU[2, 0]) ), file=of)
|
||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
break
|
break
|
||||||
@@ -875,9 +862,8 @@ class MAINGUI:
|
|||||||
satY = np.hstack((satY, [[float(line[22:37])]]))
|
satY = np.hstack((satY, [[float(line[22:37])]]))
|
||||||
satZ = np.hstack((satZ, [[float(line[38:53])]]))
|
satZ = np.hstack((satZ, [[float(line[38:53])]]))
|
||||||
C1 = np.hstack((C1, [[float(line[55:69])]]))
|
C1 = np.hstack((C1, [[float(line[55:69])]]))
|
||||||
C2 = np.hstack((C2, [[float(line[71:85])]]))
|
ma = np.hstack((ma, [[float(line[71:85])]]))
|
||||||
ma = np.hstack((ma, [[float(line[86:101])]]))
|
Dt = np.hstack((Dt, [[float(line[86:102])]]))
|
||||||
Dt = np.hstack((Dt, [[float(line[102:118])]]))
|
|
||||||
|
|
||||||
elif line.find("END") >= 0:
|
elif line.find("END") >= 0:
|
||||||
self.ex.clear()
|
self.ex.clear()
|
||||||
@@ -904,7 +890,7 @@ class MAINGUI:
|
|||||||
self.canvas0.draw()
|
self.canvas0.draw()
|
||||||
|
|
||||||
self.satn.clear()
|
self.satn.clear()
|
||||||
self.satn.plot(satnumnarry[0, :], marker='_', ms=10, linestyle=None, color=satncolor[0], linewidth=0)
|
self.satn.plot(satnumnarry[0, :], marker='|', ms=5, linestyle=None, color=satncolor[0], linewidth=0)
|
||||||
self.satn.set_title('Valid Satellite Numbers',loc='left', fontsize=8)
|
self.satn.set_title('Valid Satellite Numbers',loc='left', fontsize=8)
|
||||||
self.satn.set_xlabel('Epochs')
|
self.satn.set_xlabel('Epochs')
|
||||||
self.satn.grid(True, linestyle='--', alpha=0.7)
|
self.satn.grid(True, linestyle='--', alpha=0.7)
|
||||||
@@ -939,10 +925,10 @@ class OPTGUI:
|
|||||||
def initGUI(self,hwnd):
|
def initGUI(self,hwnd):
|
||||||
self.opthwnd = tk.Toplevel(hwnd)
|
self.opthwnd = tk.Toplevel(hwnd)
|
||||||
self.opthwnd.title("Options")
|
self.opthwnd.title("Options")
|
||||||
self.opthwnd.resizable(0, 0)
|
self.opthwnd.resizable(0,0)
|
||||||
self.opthwnd.geometry('320x250')
|
Move_center(self.opthwnd,320,250)
|
||||||
self.opthwnd.minsize(320, 250)
|
self.opthwnd.minsize(320,250)
|
||||||
self.opthwnd.maxsize(320, 250)
|
self.opthwnd.maxsize(320,250)
|
||||||
|
|
||||||
icon_img2 = (b'AAABAAEAICAAAAAAIACoEAAAFgAAACgAAAAgAAAAQAAAAAEAIAAAAAAAABAAADjsAAA47AAAAAA'
|
icon_img2 = (b'AAABAAEAICAAAAAAIACoEAAAFgAAACgAAAAgAAAAQAAAAAEAIAAAAAAAABAAADjsAAA47AAAAAA'
|
||||||
b'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA'
|
b'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA'
|
||||||
@@ -1066,6 +1052,22 @@ class OPTGUI:
|
|||||||
self.ctrobox.current(trocorstate)
|
self.ctrobox.current(trocorstate)
|
||||||
self.ctrobox.pack(side=tk.RIGHT, anchor='e')
|
self.ctrobox.pack(side=tk.RIGHT, anchor='e')
|
||||||
|
|
||||||
|
|
||||||
|
TOP3Frame0 = ttk.Frame(self.Main1Frame0)
|
||||||
|
TOP3Frame0.pack(side=tk.TOP, expand=tk.YES, padx='1px', pady='2px', fill=tk.X)
|
||||||
|
|
||||||
|
h_angle = ttk.Label(TOP3Frame0, text='Satellite Elevation(°) / #')
|
||||||
|
h_angle.pack(side=tk.LEFT, anchor='w', padx='1px')
|
||||||
|
|
||||||
|
self.angleentry = ttk.Entry(TOP3Frame0, width=8)
|
||||||
|
self.angleentry.pack(side=tk.RIGHT, anchor='w')
|
||||||
|
|
||||||
|
self.canglebox = ttk.Combobox(TOP3Frame0, width=6, height=10)
|
||||||
|
self.canglebox['state'] = 'readonly'
|
||||||
|
self.canglebox['value'] = ('0','5','10','15','20','25','30','35','40','45','50')
|
||||||
|
self.canglebox.current(h_anglestate)
|
||||||
|
self.canglebox.pack(side=tk.RIGHT, anchor='e')
|
||||||
|
|
||||||
# GNSS Options#
|
# GNSS Options#
|
||||||
TOP5Frame0 = ttk.LabelFrame(self.Main1Frame0, text='Satellite system', labelanchor='nw')
|
TOP5Frame0 = ttk.LabelFrame(self.Main1Frame0, text='Satellite system', labelanchor='nw')
|
||||||
TOP5Frame0.pack(side=tk.TOP, expand=tk.YES, padx='1px', pady='2px', fill=tk.X)
|
TOP5Frame0.pack(side=tk.TOP, expand=tk.YES, padx='1px', pady='2px', fill=tk.X)
|
||||||
@@ -1132,15 +1134,15 @@ class OPTGUI:
|
|||||||
SatnFrameB1 = tk.Frame(Buttom1Frame1)
|
SatnFrameB1 = tk.Frame(Buttom1Frame1)
|
||||||
SatnFrameB1.pack(side=tk.LEFT, expand=tk.YES, padx='5px', pady='0px')
|
SatnFrameB1.pack(side=tk.LEFT, expand=tk.YES, padx='5px', pady='0px')
|
||||||
satncolopt = ttk.Button(SatnFrameB1, text='Satn Color', width=10,
|
satncolopt = ttk.Button(SatnFrameB1, text='Satn Color', width=10,
|
||||||
command=lambda: self.Cmd.Colorchoose(0, satncollab, 4))
|
command=lambda: self.Cmd.Colorchoose(self.opthwnd,0, satncollab, 4))
|
||||||
satncolopt.pack(side=tk.LEFT, expand=tk.YES, padx='5px', pady='0px')
|
satncolopt.pack(side=tk.LEFT, expand=tk.YES, padx='5px', pady='0px')
|
||||||
satncollab = tk.Label(SatnFrameB1, width=5, height=1, bg=satncolormid[0])
|
satncollab = tk.Label(SatnFrameB1, width=5, height=1, bg=satncolor[0])
|
||||||
satncollab.pack(side=tk.LEFT, expand=tk.YES, padx='5px', pady='0px')
|
satncollab.pack(side=tk.LEFT, expand=tk.YES, padx='5px', pady='0px')
|
||||||
|
|
||||||
LineConB1 = tk.Frame(Buttom1Frame1)
|
LineConB1 = tk.Frame(Buttom1Frame1)
|
||||||
LineConB1.pack(side=tk.RIGHT, expand=tk.YES, padx='5px', pady='0px')
|
LineConB1.pack(side=tk.RIGHT, expand=tk.YES, padx='5px', pady='0px')
|
||||||
linewre = ttk.Button(LineConB1, text='Undo', width=10,
|
linewre = ttk.Button(LineConB1, text='Undo', width=10,
|
||||||
command=lambda: self.Cmd.Colorchoose(0, satncollab, 0))
|
command=lambda: self.Cmd.Colorchoose(self.opthwnd,0, satncollab, 5))
|
||||||
linewre.pack(side=tk.LEFT, expand=tk.YES, padx='1px')
|
linewre.pack(side=tk.LEFT, expand=tk.YES, padx='1px')
|
||||||
|
|
||||||
# Line's colors options#
|
# Line's colors options#
|
||||||
@@ -1150,7 +1152,7 @@ class OPTGUI:
|
|||||||
EFrameL2 = tk.Frame(Left2Frame1)
|
EFrameL2 = tk.Frame(Left2Frame1)
|
||||||
EFrameL2.pack(side=tk.TOP, expand=tk.YES, padx='5px', pady='0px')
|
EFrameL2.pack(side=tk.TOP, expand=tk.YES, padx='5px', pady='0px')
|
||||||
ecolopt = ttk.Button(EFrameL2, text='E Color', width=10,
|
ecolopt = ttk.Button(EFrameL2, text='E Color', width=10,
|
||||||
command=lambda: self.Cmd.Colorchoose(0, ecollab, 1))
|
command=lambda: self.Cmd.Colorchoose(self.opthwnd,0, ecollab, 1))
|
||||||
ecolopt.pack(side=tk.LEFT, expand=tk.YES, padx='5px', pady='0px')
|
ecolopt.pack(side=tk.LEFT, expand=tk.YES, padx='5px', pady='0px')
|
||||||
ecollab = tk.Label(EFrameL2, width=5, height=1, bg=enucolor[0])
|
ecollab = tk.Label(EFrameL2, width=5, height=1, bg=enucolor[0])
|
||||||
ecollab.pack(side=tk.LEFT, expand=tk.YES, padx='5px', pady='0px')
|
ecollab.pack(side=tk.LEFT, expand=tk.YES, padx='5px', pady='0px')
|
||||||
@@ -1158,7 +1160,7 @@ class OPTGUI:
|
|||||||
NFrameL2 = tk.Frame(Left2Frame1)
|
NFrameL2 = tk.Frame(Left2Frame1)
|
||||||
NFrameL2.pack(side=tk.TOP, expand=tk.YES, padx='5px', pady='0px')
|
NFrameL2.pack(side=tk.TOP, expand=tk.YES, padx='5px', pady='0px')
|
||||||
ncolopt = ttk.Button(NFrameL2, text='N Color', width=10,
|
ncolopt = ttk.Button(NFrameL2, text='N Color', width=10,
|
||||||
command=lambda: self.Cmd.Colorchoose(1, ncollab, 1))
|
command=lambda: self.Cmd.Colorchoose(self.opthwnd,1, ncollab, 1))
|
||||||
ncolopt.pack(side=tk.LEFT, expand=tk.YES, padx='5px', pady='0px')
|
ncolopt.pack(side=tk.LEFT, expand=tk.YES, padx='5px', pady='0px')
|
||||||
ncollab = tk.Label(NFrameL2, width=5, height=1, bg=enucolor[1])
|
ncollab = tk.Label(NFrameL2, width=5, height=1, bg=enucolor[1])
|
||||||
ncollab.pack(side=tk.LEFT, expand=tk.YES, padx='5px', pady='0px')
|
ncollab.pack(side=tk.LEFT, expand=tk.YES, padx='5px', pady='0px')
|
||||||
@@ -1166,7 +1168,7 @@ class OPTGUI:
|
|||||||
UFrameL2 = tk.Frame(Left2Frame1)
|
UFrameL2 = tk.Frame(Left2Frame1)
|
||||||
UFrameL2.pack(side=tk.TOP, expand=tk.YES, padx='5px', pady='0px')
|
UFrameL2.pack(side=tk.TOP, expand=tk.YES, padx='5px', pady='0px')
|
||||||
ucolopt = ttk.Button(UFrameL2, text='U Color', width=10,
|
ucolopt = ttk.Button(UFrameL2, text='U Color', width=10,
|
||||||
command=lambda: self.Cmd.Colorchoose(2, ucollab, 1))
|
command=lambda: self.Cmd.Colorchoose(self.opthwnd,2, ucollab, 1))
|
||||||
ucolopt.pack(side=tk.LEFT, expand=tk.YES, padx='5px', pady='0px')
|
ucolopt.pack(side=tk.LEFT, expand=tk.YES, padx='5px', pady='0px')
|
||||||
ucollab = tk.Label(UFrameL2, width=5, height=1, bg=enucolor[2])
|
ucollab = tk.Label(UFrameL2, width=5, height=1, bg=enucolor[2])
|
||||||
ucollab.pack(side=tk.LEFT, expand=tk.YES, padx='5px', pady='0px')
|
ucollab.pack(side=tk.LEFT, expand=tk.YES, padx='5px', pady='0px')
|
||||||
@@ -1174,9 +1176,9 @@ class OPTGUI:
|
|||||||
ColorConL2 = tk.Frame(Left2Frame1)
|
ColorConL2 = tk.Frame(Left2Frame1)
|
||||||
ColorConL2.pack(side=tk.TOP, expand=tk.YES, padx='5px', pady='0px')
|
ColorConL2.pack(side=tk.TOP, expand=tk.YES, padx='5px', pady='0px')
|
||||||
colorcon = ttk.Button(ColorConL2, text='Undo', width=10,
|
colorcon = ttk.Button(ColorConL2, text='Undo', width=10,
|
||||||
command=lambda: [self.Cmd.Colorchoose(0, ecollab, 0)
|
command=lambda: [self.Cmd.Colorchoose(self.opthwnd,0, ecollab, 0)
|
||||||
, self.Cmd.Colorchoose(0, ncollab, 0)
|
, self.Cmd.Colorchoose(self.opthwnd,1, ncollab, 0)
|
||||||
, self.Cmd.Colorchoose(0, ucollab, 0)])
|
, self.Cmd.Colorchoose(self.opthwnd,2, ucollab, 0)])
|
||||||
colorcon.pack(side=tk.LEFT, expand=tk.YES, padx='5px', pady='0px')
|
colorcon.pack(side=tk.LEFT, expand=tk.YES, padx='5px', pady='0px')
|
||||||
|
|
||||||
def initCONFIRM(self):
|
def initCONFIRM(self):
|
||||||
@@ -1187,12 +1189,11 @@ class OPTGUI:
|
|||||||
command=lambda: [self.opthwnd.destroy()])
|
command=lambda: [self.opthwnd.destroy()])
|
||||||
TotalCancel.pack(side=tk.RIGHT, padx='1px', anchor='e')
|
TotalCancel.pack(side=tk.RIGHT, padx='1px', anchor='e')
|
||||||
TotalCon = ttk.Button(Bottom0Frame0, text='Confirm', width=10,
|
TotalCon = ttk.Button(Bottom0Frame0, text='Confirm', width=10,
|
||||||
command=lambda: [self.Cmd.Colorchoose(0, None, 3),
|
command=lambda: [self.Cmd.Colorchoose(self.opthwnd,0, None, 3),
|
||||||
self.Cmd.Linewchoose(self.elinewidth,
|
self.Cmd.Linewchoose(self.elinewidth,
|
||||||
self.nlinewidth,
|
self.nlinewidth,
|
||||||
self.ulinewidth, 1),
|
self.ulinewidth, 1),
|
||||||
self.Cmd.Calcu_confirm(self.v, self.cionbox, self.ctrobox),
|
self.Cmd.Calcu_confirm(self.v, self.cionbox, self.ctrobox, self.canglebox)])
|
||||||
self.opthwnd.destroy()])
|
|
||||||
TotalCon.pack(side=tk.RIGHT, padx='1px', anchor='e')
|
TotalCon.pack(side=tk.RIGHT, padx='1px', anchor='e')
|
||||||
|
|
||||||
class EXECUDUI:
|
class EXECUDUI:
|
||||||
@@ -1213,10 +1214,10 @@ class EXECUDUI:
|
|||||||
def initGUI(self,hwnd):
|
def initGUI(self,hwnd):
|
||||||
self.exehwnd = tk.Toplevel(hwnd)
|
self.exehwnd = tk.Toplevel(hwnd)
|
||||||
self.exehwnd.title("RINEX Processor")
|
self.exehwnd.title("RINEX Processor")
|
||||||
self.exehwnd.resizable(0, 0)
|
self.exehwnd.resizable(0,0)
|
||||||
self.exehwnd.geometry('400x215')
|
Move_center(self.exehwnd,550,180)
|
||||||
self.exehwnd.minsize(400, 215)
|
self.exehwnd.minsize(550,180)
|
||||||
self.exehwnd.maxsize(400, 215)
|
self.exehwnd.maxsize(550,180)
|
||||||
|
|
||||||
global icon_img3
|
global icon_img3
|
||||||
icon_img3 = (b'AAABAAEAICAAAAEAIACoEAAAFgAAACgAAAAgAAAAQAAAAAEAIAAAAAAAABAAADjsAAA47AAAAAAAAAAAAAAAAAAAAAAAAAA'
|
icon_img3 = (b'AAABAAEAICAAAAEAIACoEAAAFgAAACgAAAAgAAAAQAAAAAEAIAAAAAAAABAAADjsAAA47AAAAAAAAAAAAAAAAAAAAAAAAAA'
|
||||||
@@ -1289,41 +1290,41 @@ class EXECUDUI:
|
|||||||
MainFrame0 = tk.Frame(self.exehwnd)
|
MainFrame0 = tk.Frame(self.exehwnd)
|
||||||
MainFrame0.pack()
|
MainFrame0.pack()
|
||||||
TopFrame1 = ttk.Frame(MainFrame0)
|
TopFrame1 = ttk.Frame(MainFrame0)
|
||||||
TopFrame1.pack(side=tk.TOP, expand=tk.YES, padx='1px', pady='2px', fill=tk.X)
|
TopFrame1.pack(side=tk.TOP, expand=tk.YES, padx='1px', pady='1px', fill=tk.X)
|
||||||
|
|
||||||
# -----------------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------------
|
||||||
ObsInFrame3 = ttk.LabelFrame(TopFrame1, text='RINEX Obs File')
|
ObsInFrame3 = ttk.LabelFrame(TopFrame1, text='RINEX Obs File')
|
||||||
ObsInFrame3.pack(side=tk.TOP, expand=tk.YES, padx='1px', pady='2px', fill=tk.X)
|
ObsInFrame3.pack(side=tk.TOP, expand=tk.YES, padx='1px', pady='0px', fill=tk.X)
|
||||||
|
|
||||||
ObsFileSelectBox = ttk.Combobox(ObsInFrame3, width=46, height=4, values=Obsvalue,
|
ObsFileSelectBox = ttk.Combobox(ObsInFrame3, width=70, height=4, values=Obsvalue,
|
||||||
textvariable=self.ObsSelectBoxVar)
|
textvariable=self.ObsSelectBoxVar)
|
||||||
ObsFileSelectBox.current(ComboxObsCount)
|
ObsFileSelectBox.current(ComboxObsCount)
|
||||||
ObsFileSelectBox.pack(side=tk.LEFT, anchor='w', padx='1px', pady='1px')
|
ObsFileSelectBox.pack(side=tk.LEFT, anchor='w', padx='0px', pady='0px')
|
||||||
|
|
||||||
ObsFileSelectButton = ttk.Button(ObsInFrame3, text='...', width=3,
|
ObsFileSelectButton = ttk.Button(ObsInFrame3, text='...', width=3,
|
||||||
command=lambda: self.Cmd.GetObsFilePath(ObsFileSelectBox))
|
command=lambda: self.Cmd.GetObsFilePath(self.exehwnd,ObsFileSelectBox))
|
||||||
ObsFileSelectButton.pack(side=tk.RIGHT, anchor='e', padx='1px', pady='1px')
|
ObsFileSelectButton.pack(side=tk.RIGHT, anchor='e', padx='1px', pady='0px')
|
||||||
# -----------------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------------
|
||||||
|
|
||||||
#-----------------------------------------------------------------------------------
|
#-----------------------------------------------------------------------------------
|
||||||
NavInFrame3 = ttk.LabelFrame(TopFrame1, text='RINEX Nav File')
|
NavInFrame3 = ttk.LabelFrame(TopFrame1, text='RINEX Nav File')
|
||||||
NavInFrame3.pack(side=tk.TOP, expand=tk.YES, padx='1px', pady='2px', fill=tk.X)
|
NavInFrame3.pack(side=tk.TOP, expand=tk.YES, padx='1px', pady='0px', fill=tk.X)
|
||||||
|
|
||||||
NavFileSelectBox = ttk.Combobox(NavInFrame3, width=46, height=4, values=Navvalue,
|
NavFileSelectBox = ttk.Combobox(NavInFrame3, width=70, height=4, values=Navvalue,
|
||||||
textvariable=self.NavSelectBoxVar)
|
textvariable=self.NavSelectBoxVar)
|
||||||
NavFileSelectBox.current(ComboxNavCount)
|
NavFileSelectBox.current(ComboxNavCount)
|
||||||
NavFileSelectBox.pack(side=tk.LEFT, anchor='w', padx='1px', pady='1px')
|
NavFileSelectBox.pack(side=tk.LEFT, anchor='w', padx='0px', pady='0px')
|
||||||
|
|
||||||
NavFileSelectButton = ttk.Button(NavInFrame3, text='...', width=3,
|
NavFileSelectButton = ttk.Button(NavInFrame3, text='...', width=3,
|
||||||
command=lambda: self.Cmd.GetNavFilePath(NavFileSelectBox))
|
command=lambda: self.Cmd.GetNavFilePath(self.exehwnd,NavFileSelectBox))
|
||||||
NavFileSelectButton.pack(side=tk.RIGHT, anchor='e', padx='1px', pady='1px')
|
NavFileSelectButton.pack(side=tk.RIGHT, anchor='e', padx='1px', pady='0px')
|
||||||
# -----------------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------------
|
||||||
|
|
||||||
BottomFrame1 = ttk.Frame(MainFrame0)
|
BottomFrame1 = ttk.Frame(MainFrame0)
|
||||||
BottomFrame1.pack(side=tk.BOTTOM, expand=tk.YES, padx='1px', pady='2px', fill=tk.X)
|
BottomFrame1.pack(side=tk.BOTTOM, expand=tk.YES, padx='1px', pady='0px', fill=tk.X)
|
||||||
|
|
||||||
FileOutFrame3 = ttk.LabelFrame(BottomFrame1, text='Output Directory')
|
FileOutFrame3 = ttk.LabelFrame(BottomFrame1, text='Output Directory')
|
||||||
FileOutFrame3.pack(side=tk.TOP, expand=tk.YES, padx='1px', pady='2px', fill=tk.X)
|
FileOutFrame3.pack(side=tk.TOP, expand=tk.YES, padx='1px', pady='0px', fill=tk.X)
|
||||||
|
|
||||||
## CheckButton Initialize
|
## CheckButton Initialize
|
||||||
AskOrNotCheckButton = ttk.Checkbutton(FileOutFrame3, text='Directory',
|
AskOrNotCheckButton = ttk.Checkbutton(FileOutFrame3, text='Directory',
|
||||||
@@ -1332,21 +1333,21 @@ class EXECUDUI:
|
|||||||
self.AskOrNotCheckButtonVar,
|
self.AskOrNotCheckButtonVar,
|
||||||
AskDirectorySelectBox,
|
AskDirectorySelectBox,
|
||||||
AskDirectorySelectButton))
|
AskDirectorySelectButton))
|
||||||
AskOrNotCheckButton.pack(side=tk.LEFT, anchor='w', padx='1px', pady='0px')
|
AskOrNotCheckButton.pack(side=tk.LEFT, anchor='w', padx='0px', pady='0px')
|
||||||
|
|
||||||
## SelectBox Initialize
|
## SelectBox Initialize
|
||||||
AskDirectorySelectBox = ttk.Combobox(FileOutFrame3, width=36, height=4, values=Outvalue,
|
AskDirectorySelectBox = ttk.Combobox(FileOutFrame3, width=60, height=4, values=Outvalue,
|
||||||
state=tk.DISABLED, textvariable=self.DirectorySelectBoxVar)
|
state=tk.DISABLED, textvariable=self.DirectorySelectBoxVar)
|
||||||
AskDirectorySelectBox.current(ComboxOutCount)
|
AskDirectorySelectBox.current(ComboxOutCount)
|
||||||
AskDirectorySelectBox.pack(side=tk.LEFT, anchor='w', padx='1px', pady='0px')
|
AskDirectorySelectBox.pack(side=tk.LEFT, anchor='w', padx='0px', pady='0px')
|
||||||
|
|
||||||
## SelectButton Initialize
|
## SelectButton Initialize
|
||||||
AskDirectorySelectButton = ttk.Button(FileOutFrame3, text='...', width=3,
|
AskDirectorySelectButton = ttk.Button(FileOutFrame3, text='...', width=3, state=tk.DISABLED,
|
||||||
state=tk.DISABLED, command=lambda: self.Cmd.AskDirectory(AskDirectorySelectBox))
|
command=lambda: self.Cmd.AskDirectory(self.exehwnd, AskDirectorySelectBox))
|
||||||
AskDirectorySelectButton.pack(side=tk.RIGHT, anchor='e', padx='2px', pady='0px')
|
AskDirectorySelectButton.pack(side=tk.RIGHT, anchor='e', padx='1px', pady='0px')
|
||||||
|
|
||||||
ExeFrame3 = ttk.Frame(BottomFrame1)
|
ExeFrame3 = ttk.Frame(BottomFrame1)
|
||||||
ExeFrame3.pack(side=tk.TOP, expand=tk.YES, padx='1px', pady='2px', fill=tk.X)
|
ExeFrame3.pack(side=tk.TOP, expand=tk.YES, padx='1px', pady='0px', fill=tk.X)
|
||||||
|
|
||||||
ExitButton = ttk.Button(ExeFrame3, text='Exit', width=10,
|
ExitButton = ttk.Button(ExeFrame3, text='Exit', width=10,
|
||||||
command=self.exehwnd.destroy)
|
command=self.exehwnd.destroy)
|
||||||
@@ -1372,7 +1373,8 @@ def View_windowshow(text, view):
|
|||||||
# Param # text : the show box of file of choice
|
# Param # text : the show box of file of choice
|
||||||
# Param # view : the father window of text ctr box
|
# Param # view : the father window of text ctr box
|
||||||
# Return# none
|
# Return# none
|
||||||
f_path = filedialog.askopenfilename()
|
f_path = filedialog.askopenfilename(parent=view)
|
||||||
|
if not f_path: return 0
|
||||||
view.title('Viewing: %s' % f_path)
|
view.title('Viewing: %s' % f_path)
|
||||||
text.delete('1.0', 'end')
|
text.delete('1.0', 'end')
|
||||||
with open(f_path, 'r') as f:
|
with open(f_path, 'r') as f:
|
||||||
@@ -1388,7 +1390,7 @@ class VIEWGUI:
|
|||||||
def initGUI(hwnd):
|
def initGUI(hwnd):
|
||||||
view = tk.Toplevel(hwnd)
|
view = tk.Toplevel(hwnd)
|
||||||
view.title("View")
|
view.title("View")
|
||||||
view.geometry('900x600')
|
Move_center(view,1000,600)
|
||||||
view.minsize(1000, 600)
|
view.minsize(1000, 600)
|
||||||
|
|
||||||
global icon_img1
|
global icon_img1
|
||||||
|
|||||||
+285
-353
@@ -8,398 +8,330 @@
|
|||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
|
||||||
#endif // _BRDM2POS_H_
|
#endif // _BRDM2POS_H_
|
||||||
|
|
||||||
/* CALCU CONST*/
|
/* CALCU CONST*/
|
||||||
#define C_V 299792458
|
#define C_V 299792458 /* Speed of light (m/s) */
|
||||||
#define GM 398600500000000
|
#define GM 398600500000000 /* */
|
||||||
#define math_e 2.718281828459
|
#define math_e 2.718281828459 /* Natural constant e */
|
||||||
#define PI 3.141592653589793
|
#define PI 3.141592653589793 /* Ratio of circumference to diameter */
|
||||||
#define Earth_e 7.2921151467e-5
|
#define Earth_e 7.2921151467e-5 /* Rotational angular velocity of the earths (omega/s) */
|
||||||
#define C20 1.0826257e-3
|
#define C20 1.0826257e-3 /* */
|
||||||
|
#define DAYSEC 86400 /* The total second of a day */
|
||||||
/*WGS-84 CONST*/
|
/*WGS-84 CONST*/
|
||||||
#define a 6378137.0
|
#define a 6378137.0
|
||||||
#define e2 (0.0033528106647475*(2 - 0.0033528106647475))
|
#define e2 (0.0033528106647475*(2 - 0.0033528106647475))
|
||||||
/*PZ-90 CONST*/
|
/*PZ-90 CONST*/
|
||||||
#define TSTEP 30.0
|
#define TSTEP 30.0 /* RK-4 step */
|
||||||
/*GNSS OBSERV TYPE*/
|
/*GNSS OBSERV TYPE*/
|
||||||
|
#define FREQ1 1.57542E9 /* L1/E1/B1C frequency (Hz) */
|
||||||
|
#define FREQ2 1.22760E9 /* L2 frequency (Hz) */
|
||||||
|
#define FREQ5 1.17645E9 /* L5/E5a/B2a frequency (Hz) */
|
||||||
|
#define FREQ6 1.27875E9 /* E6/L6 frequency (Hz) */
|
||||||
|
#define FREQ7 1.20714E9 /* E5b frequency (Hz) */
|
||||||
|
#define FREQ8 1.191795E9 /* E5a+b frequency (Hz) */
|
||||||
|
#define FREQ9 2.492028E9 /* S frequency (Hz) */
|
||||||
|
#define FREQ1_GLO 1.60200E9 /* GLONASS G1 base frequency (Hz) */
|
||||||
|
#define DFRQ1_GLO 0.56250E6 /* GLONASS G1 bias frequency (Hz/n) */
|
||||||
|
#define FREQ2_GLO 1.24600E9 /* GLONASS G2 base frequency (Hz) */
|
||||||
|
#define DFRQ2_GLO 0.43750E6 /* GLONASS G2 bias frequency (Hz/n) */
|
||||||
|
#define FREQ3_GLO 1.202025E9 /* GLONASS G3 frequency (Hz) */
|
||||||
|
#define FREQ1a_GLO 1.600995E9 /* GLONASS G1a frequency (Hz) */
|
||||||
|
#define FREQ2a_GLO 1.248060E9 /* GLONASS G2a frequency (Hz) */
|
||||||
|
#define FREQ1_BDS 1.561098E9 /* BDS B1I frequency (Hz) */
|
||||||
|
#define FREQ2_BDS 1.20714E9 /* BDS B2I/B2b frequency (Hz) */
|
||||||
|
#define FREQ3_BDS 1.26852E9 /* BDS B3 frequency (Hz) */
|
||||||
//frequency 1
|
//frequency 1
|
||||||
#define C1 100
|
#define C1 100
|
||||||
#define C1A 100
|
#define C1A 100
|
||||||
#define C1B 101
|
#define C1B 101
|
||||||
#define C1C 102
|
#define C1C 102
|
||||||
#define C1D 103
|
#define C1D 103
|
||||||
#define C1E
|
#define C1L 104
|
||||||
#define C1F
|
#define C1M 105
|
||||||
#define C1G
|
#define C1P 106
|
||||||
#define C1H
|
#define C1S 107
|
||||||
#define C1I
|
#define C1X 108
|
||||||
#define C1J
|
#define C1Y 109
|
||||||
#define C1K
|
#define C1Z 110
|
||||||
#define C1L 104
|
|
||||||
#define C1M 105
|
|
||||||
#define C1N
|
|
||||||
#define C1O
|
|
||||||
#define C1P 106
|
|
||||||
#define C1Q
|
|
||||||
#define C1R
|
|
||||||
#define C1S 107
|
|
||||||
#define C1T
|
|
||||||
#define C1U
|
|
||||||
#define C1V
|
|
||||||
#define C1W
|
|
||||||
#define C1X 108
|
|
||||||
#define C1Y 109
|
|
||||||
#define C1Z 110
|
|
||||||
//frequency 2
|
//frequency 2
|
||||||
#define C2 200
|
#define C2 200
|
||||||
#define C2A
|
#define C2C 200
|
||||||
#define C2B
|
#define C2D 201
|
||||||
#define C2C 200
|
#define C2I 202
|
||||||
#define C2D 201
|
#define C2L 203
|
||||||
#define C2E
|
#define C2M 204
|
||||||
#define C2F
|
#define C2P 205
|
||||||
#define C2G
|
#define C2Q 206
|
||||||
#define C2H
|
|
||||||
#define C2I 202
|
|
||||||
#define C2J
|
|
||||||
#define C2K
|
|
||||||
#define C2L 203
|
|
||||||
#define C2M 204
|
|
||||||
#define C2N
|
|
||||||
#define C2O
|
|
||||||
#define C2P 205
|
|
||||||
#define C2Q 206
|
|
||||||
#define C2R
|
#define C2R
|
||||||
#define C2S 207
|
#define C2S 207
|
||||||
#define C2T
|
#define C2X 208
|
||||||
#define C2U
|
#define C2Y 209
|
||||||
#define C2V
|
#define C2Z 210
|
||||||
#define C2W
|
|
||||||
#define C2X 208
|
|
||||||
#define C2Y 209
|
|
||||||
#define C2Z 210
|
|
||||||
//frequency 3
|
//frequency 3
|
||||||
#define C3 300
|
#define C3 300
|
||||||
#define C3I 300
|
#define C3I 300
|
||||||
#define C3Q 301
|
#define C3Q 301
|
||||||
#define C3X 302
|
#define C3X 302
|
||||||
//frequency 4
|
//frequency 4
|
||||||
#define C4 400
|
#define C4 400
|
||||||
#define C4A 400
|
#define C4A 400
|
||||||
#define C4B 401
|
#define C4B 401
|
||||||
#define C4X 402
|
#define C4X 402
|
||||||
//frequency 5
|
//frequency 5
|
||||||
#define C5 500
|
#define C5 500
|
||||||
#define C5A
|
#define C5I 500
|
||||||
#define C5B
|
#define C5Q 501
|
||||||
#define C5C
|
#define C5X 502
|
||||||
#define C5D
|
|
||||||
#define C5E
|
|
||||||
#define C5F
|
|
||||||
#define C5G
|
|
||||||
#define C5H
|
|
||||||
#define C5I 500
|
|
||||||
#define C5J
|
|
||||||
#define C5K
|
|
||||||
#define C5L
|
|
||||||
#define C5M
|
|
||||||
#define C5N
|
|
||||||
#define C5O
|
|
||||||
#define C5P
|
|
||||||
#define C5Q 501
|
|
||||||
#define C5R
|
|
||||||
#define C5S
|
|
||||||
#define C5T
|
|
||||||
#define C5U
|
|
||||||
#define C5V
|
|
||||||
#define C5W
|
|
||||||
#define C5X 502
|
|
||||||
#define C5Y
|
|
||||||
#define C5Z
|
|
||||||
//frequency 6
|
//frequency 6
|
||||||
#define C6 600
|
#define C6 600
|
||||||
#define C6A 600
|
#define C6A 600
|
||||||
#define C6B 601
|
#define C6B 601
|
||||||
#define C6C 602
|
#define C6C 602
|
||||||
#define C6D
|
#define C6X 603
|
||||||
#define C6E
|
#define C6Z 604
|
||||||
#define C6F
|
|
||||||
#define C6G
|
|
||||||
#define C6H
|
|
||||||
#define C6I
|
|
||||||
#define C6J
|
|
||||||
#define C6K
|
|
||||||
#define C6L
|
|
||||||
#define C6M
|
|
||||||
#define C6N
|
|
||||||
#define C6O
|
|
||||||
#define C6P
|
|
||||||
#define C6Q
|
|
||||||
#define C6R
|
|
||||||
#define C6S
|
|
||||||
#define C6T
|
|
||||||
#define C6U
|
|
||||||
#define C6V
|
|
||||||
#define C6W
|
|
||||||
#define C6X 603
|
|
||||||
#define C6Y
|
|
||||||
#define C6Z 604
|
|
||||||
//frequency 7
|
//frequency 7
|
||||||
#define C7 700
|
#define C7 700
|
||||||
#define C7A
|
#define C7I 700
|
||||||
#define C7B
|
#define C7Q 701
|
||||||
#define C7C
|
#define C7X 702
|
||||||
#define C7D
|
|
||||||
#define C7E
|
|
||||||
#define C7F
|
|
||||||
#define C7G
|
|
||||||
#define C7H
|
|
||||||
#define C7I 700
|
|
||||||
#define C7J
|
|
||||||
#define C7K
|
|
||||||
#define C7L
|
|
||||||
#define C7M
|
|
||||||
#define C7N
|
|
||||||
#define C7O
|
|
||||||
#define C7P
|
|
||||||
#define C7Q 701
|
|
||||||
#define C7R
|
|
||||||
#define C7S
|
|
||||||
#define C7T
|
|
||||||
#define C7U
|
|
||||||
#define C7V
|
|
||||||
#define C7W
|
|
||||||
#define C7X 702
|
|
||||||
#define C7Y
|
|
||||||
#define C7Z
|
|
||||||
//frequency 8
|
//frequency 8
|
||||||
#define C8 800
|
#define C8 800
|
||||||
#define C8I 800
|
#define C8I 800
|
||||||
#define C8Q 801
|
#define C8Q 801
|
||||||
#define C8X 802
|
#define C8X 802
|
||||||
/*GNSS CODE*/
|
/*GNSS CODE*/
|
||||||
#define GPS 01
|
#define GPS 01
|
||||||
#define BDS 02
|
#define BDS 02
|
||||||
#define GAL 03
|
#define GAL 03
|
||||||
#define GLO 04
|
#define GLO 04
|
||||||
#define SBAS 05
|
#define SBAS 05
|
||||||
|
|
||||||
#define MAXRINEX 1000
|
#define MAXRINEX 4096 /* Max length of line of rinex file */
|
||||||
#define DAYSEC 86400
|
#define MAXPATH 260 /* Max length of file path */
|
||||||
//satellite position & clock bias structure
|
|
||||||
typedef struct
|
typedef struct pos_ts{//Satellite position
|
||||||
{
|
double X;
|
||||||
double X;
|
double Y;
|
||||||
double Y;
|
double Z;
|
||||||
double Z;
|
double deltat;
|
||||||
double deltat;
|
double delta_t;
|
||||||
double delta_t;
|
double delta_clk;
|
||||||
double delta_clk;
|
|
||||||
}pos_ts;
|
}pos_ts;
|
||||||
//receiver station position & clock bias structure
|
|
||||||
typedef struct
|
typedef struct stations{//
|
||||||
{
|
double X;
|
||||||
double X;
|
double Y;
|
||||||
double Y;
|
double Z;
|
||||||
double Z;
|
double B;
|
||||||
double B;
|
double L;
|
||||||
double L;
|
double H;
|
||||||
double H;
|
double delta_TR;
|
||||||
double delta_TR;
|
|
||||||
}stations;
|
}stations;
|
||||||
//longitude & latitude structure
|
|
||||||
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;
|
|
||||||
}blhs;
|
|
||||||
//satellite azimuth angle structure
|
|
||||||
typedef struct
|
|
||||||
{
|
|
||||||
double R;
|
|
||||||
double A;
|
|
||||||
double H;
|
|
||||||
}rahcal;
|
|
||||||
//local Cartesian coordinates coordinate system structure
|
|
||||||
typedef struct
|
|
||||||
{
|
|
||||||
double E;
|
|
||||||
double N;
|
|
||||||
double U;
|
|
||||||
}blh2enu;
|
|
||||||
|
|
||||||
typedef struct
|
typedef struct rah{//
|
||||||
{
|
double R;
|
||||||
double B;
|
double A;
|
||||||
double L;
|
double H;
|
||||||
double H;
|
}rah;
|
||||||
}xyz2blh;
|
|
||||||
//header data of file of nav
|
typedef struct enu{//East/North/Up coordinate system
|
||||||
typedef struct nav_head
|
double E;
|
||||||
{
|
double N;
|
||||||
double ver;//rinex
|
double U;
|
||||||
char type[20];
|
}enu;
|
||||||
double ION_GPSA[4];
|
|
||||||
double ION_GPSB[4];
|
typedef struct blh{//Longitude/Latitude/Altitude coordinate system
|
||||||
double ION_BDSA[4];
|
double B;
|
||||||
double ION_BDSB[4];
|
double L;
|
||||||
double ION_QZSA[4];
|
double H;
|
||||||
double ION_QZSB[4];
|
}blh;
|
||||||
double ION_IRNA[4];
|
|
||||||
double ION_IRNB[4];
|
typedef struct blhdms{//Longitude/Latitude/Altitude coordinate system
|
||||||
double GPUT[4];
|
//With Degree/Minute/Second
|
||||||
double GLUT[4];
|
double B;
|
||||||
double GAUT[4];
|
int B_d;
|
||||||
double BDUT[4];
|
int B_m;
|
||||||
double QZUT[4];
|
int B_s;
|
||||||
double IRUT[4];
|
double L;
|
||||||
double SBUT[4];
|
int L_d;
|
||||||
int leap;
|
int L_m;
|
||||||
|
int L_s;
|
||||||
|
double H;
|
||||||
|
}blhdms;
|
||||||
|
|
||||||
|
|
||||||
|
typedef struct nav_head{//Header data of file of nav
|
||||||
|
double ver; /* RINEX version */
|
||||||
|
char type[20]; /* RINEX file format */
|
||||||
|
|
||||||
|
double ION_GPSA[4]; /* Ionosphere correction parameters alpha GPS */
|
||||||
|
double ION_GPSB[4]; /* Ionosphere correction parameters belta GPS */
|
||||||
|
double ION_BDSA[4]; /* Ionosphere correction parameters alpha BeiDou */
|
||||||
|
double ION_BDSB[4]; /* Ionosphere correction parameters belta BeiDou */
|
||||||
|
double ION_QZSA[4]; /* Ionosphere correction parameters alpha QZSS */
|
||||||
|
double ION_QZSB[4]; /* Ionosphere correction parameters belta QZSS */
|
||||||
|
double ION_IRNA[4]; /* Ionosphere correction parameters alpha */
|
||||||
|
double ION_IRNB[4]; /* Ionosphere correction parameters belta */
|
||||||
|
|
||||||
|
double GPUT[4]; /* Time system correction of GPST */
|
||||||
|
double GLUT[4]; /* Time system correction of GLONASST */
|
||||||
|
double GAUT[4]; /* Time system correction of GALT */
|
||||||
|
double BDUT[4]; /* Time system correction of BDT */
|
||||||
|
double QZUT[4]; /* Time system correction of QZST */
|
||||||
|
double IRUT[4]; /* Time system correction of */
|
||||||
|
double SBUT[4]; /* Time system correction of SBAST */
|
||||||
|
|
||||||
|
int leap; /* Leap second */
|
||||||
}nav_head, * pnav_head;
|
}nav_head, * pnav_head;
|
||||||
//body data of file of nav: GPS BeiDou Galileo
|
|
||||||
typedef struct nav_body
|
|
||||||
{
|
|
||||||
int sPRN_GPS; int sPRN_BDS; int sPRN_GAL; int sPRN_GLO;
|
|
||||||
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 Dos;
|
|
||||||
|
|
||||||
double IODE; double AODE; double SatX;
|
typedef struct nav_body{//Body data of file of nav: GPS BeiDou Galileo GLONASS
|
||||||
double Crs; double SatXv;
|
|
||||||
double deltan; double SatXa;
|
|
||||||
double M0;
|
|
||||||
|
|
||||||
double Cuc; double SatY;
|
/* GPS BeiDou Galileo GLONASS*/
|
||||||
double e; double SatYv;
|
int sPRN_GPS; int sPRN_BDS; int sPRN_GAL; int sPRN_GLO;/* System */
|
||||||
double Cus; double SatYa;
|
int TOC_Y;
|
||||||
double sqrtA; int FreN;
|
int TOC_M;
|
||||||
|
int TOC_D;
|
||||||
|
int TOC_H;
|
||||||
|
int TOC_Min;
|
||||||
|
int TOC_Sec;
|
||||||
|
double sa0;
|
||||||
|
double sa1;
|
||||||
|
double sa2; double Dos;
|
||||||
|
|
||||||
double TOE; double SatZ;
|
double IODE; double AODE; double SatX;
|
||||||
double Cic; double SatZv;
|
double Crs; double SatXv;
|
||||||
double OMEGA; double SatZa;
|
double deltan; double SatXa;
|
||||||
double Cis; int AOO;
|
double M0;
|
||||||
|
|
||||||
double i0;
|
double Cuc; double SatY;
|
||||||
double Crc;
|
double e; double SatYv;
|
||||||
double omega;
|
double Cus; double SatYa;
|
||||||
double deltaomega;
|
double sqrtA; int FreN;
|
||||||
|
|
||||||
double IDOT;
|
double TOE; double SatZ;
|
||||||
double L2code; int Datasource;
|
double Cic; double SatZv;
|
||||||
double GPSweek; double BDTweek; double GALweek;
|
double OMEGA; double SatZa;
|
||||||
double L2Pflag;
|
double Cis; int AOO;
|
||||||
|
|
||||||
double sACC;
|
double i0;
|
||||||
double sHEA;
|
double Crc;
|
||||||
double TGD; double TGD1; double BGDa;
|
double omega;
|
||||||
double IODC; double TGD2; double BGDb;
|
double deltaomega;
|
||||||
|
|
||||||
double TTN;
|
double IDOT;
|
||||||
double fit; double AODC;
|
double L2code; int Datasource;
|
||||||
double spare1;
|
double GPSweek; double BDTweek; double GALweek;
|
||||||
double spare2;
|
double L2Pflag;
|
||||||
|
|
||||||
|
double sACC;
|
||||||
|
double sHEA;
|
||||||
|
double TGD; double TGD1; double BGDa;
|
||||||
|
double IODC; double TGD2; double BGDb;
|
||||||
|
|
||||||
|
double TTN;
|
||||||
|
double fit; double AODC;
|
||||||
|
double spare1;
|
||||||
|
double spare2;
|
||||||
|
|
||||||
}nav_body, * pnav_body;
|
}nav_body, * pnav_body;
|
||||||
//header data of file of obs
|
|
||||||
typedef struct obs_head
|
typedef struct obs_head{//Header data of file of obs
|
||||||
{
|
double ver;
|
||||||
double ver;
|
char type[30];
|
||||||
char type[30];
|
|
||||||
double apX;
|
double apX;
|
||||||
double apY;
|
double apY;
|
||||||
double apZ;
|
double apZ;
|
||||||
double ANTH;
|
|
||||||
double ANTdeltaE;
|
double apB;
|
||||||
double ANTdeltaN;
|
double apL;
|
||||||
int obstypenum_gps;
|
double apH;
|
||||||
int obstypenum_bds;
|
|
||||||
int obstypenum_gal;
|
double ANTH;
|
||||||
int obstypenum_glo;
|
double ANTdeltaE;
|
||||||
int obscode_gps[40];
|
double ANTdeltaN;
|
||||||
int obscode_bds[40];
|
|
||||||
int obscode_gal[40];
|
int obstypenum_gps; /* Observation amount of GPS */
|
||||||
int obscode_glo[40];
|
int obstypenum_bds; /* Observation amount of BeiDou */
|
||||||
double interval;
|
int obstypenum_gal; /* Observation amount of Galilro */
|
||||||
int f_y;
|
int obstypenum_glo; /* Observation amount of GLONASS */
|
||||||
int f_m;
|
|
||||||
int f_d;
|
int obscode_gps[40];/* Observation code of GPS */
|
||||||
int f_h;
|
int obscode_bds[40];/* Observation code of BeiDou */
|
||||||
int f_min;
|
int obscode_gal[40];/* Observation code of Galileo */
|
||||||
double f_sec;
|
int obscode_glo[40];/* Observation code of GLONASS */
|
||||||
int l_y;
|
|
||||||
int l_m;
|
double interval; /* */
|
||||||
int l_d;
|
|
||||||
int l_h;
|
int f_y; /* Year of first observe */
|
||||||
int l_min;
|
int f_m; /* Month of first observe */
|
||||||
double l_sec;
|
int f_d; /* Day of first observe */
|
||||||
char tsys[5];//time system
|
int f_h; /* Hour of first observe */
|
||||||
|
int f_min; /* Minute of first observe */
|
||||||
|
double f_sec; /* Second of first observe */
|
||||||
|
|
||||||
|
int l_y; /* Year of last observe */
|
||||||
|
int l_m; /* Month of last observe */
|
||||||
|
int l_d; /* Day of last observe */
|
||||||
|
int l_h; /* Hour of last observe */
|
||||||
|
int l_min; /* Minute of last observe */
|
||||||
|
double l_sec; /* Second of last observe */
|
||||||
|
|
||||||
|
char tsys[5]; /* Time system of obs */
|
||||||
}obs_head, * pobs_head;
|
}obs_head, * pobs_head;
|
||||||
//epoch data of file of obs
|
|
||||||
typedef struct obs_epoch
|
typedef struct obs_epoch{//Epoch data of file of obs
|
||||||
{
|
int y; /* Epoch year */
|
||||||
int y;
|
int m; /* Epoch month */
|
||||||
int m;
|
int d; /* Epoch day */
|
||||||
int d;
|
int h; /* Epoch hour */
|
||||||
int h;
|
int min; /* Epoch minute */
|
||||||
int min;
|
double sec; /* Epoch second */
|
||||||
double sec;//epoch time
|
int p_flag; /* Epoch flag */
|
||||||
int p_flag;//epoch flag
|
int sat_num; /* The total number of obsable sat */
|
||||||
int sat_num;//the total number of obsable sat
|
int gps_num; /* The total GPS satellite */
|
||||||
int gps_num;//the total gps sat
|
int bds_num; /* The total BeiDou satellite */
|
||||||
int bds_num;//the total bds sat
|
int gal_num; /* The total Galileo satellite */
|
||||||
int gal_num;//the total galileo sat
|
int glo_num; /* The total GLONASS satellite */
|
||||||
int glo_num;//the total glonass sat
|
int sPRN[84]; /* Total sprn of obs satellite */
|
||||||
int sPRN[84];//total sprn of obs sat
|
int sPRN_GPS[32];/* Total sprn of GPS satellite in this epoch */
|
||||||
int sPRN_GPS[32];
|
int sPRN_BDS[60];/* Total sprn of BeiDou satellite in this epoch */
|
||||||
int sPRN_BDS[60];
|
int sPRN_GAL[30];/* Total sprn of Galileo satellite in this epoch */
|
||||||
int sPRN_GAL[30];
|
int sPRN_GLO[24];/* Total sprn of GLONASS satellite in this epoch */
|
||||||
int sPRN_GLO[24];
|
|
||||||
}obs_epoch, * pobs_epoch;
|
}obs_epoch, * pobs_epoch;
|
||||||
//body data of file of obs
|
|
||||||
typedef struct obs_body
|
typedef struct obs_body{//Body data of file of obs
|
||||||
{
|
double obs_gps[30][26];/* GPS obs data */
|
||||||
double obs_gps[20][26];//GPS obs data
|
double obs_bds[40][26];/* BeiDou obs data */
|
||||||
double obs_bds[30][26];//BDS obs data
|
double obs_gal[30][26];/* Galileo obs data */
|
||||||
double obs_gal[20][26];//GALILEO obs data
|
double obs_glo[30][26];/* GLONASS obs data */
|
||||||
double obs_glo[20][26];//GLONASS obs data
|
|
||||||
}obs_body, * pobs_body;
|
}obs_body, * pobs_body;
|
||||||
//
|
|
||||||
|
//Contain in timesys.cpp
|
||||||
extern double JDUTC2GPST(double);
|
extern double JDUTC2GPST(double);
|
||||||
extern double Time2GPST(int, int, int, double, int, double);
|
extern double Time2GPST(int, int, int, double, int, double);
|
||||||
extern double UTCTime2JD(int, int, int, double, int, double);
|
extern double UTCTime2JD(int, int, int, double, int, double);
|
||||||
//
|
//Contain in coordtrans.cpp
|
||||||
extern double deg2rad(double);
|
extern double deg2rad(double);
|
||||||
extern double rad2deg(double);
|
extern double rad2deg(double);
|
||||||
//
|
extern rah rahcal(rah, double, double, double);
|
||||||
extern rahcal RAHCAL(rahcal, double, double, double);
|
extern enu blh2enu(enu, double, double, double, double, double);
|
||||||
extern blh2enu BLH2ENU(blh2enu, double, double, double, double, double);
|
extern blh xyz2blh(blh, double, double, double);
|
||||||
extern xyz2blh XYZ2BLH(xyz2blh, double, double, double);
|
//Contain in readrnx.cpp
|
||||||
//
|
extern int getsatnum(FILE*);
|
||||||
extern int getsatnum(FILE*);
|
extern int get_epochnum(FILE*);
|
||||||
extern int get_epochnum(FILE*);
|
|
||||||
extern void initobs_e(pobs_epoch, pobs_body);
|
|
||||||
extern void freeobs_e(pobs_epoch, pobs_body);
|
extern void freeobs_e(pobs_epoch, pobs_body);
|
||||||
extern int Type2Code(int, char buff[MAXRINEX]);
|
extern int type2code(int, char buff[MAXRINEX]);
|
||||||
extern int Code2Type(int, int, int typearr[36]);
|
extern int code2type(int, int, int typearr[36]);
|
||||||
extern int select_epoch(double, int, pnav_body, int, int);
|
extern int select_epoch(double, int, pnav_body, int, int);
|
||||||
//
|
//Contain in readrnx.cpp/read
|
||||||
extern void read_n_h(FILE*, pnav_head);
|
extern void read_n_h(FILE*, pnav_head);
|
||||||
extern void read_n_b(FILE*, pnav_body);
|
extern void read_n_b(FILE*, pnav_body);
|
||||||
extern void read_o_h(FILE*, pobs_head);
|
extern void read_o_h(FILE*, pobs_head);
|
||||||
extern void read_o_eb(FILE*, pobs_head, pobs_epoch, pobs_body);
|
extern void read_o_eb(FILE*, pobs_head, pobs_epoch, pobs_body);
|
||||||
//
|
//Contain in solutionout.cpp
|
||||||
extern "C" _declspec(dllexport) double brdm2pos(char nav_path[260], char obs_path[260], char res_path[260], int gnsscode);
|
extern FILE* outputheader(pobs_head, char obs_path[MAXPATH], char nav_path[MAXPATH], char res_path[MAXPATH]);
|
||||||
|
extern void outputbodydata(pobs_head, pobs_body, pos_ts, rah, FILE*, int, int, int);
|
||||||
|
//Entry function
|
||||||
|
extern "C" _declspec(dllexport) double brdm2pos(char nav_path[MAXPATH], char obs_path[MAXPATH], char res_path[MAXPATH],
|
||||||
|
int GNSS, int Hangle);
|
||||||
|
|
||||||
+60
-57
@@ -1,57 +1,61 @@
|
|||||||
#include "brdm2pos.h"
|
#include "brdm2pos.h"
|
||||||
using namespace std;
|
using namespace std;
|
||||||
/* -------------------------------------------------------------------------- */
|
/**
|
||||||
/// @brief degree to radian
|
* Degree to radian.
|
||||||
/// @param deg
|
*
|
||||||
/// @return return radian
|
* \param deg: Degree
|
||||||
/* -------------------------------------------------------------------------- */
|
* \return Radian
|
||||||
|
*/
|
||||||
double deg2rad(double deg)
|
double deg2rad(double deg)
|
||||||
{
|
{
|
||||||
double rad = (PI / 180) * deg;
|
double rad = (PI / 180) * deg;
|
||||||
return rad;
|
return rad;
|
||||||
}
|
}
|
||||||
/* -------------------------------------------------------------------------- */
|
/**
|
||||||
/// @brief radian to degree
|
* Radian to degree .
|
||||||
/// @param rad
|
*
|
||||||
/// @return return degree
|
* \param rad: Radian
|
||||||
/* -------------------------------------------------------------------------- */
|
* \return Degree
|
||||||
|
*/
|
||||||
double rad2deg(double rad)
|
double rad2deg(double rad)
|
||||||
{
|
{
|
||||||
double deg = (180 / PI) * rad;
|
double deg = (180 / PI) * rad;
|
||||||
return deg;
|
return deg;
|
||||||
}
|
}
|
||||||
/* -------------------------------------------------------------------------- */
|
/**
|
||||||
/// @brief satellite azimuth angle calculation
|
* Azimuth/Calculate.
|
||||||
/// @param rahcal parameter transfer structure
|
*
|
||||||
/// @param E east
|
* \param rah: Parameter transfer structure
|
||||||
/// @param N north
|
* \param E: East
|
||||||
/// @param U up
|
* \param N: North
|
||||||
/// @return return structure contain R, A, H members
|
* \param U: Up
|
||||||
/* -------------------------------------------------------------------------- */
|
* \return structure contain R, A, H members
|
||||||
rahcal RAHCAL(rahcal rahcal,
|
*/
|
||||||
|
rah rahcal(rah rah,
|
||||||
double E, double N, double U)
|
double E, double N, double U)
|
||||||
{
|
{
|
||||||
rahcal.H = atan2(U, sqrt(E * E + N * N));
|
rah.H = atan2(U, sqrt(E * E + N * N));
|
||||||
rahcal.A = atan2(E, U);
|
rah.A = atan2(E, U);
|
||||||
if (rahcal.A < 0)
|
if (rah.A < 0)
|
||||||
rahcal.A += 2 * PI;
|
rah.A += 2 * PI;
|
||||||
if (rahcal.A > 2 * PI)
|
if (rah.A > 2 * PI)
|
||||||
rahcal.A -= 2 * PI;
|
rah.A -= 2 * PI;
|
||||||
rahcal.R = sqrt(E * E + N * N + U * U);
|
rah.R = sqrt(E * E + N * N + U * U);
|
||||||
|
|
||||||
return rahcal;
|
return rah;
|
||||||
}
|
}
|
||||||
/* -------------------------------------------------------------------------- */
|
/**
|
||||||
/// @brief convert BLH coordinates to ENU coordinates
|
* Convert BLH coordinates to ENU coordinates.
|
||||||
/// @param blh2enu parameter transfer structure
|
*
|
||||||
/// @param stationB latitude of receiver station
|
* \param enu: Parameter transfer structure
|
||||||
/// @param stationL longitude of receiver station
|
* \param stationB: Latitude of receiver station
|
||||||
/// @param deltax X-coordinate difference of satellite arrival center
|
* \param stationL: Longitude of receiver station
|
||||||
/// @param deltay Y-coordinate difference of satellite arrival center
|
* \param deltax: Deltax X-coordinate difference of satellite arrival center
|
||||||
/// @param deltaz Z-coordinate difference of satellite arrival center
|
* \param deltay: Deltax Y-coordinate difference of satellite arrival center
|
||||||
/// @return return type of structure contain E, N, U members
|
* \param deltaz: Deltax Z-coordinate difference of satellite arrival center
|
||||||
/* -------------------------------------------------------------------------- */
|
* \return
|
||||||
blh2enu BLH2ENU(blh2enu blh2enu,
|
*/
|
||||||
|
enu blh2enu(enu enu,
|
||||||
double stationB, double stationL,
|
double stationB, double stationL,
|
||||||
double deltax, double deltay, double deltaz)
|
double deltax, double deltay, double deltaz)
|
||||||
{
|
{
|
||||||
@@ -59,29 +63,28 @@ blh2enu BLH2ENU(blh2enu blh2enu,
|
|||||||
double cosB = cos(stationB);
|
double cosB = cos(stationB);
|
||||||
double sinL = sin(stationL);
|
double sinL = sin(stationL);
|
||||||
double cosL = cos(stationL);
|
double cosL = cos(stationL);
|
||||||
blh2enu.E = -sinL * (deltax)+cosL * (deltay);
|
enu.E = -sinL * (deltax) +cosL * (deltay);
|
||||||
blh2enu.N = -sinB * cosL * (deltax)-sinB * sinL * (deltay)+cosB * (deltaz);
|
enu.N = -sinB * cosL * (deltax)-sinB * sinL * (deltay)+cosB * (deltaz);
|
||||||
blh2enu.U = cosB * cosL * (deltax)+cosB * sinL * (deltay)+sinB * (deltaz);
|
enu.U = cosB * cosL * (deltax)+cosB * sinL * (deltay)+sinB * (deltaz);
|
||||||
|
|
||||||
return blh2enu;
|
return enu;
|
||||||
}
|
}
|
||||||
/* -------------------------------------------------------------------------- */
|
/**
|
||||||
/// @brief Convert ECEF geostationary coordinates to BLH coordinates
|
* Convert ECEF geostationary coordinates to BLH coordinates.
|
||||||
/// @param xyz2blh parameter transfer structure
|
*
|
||||||
/// @param X X coordinates of ECEF
|
* \param blh: Parameter transfer structure
|
||||||
/// @param Y Y coordinates of ECEF
|
* \param X: X coordinates of ECEF
|
||||||
/// @param Z Z coordinates of ECEF
|
* \param Y; Y coordinates of ECEF
|
||||||
/// @param a major semiaxis of WGS-84 ellipsoid
|
* \param Z: Z coordinates of ECEF
|
||||||
/// @param e2 the square of the first eccentricity of WGS-84 ellipsoid
|
* \return type of structure contain B, L, H members
|
||||||
/// @return return type of structure contain B, L, H members
|
*/
|
||||||
/* -------------------------------------------------------------------------- */
|
blh xyz2blh(blh blh,
|
||||||
xyz2blh XYZ2BLH(xyz2blh xyz2blh,
|
|
||||||
double X, double Y, double Z)
|
double X, double Y, double Z)
|
||||||
{
|
{
|
||||||
double B = 0.0, N = 0.0, H = 0.0, R0, R1, deltaH, deltaB;
|
double B = 0.0, N = 0.0, H = 0.0, R0, R1, deltaH, deltaB;
|
||||||
R0 = sqrt(pow(X, 2) + pow(Y, 2));
|
R0 = sqrt(pow(X, 2) + pow(Y, 2));
|
||||||
R1 = sqrt(pow(X, 2) + pow(Y, 2) + pow(Z, 2));
|
R1 = sqrt(pow(X, 2) + pow(Y, 2) + pow(Z, 2));
|
||||||
xyz2blh.L = atan2(Y, X);
|
blh.L = atan2(Y, X);
|
||||||
N = a;
|
N = a;
|
||||||
H = R1 - a;
|
H = R1 - a;
|
||||||
B = atan2(Z * (N + H), R0 * (N * (1 - e2) + H));
|
B = atan2(Z * (N + H), R0 * (N * (1 - e2) + H));
|
||||||
@@ -92,8 +95,8 @@ xyz2blh XYZ2BLH(xyz2blh xyz2blh,
|
|||||||
H = R0 / cos(B) - N;
|
H = R0 / cos(B) - N;
|
||||||
B = atan2(Z * (N + H), R0 * (N * (1 - e2) + H));
|
B = atan2(Z * (N + H), R0 * (N * (1 - e2) + H));
|
||||||
} while (fabs(deltaH - H) > 1.0e-3 && fabs(deltaB - B) > 1.0e-9);
|
} while (fabs(deltaH - H) > 1.0e-3 && fabs(deltaB - B) > 1.0e-9);
|
||||||
xyz2blh.B = B;
|
blh.B = B;
|
||||||
xyz2blh.H = H;
|
blh.H = H;
|
||||||
|
|
||||||
return xyz2blh;
|
return blh;
|
||||||
}
|
}
|
||||||
+733
-792
File diff suppressed because it is too large.
Load diff
+330
-347
@@ -3,411 +3,394 @@ using namespace std;
|
|||||||
/*Obatain the intergral term of acceleraction of each component*/
|
/*Obatain the intergral term of acceleraction of each component*/
|
||||||
void pz90deq(double X[6], double K[6], double acc[3])
|
void pz90deq(double X[6], double K[6], double acc[3])
|
||||||
{
|
{
|
||||||
double r = sqrt(pow(X[0], 2) + pow(X[1], 2) + pow(X[2], 2));
|
double r = sqrt(pow(X[0], 2) + pow(X[1], 2) + pow(X[2], 2));
|
||||||
double coef0 = -GM / pow(r, 3);
|
double coef0 = -GM / pow(r, 3);
|
||||||
double coef1 = 1.5 * C20 * (GM * pow(a, 2) / pow(r, 5));
|
double coef1 = 1.5 * C20 * (GM * pow(a, 2) / pow(r, 5));
|
||||||
|
|
||||||
K[0] = X[3]; K[1] = X[4]; K[2] = X[5];
|
K[0] = X[3]; K[1] = X[4]; K[2] = X[5];
|
||||||
K[3] =
|
K[3] =
|
||||||
coef0 * X[0] +
|
coef0 * X[0] +
|
||||||
coef1 * (1 - 5 * pow((X[2] / r), 2)) * X[0] +
|
coef1 * (1 - 5 * pow((X[2] / r), 2)) * X[0] +
|
||||||
pow(Earth_e, 2) * X[0] +
|
pow(Earth_e, 2) * X[0] +
|
||||||
2 * Earth_e * X[4] +
|
2 * Earth_e * X[4] +
|
||||||
acc[0];
|
acc[0];
|
||||||
K[4] =
|
K[4] =
|
||||||
coef0 * X[1] +
|
coef0 * X[1] +
|
||||||
coef1 * (1 - 5 * pow((X[2] / r), 2)) * X[1] +
|
coef1 * (1 - 5 * pow((X[2] / r), 2)) * X[1] +
|
||||||
pow(Earth_e, 2) * X[1] -
|
pow(Earth_e, 2) * X[1] -
|
||||||
2 * Earth_e * X[3] +
|
2 * Earth_e * X[3] +
|
||||||
acc[1];
|
acc[1];
|
||||||
K[5] =
|
K[5] =
|
||||||
coef0 * X[2] +
|
coef0 * X[2] +
|
||||||
coef1 * (3 - 5 * pow((X[2] / r), 2)) * X[2] +
|
coef1 * (3 - 5 * pow((X[2] / r), 2)) * X[2] +
|
||||||
acc[2];
|
acc[2];
|
||||||
}
|
}
|
||||||
/*Construct the RK-4 method*/
|
/*Construct the RK-4 method*/
|
||||||
void pz90pos(double tstep, double X[6], double acc[3])
|
void pz90pos(double tstep, double X[6], double acc[3])
|
||||||
{
|
{
|
||||||
double K1[6], K2[6], K3[6], K4[6], W[6];
|
double K1[6], K2[6], K3[6], K4[6], W[6];
|
||||||
|
|
||||||
pz90deq(X, K1, acc); for (int i = 0; i < 6; i++) W[i] = X[i] + K1[i] * tstep / 2.0;
|
pz90deq(X, K1, acc); for (int i = 0; i < 6; i++) W[i] = X[i] + K1[i] * tstep / 2.0;
|
||||||
pz90deq(W, K2, acc); for (int i = 0; i < 6; i++) W[i] = X[i] + K2[i] * tstep / 2.0;
|
pz90deq(W, K2, acc); for (int i = 0; i < 6; i++) W[i] = X[i] + K2[i] * tstep / 2.0;
|
||||||
pz90deq(W, K3, acc); for (int i = 0; i < 6; i++) W[i] = X[i] + K3[i] * tstep;
|
pz90deq(W, K3, acc); for (int i = 0; i < 6; i++) W[i] = X[i] + K3[i] * tstep;
|
||||||
pz90deq(W, K4, acc);
|
pz90deq(W, K4, acc);
|
||||||
for (int i = 0; i < 6; i++) X[i] += (K1[i] + 2.0 * K2[i] + 2.0 * K3[i] + K4[i]) * tstep / 6.0;
|
for (int i = 0; i < 6; i++) X[i] += (K1[i] + 2.0 * K2[i] + 2.0 * K3[i] + K4[i]) * tstep / 6.0;
|
||||||
}
|
}
|
||||||
/*Calculate the satellite position of GLONASS on this epoch*/
|
/*Calculate the satellite position of GLONASS on this epoch*/
|
||||||
pos_ts glo_pos(int best_epoch, double Weeksec,
|
pos_ts glo_pos(int best_epoch, double Weeksec,
|
||||||
pnav_body nav_b, pobs_head obs_h, pos_ts pos_t)
|
pnav_body nav_b, pobs_head obs_h, pos_ts pos_t)
|
||||||
{
|
{
|
||||||
double X[6], acc[3]; double R = 0.0;
|
double X[6], acc[3]; double R = 0.0;
|
||||||
double tdist = Weeksec - pos_t.delta_t - nav_b[best_epoch].TOE, tstep = 0.0;
|
double tdist = Weeksec - pos_t.delta_t - nav_b[best_epoch].TOE, tstep = 0.0;
|
||||||
pos_t.delta_clk = -nav_b[best_epoch].sa0 + nav_b[best_epoch].sa1 * tdist;
|
pos_t.delta_clk = -nav_b[best_epoch].sa0 + nav_b[best_epoch].sa1 * tdist;
|
||||||
|
|
||||||
X[0] = nav_b[best_epoch].SatX * 1e3;
|
X[0] = nav_b[best_epoch].SatX * 1e3;
|
||||||
X[1] = nav_b[best_epoch].SatY * 1e3;
|
X[1] = nav_b[best_epoch].SatY * 1e3;
|
||||||
X[2] = nav_b[best_epoch].SatZ * 1e3;//Position
|
X[2] = nav_b[best_epoch].SatZ * 1e3;//Position
|
||||||
|
|
||||||
X[3] = nav_b[best_epoch].SatXv * 1e3;
|
X[3] = nav_b[best_epoch].SatXv * 1e3;
|
||||||
X[4] = nav_b[best_epoch].SatYv * 1e3;
|
X[4] = nav_b[best_epoch].SatYv * 1e3;
|
||||||
X[5] = nav_b[best_epoch].SatZv * 1e3;//Velocity
|
X[5] = nav_b[best_epoch].SatZv * 1e3;//Velocity
|
||||||
|
|
||||||
acc[0] = nav_b[best_epoch].SatXa * 1e3;
|
acc[0] = nav_b[best_epoch].SatXa * 1e3;
|
||||||
acc[1] = nav_b[best_epoch].SatYa * 1e3;
|
acc[1] = nav_b[best_epoch].SatYa * 1e3;
|
||||||
acc[2] = nav_b[best_epoch].SatZa * 1e3;//Acclerate
|
acc[2] = nav_b[best_epoch].SatZa * 1e3;//Acclerate
|
||||||
|
|
||||||
for (tstep = tdist < 0.0 ? TSTEP : -TSTEP; fabs(tdist) > 1.0e-9; tdist += tstep) {
|
for (tstep = tdist < 0.0 ? TSTEP : -TSTEP; fabs(tdist) > 1.0e-9; tdist += tstep) {
|
||||||
if (fabs(tdist) < TSTEP) tstep = -tdist;
|
if (fabs(tdist) < TSTEP) tstep = -tdist;
|
||||||
pz90pos(tstep, X, acc);
|
pz90pos(tstep, X, acc);
|
||||||
}
|
}
|
||||||
|
|
||||||
X[0] = -0.47 + (X[0] * 1 + X[1] * 1.728e-6 + X[2] * -0.017e-6) * (1 + 22e-9);
|
X[0] = -0.47 + (X[0] * 1 + X[1] * 1.728e-6 + X[2] * -0.017e-6) * (1 + 22e-9);
|
||||||
X[1] = -0.51 + (X[0] * 1.728e-6 + X[1] * 1 + X[2] * -0.076e-6) * (1 + 22e-9);
|
X[1] = -0.51 + (X[0] * 1.728e-6 + X[1] * 1 + X[2] * -0.076e-6) * (1 + 22e-9);
|
||||||
X[2] = -1.56 + (X[0] * 0.0178e-6 + X[1] * -0.076e-6 + X[2] * 1) * (1 + 22e-9);//PZ90 Convert to WGS-84
|
X[2] = -1.56 + (X[0] * 0.0178e-6 + X[1] * -0.076e-6 + X[2] * 1) * (1 + 22e-9);//PZ90 Convert to WGS-84
|
||||||
|
|
||||||
pos_t.X = X[0];
|
pos_t.X = X[0];
|
||||||
pos_t.Y = X[1];
|
pos_t.Y = X[1];
|
||||||
pos_t.Z = X[2];
|
pos_t.Z = X[2];
|
||||||
|
|
||||||
R = sqrt(pow(pos_t.X - obs_h->apX, 2) + pow(pos_t.Y - obs_h->apY, 2) + pow(pos_t.Z - obs_h->apZ, 2));
|
R = sqrt(pow(pos_t.X - obs_h->apX, 2) + pow(pos_t.Y - obs_h->apY, 2) + pow(pos_t.Z - obs_h->apZ, 2));
|
||||||
pos_t.deltat = pos_t.delta_t;
|
pos_t.deltat = pos_t.delta_t;
|
||||||
pos_t.delta_t = R / C_V + pos_t.delta_clk;
|
pos_t.delta_t = R / C_V + pos_t.delta_clk;
|
||||||
|
|
||||||
return pos_t;
|
return pos_t;
|
||||||
}
|
}
|
||||||
/*Calculate the satellite position of other systems on this epoch*/
|
/*Calculate the satellite position of other systems on this epoch*/
|
||||||
pos_ts sat_pos(int sPRN, int best_epoch, double Weeksec, int gnsscode,
|
pos_ts sat_pos(int sPRN, int best_epoch, double Weeksec, int GNSS,
|
||||||
pnav_body nav_b, pobs_head obs_h, pos_ts pos_t)
|
pnav_body nav_b, pobs_head obs_h, pos_ts pos_t)
|
||||||
{
|
{
|
||||||
double T_S = Weeksec - pos_t.delta_t;
|
double T_S = Weeksec - pos_t.delta_t;
|
||||||
double n_0 = sqrt(GM) / pow(nav_b[best_epoch].sqrtA, 3);
|
double n_0 = sqrt(GM) / pow(nav_b[best_epoch].sqrtA, 3);
|
||||||
double n = n_0 + nav_b[best_epoch].deltan;
|
double n = n_0 + nav_b[best_epoch].deltan;
|
||||||
double tk;
|
double tk;
|
||||||
if (gnsscode == BDS) tk = T_S - nav_b[best_epoch].TOE - 14;
|
|
||||||
else tk = T_S - nav_b[best_epoch].TOE;
|
|
||||||
|
|
||||||
if (tk > 32400)tk -= 604800;
|
if (GNSS == BDS) tk = T_S - nav_b[best_epoch].TOE - 14;//BDST = GPST + 14
|
||||||
else if (tk < -32400)tk += 604800;
|
else tk = T_S - nav_b[best_epoch].TOE;
|
||||||
|
|
||||||
double Ms = nav_b[best_epoch].M0 + n * tk;
|
if (tk > 32400)tk -= 604800;
|
||||||
|
else if (tk < -32400)tk += 604800;
|
||||||
|
|
||||||
double Es = Ms, E0;
|
double Ms = nav_b[best_epoch].M0 + n * tk;
|
||||||
do
|
|
||||||
{
|
|
||||||
E0 = Es;
|
|
||||||
Es = Ms + nav_b[best_epoch].e * sin(Es);
|
|
||||||
} while (fabs(Es - E0) > 1.0e-10);
|
|
||||||
|
|
||||||
double cosfs = (cos(Es) - nav_b[best_epoch].e) / (1 - nav_b[best_epoch].e * cos(Es));
|
double Es = Ms, E0;
|
||||||
double sinfs = (sqrt(1 - pow(nav_b[best_epoch].e, 2)) * sin(Es)) / (1 - nav_b[best_epoch].e * cos(Es));
|
do
|
||||||
double fs = atan2(sinfs, cosfs);
|
{
|
||||||
double u0 = fs + nav_b[best_epoch].omega;
|
E0 = Es;
|
||||||
|
Es = Ms + nav_b[best_epoch].e * sin(Es);
|
||||||
|
} while (fabs(Es - E0) > 1.0e-10);
|
||||||
|
|
||||||
double epsilon_u = nav_b[best_epoch].Cus * sin(2 * u0) + nav_b[best_epoch].Cuc * cos(2 * u0);
|
double cosfs = (cos(Es) - nav_b[best_epoch].e) / (1 - nav_b[best_epoch].e * cos(Es));
|
||||||
double epsilon_r = nav_b[best_epoch].Crs * sin(2 * u0) + nav_b[best_epoch].Crc * cos(2 * u0);
|
double sinfs = (sqrt(1 - pow(nav_b[best_epoch].e, 2)) * sin(Es)) / (1 - nav_b[best_epoch].e * cos(Es));
|
||||||
double epsilon_i = nav_b[best_epoch].Cis * sin(2 * u0) + nav_b[best_epoch].Cic * cos(2 * u0);
|
double fs = atan2(sinfs, cosfs);
|
||||||
|
double u0 = fs + nav_b[best_epoch].omega;
|
||||||
|
|
||||||
double u = u0 + epsilon_u;
|
double epsilon_u = nav_b[best_epoch].Cus * sin(2 * u0) + nav_b[best_epoch].Cuc * cos(2 * u0);
|
||||||
double r = pow(nav_b[best_epoch].sqrtA, 2) * (1 - nav_b[best_epoch].e * cos(Es)) + epsilon_r;
|
double epsilon_r = nav_b[best_epoch].Crs * sin(2 * u0) + nav_b[best_epoch].Crc * cos(2 * u0);
|
||||||
double i = nav_b[best_epoch].i0 + epsilon_i + nav_b[best_epoch].IDOT * tk;
|
double epsilon_i = nav_b[best_epoch].Cis * sin(2 * u0) + nav_b[best_epoch].Cic * cos(2 * u0);
|
||||||
|
|
||||||
double x = r * cos(u);
|
double u = u0 + epsilon_u;
|
||||||
double y = r * sin(u);
|
double r = pow(nav_b[best_epoch].sqrtA, 2) * (1 - nav_b[best_epoch].e * cos(Es)) + epsilon_r;
|
||||||
|
double i = nav_b[best_epoch].i0 + epsilon_i + nav_b[best_epoch].IDOT * tk;
|
||||||
|
|
||||||
double l, X, Y, Z;
|
double x = r * cos(u);
|
||||||
if (gnsscode == BDS) {
|
double y = r * sin(u);
|
||||||
if (sPRN > 5 && sPRN < 59) //BDS IGSO & MEO Satellites
|
|
||||||
{
|
|
||||||
l = nav_b[best_epoch].OMEGA + (nav_b[best_epoch].deltaomega - Earth_e) * tk - Earth_e * nav_b[best_epoch].TOE;
|
|
||||||
X = x * cos(l) - y * cos(i) * sin(l);
|
|
||||||
Y = x * sin(l) + y * cos(i) * cos(l);
|
|
||||||
Z = y * sin(i);
|
|
||||||
}
|
|
||||||
else //BDS GEO Satellites
|
|
||||||
{
|
|
||||||
l = nav_b[best_epoch].OMEGA + nav_b[best_epoch].deltaomega * tk - Earth_e * nav_b[best_epoch].TOE;
|
|
||||||
X = x * cos(l) - y * cos(i) * sin(l);
|
|
||||||
Y = x * sin(l) + y * cos(i) * cos(l);
|
|
||||||
Z = y * sin(i);
|
|
||||||
|
|
||||||
double f = deg2rad(-5);
|
double l, X, Y, Z;
|
||||||
double p = Earth_e * tk;
|
if (GNSS == BDS && (sPRN <= 5 || sPRN >= 59)) {//BDS GEO Satellites
|
||||||
|
|
||||||
|
l = nav_b[best_epoch].OMEGA + nav_b[best_epoch].deltaomega * tk - Earth_e * nav_b[best_epoch].TOE;
|
||||||
|
X = x * cos(l) - y * cos(i) * sin(l);
|
||||||
|
Y = x * sin(l) + y * cos(i) * cos(l);
|
||||||
|
Z = y * sin(i);
|
||||||
|
|
||||||
X = X * cos(p) + Y * sin(p) * cos(f) + Z * sin(p) * sin(f);
|
double f = deg2rad(-5);
|
||||||
Y = X * -sin(p) + Y * cos(p) * cos(f) + Z * cos(p) * sin(f);
|
double p = Earth_e * tk;
|
||||||
Z = Y * -sin(f) + Z * cos(f);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
l = nav_b[best_epoch].OMEGA + (nav_b[best_epoch].deltaomega - Earth_e) * tk - Earth_e * nav_b[best_epoch].TOE;
|
|
||||||
X = x * cos(l) - y * cos(i) * sin(l);
|
|
||||||
Y = x * sin(l) + y * cos(i) * cos(l);
|
|
||||||
Z = y * sin(i);
|
|
||||||
}
|
|
||||||
pos_t.X = cos(Earth_e * pos_t.delta_t) * X + sin(Earth_e * pos_t.delta_t) * Y;
|
|
||||||
pos_t.Y = -sin(Earth_e * pos_t.delta_t) * X + cos(Earth_e * pos_t.delta_t) * Y;
|
|
||||||
pos_t.Z = Z;//Correction of earth rotation
|
|
||||||
|
|
||||||
double TGD;
|
X = X * cos(p) + Y * sin(p) * cos(f) + Z * sin(p) * sin(f);
|
||||||
if (gnsscode == GPS) TGD = nav_b[best_epoch].TGD;
|
Y = X * -sin(p) + Y * cos(p) * cos(f) + Z * cos(p) * sin(f);
|
||||||
else if (gnsscode == GAL) TGD = nav_b[best_epoch].BGDa;
|
Z = Y * -sin(f) + Z * cos(f);
|
||||||
else if (gnsscode == BDS) TGD = 0;
|
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
l = nav_b[best_epoch].OMEGA + (nav_b[best_epoch].deltaomega - Earth_e) * tk - Earth_e * nav_b[best_epoch].TOE;
|
||||||
|
X = x * cos(l) - y * cos(i) * sin(l);
|
||||||
|
Y = x * sin(l) + y * cos(i) * cos(l);
|
||||||
|
Z = y * sin(i);
|
||||||
|
}
|
||||||
|
pos_t.X = cos(Earth_e * pos_t.delta_t) * X + sin(Earth_e * pos_t.delta_t) * Y;
|
||||||
|
pos_t.Y = -sin(Earth_e * pos_t.delta_t) * X + cos(Earth_e * pos_t.delta_t) * Y;
|
||||||
|
pos_t.Z = Z;//Correction of earth rotation
|
||||||
|
|
||||||
double R = sqrt(pow(pos_t.X - obs_h->apX, 2) + pow(pos_t.Y - obs_h->apY, 2) + pow(pos_t.Z - obs_h->apZ, 2));
|
double TGD=0.0;
|
||||||
double rela = 2 * sqrt(GM) * nav_b[best_epoch].e * nav_b[best_epoch].sqrtA * sin(Es) / pow(C_V, 2);//Relativistic effect
|
if (GNSS == GPS) TGD = nav_b[best_epoch].TGD;
|
||||||
pos_t.delta_clk = nav_b[best_epoch].sa0 + nav_b[best_epoch].sa1 * tk + nav_b[best_epoch].sa2 * pow(tk, 2) - rela - TGD;
|
else if (GNSS == GAL) TGD = nav_b[best_epoch].BGDa;
|
||||||
pos_t.deltat = pos_t.delta_t;
|
else if (GNSS == BDS) TGD = nav_b[best_epoch].TGD1;
|
||||||
pos_t.delta_t = R / C_V + pos_t.delta_clk;
|
|
||||||
|
|
||||||
return pos_t;
|
//Recalculate the diatance of satellite-receiver
|
||||||
|
double R = sqrt(pow(pos_t.X - obs_h->apX, 2) + pow(pos_t.Y - obs_h->apY, 2) + pow(pos_t.Z - obs_h->apZ, 2));
|
||||||
|
//Get relativistic effect correction
|
||||||
|
double rela = 2 * sqrt(GM) * nav_b[best_epoch].e * nav_b[best_epoch].sqrtA * sin(Es) / pow(C_V, 2);
|
||||||
|
|
||||||
|
pos_t.delta_clk = nav_b[best_epoch].sa0 + nav_b[best_epoch].sa1 * tk + nav_b[best_epoch].sa2 * pow(tk, 2) - rela + TGD;
|
||||||
|
pos_t.deltat = pos_t.delta_t;
|
||||||
|
pos_t.delta_t = R / C_V + pos_t.delta_clk;
|
||||||
|
|
||||||
|
return pos_t;
|
||||||
}
|
}
|
||||||
/* -------------------------------------------------------------------------- */
|
/**
|
||||||
/// @brief Calculate the position of satellite in the ECEF coordinate system by the broadcast ephemeris and epoch information
|
* .
|
||||||
/// @param obs_h Observation header data
|
*
|
||||||
/// @param obs_e Observation epoch data
|
* \param obs_h: Observation header data
|
||||||
/// @param obs_b Observation data
|
* \param obs_e: Observation epoch data
|
||||||
/// @param nav_b Navigation data
|
* \param obs_b: Observation data
|
||||||
/// @param res_file The file path of result file of satellite position
|
* \param nav_b: Navigation data
|
||||||
/// @param station Prior information about station location
|
* \param res_file: The file path of result file of satellite position
|
||||||
/// @param gnsscode GNSS system code
|
* \param GNSS: GNSS system code
|
||||||
/// @param satnum The total number of satellite of designated satellite system
|
* \param satnum: The total number of satellite of designated satellite system
|
||||||
/// @return 1 refer OK
|
* \return
|
||||||
/* -------------------------------------------------------------------------- */
|
*/
|
||||||
int sat_pos_cal(pobs_head obs_h, pobs_epoch obs_e, pobs_body obs_b,
|
int sat_pos_cal(pobs_head obs_h, pobs_epoch obs_e, pobs_body obs_b,
|
||||||
pnav_body nav_b,
|
pnav_body nav_b,
|
||||||
FILE* res_file, stations station,
|
FILE* res_file,
|
||||||
int gnsscode, int satnum)
|
int GNSS, int satnum, int Hangle)
|
||||||
{
|
{
|
||||||
//the beginning second of observation
|
//the beginning second of observation
|
||||||
double beginsec = Time2GPST(obs_h->f_y, obs_h->f_m, obs_h->f_d, obs_h->f_h, obs_h->f_min, obs_h->f_sec);
|
double beginsec = Time2GPST(obs_h->f_y, obs_h->f_m, obs_h->f_d, obs_h->f_h, obs_h->f_min, obs_h->f_sec);
|
||||||
//the ending second of observation
|
|
||||||
double endinsec = Time2GPST(obs_h->l_y, obs_h->l_m, obs_h->l_d, obs_h->l_h, obs_h->l_min, obs_h->l_sec);
|
|
||||||
|
|
||||||
blhs blh = { 0 }; blh2enu enu = { 0 };
|
//the ending second of observation
|
||||||
rahcal rah = { 0 }; pos_ts pos_t = { 0 };
|
double endinsec = Time2GPST(obs_h->l_y, obs_h->l_m, obs_h->l_d, obs_h->l_h, obs_h->l_min, obs_h->l_sec);
|
||||||
xyz2blh tem1 = { 0 }; blh2enu tem2 = { 0 }; rahcal tem3 = { 0 };
|
|
||||||
|
|
||||||
int y = obs_e->y; int m = obs_e->m; int d = obs_e->d;
|
rah in_rah = { 0 }; rah tem_rah = { 0 };
|
||||||
double h = obs_e->h; int min = obs_e->min; double sec = obs_e->sec;
|
enu in_enu = { 0 }; enu tem_enu = { 0 };
|
||||||
|
blh in_blh = { 0 }; blh tem_blh = { 0 };
|
||||||
|
pos_ts pos_t = { 0 };
|
||||||
|
|
||||||
|
int y = obs_e->y; int m = obs_e->m; int d = obs_e->d;
|
||||||
|
double h = obs_e->h; int min = obs_e->min; double sec = obs_e->sec;
|
||||||
|
|
||||||
double Weeksec = Time2GPST(y, m, d, h, min, sec);
|
double Weeksec = Time2GPST(y, m, d, h, min, sec);
|
||||||
int epochcount = round((Weeksec - beginsec) / obs_h->interval) + 1;
|
int epochcount = round((Weeksec - beginsec) / obs_h->interval) + 1;
|
||||||
fprintf(res_file, "\n>%04d %04d %02d %02d %02d %02d %07.04f"
|
fprintf(res_file, "\n>%04d %04d %02d %02d %02d %02d %07.04f"
|
||||||
, epochcount, obs_e->y, obs_e->m, obs_e->d, obs_e->h, obs_e->min, obs_e->sec);
|
, epochcount, obs_e->y, obs_e->m, obs_e->d, obs_e->h, obs_e->min, obs_e->sec);
|
||||||
int sat_num = 0, sPRN = 0, SIGN = 0, PERS = 0;
|
int sat_num = 0, sPRN = 0, PERS = 0;
|
||||||
double detat_toc;
|
double detat_toc;
|
||||||
//Check the GNSS and assign the satellite number
|
|
||||||
if (gnsscode == GPS)sat_num = obs_e->gps_num;
|
|
||||||
else if (gnsscode == GAL)sat_num = obs_e->gal_num;
|
|
||||||
else if (gnsscode == BDS)sat_num = obs_e->bds_num;
|
|
||||||
else if (gnsscode == GLO)sat_num = obs_e->glo_num;
|
|
||||||
|
|
||||||
for (int j = 0; j < sat_num; j++) {
|
//Match the system and assign the satellite number
|
||||||
if (gnsscode == GPS) {
|
if (GNSS == GPS)sat_num = obs_e->gps_num;
|
||||||
sPRN = obs_e->sPRN_GPS[j]; SIGN = GPS;
|
else if (GNSS == GAL)sat_num = obs_e->gal_num;
|
||||||
PERS = obs_b->obs_gps[j][Code2Type(C1, obs_h->obstypenum_gps, obs_h->obscode_gps)] / C_V;
|
else if (GNSS == BDS)sat_num = obs_e->bds_num;
|
||||||
}
|
else if (GNSS == GLO)sat_num = obs_e->glo_num;
|
||||||
else if (gnsscode == GAL) {
|
|
||||||
sPRN = obs_e->sPRN_GAL[j]; SIGN = GAL;
|
|
||||||
PERS = obs_b->obs_gal[j][Code2Type(C1, obs_h->obstypenum_gal, obs_h->obscode_gal)] / C_V;
|
|
||||||
}
|
|
||||||
else if (gnsscode == BDS) {
|
|
||||||
sPRN = obs_e->sPRN_BDS[j]; SIGN = BDS;
|
|
||||||
PERS = obs_b->obs_bds[j][Code2Type(C2, obs_h->obstypenum_bds, obs_h->obscode_bds)] / C_V;
|
|
||||||
}
|
|
||||||
else if (gnsscode == GLO) {
|
|
||||||
sPRN = obs_e->sPRN_GLO[j]; SIGN = GLO;
|
|
||||||
PERS = obs_b->obs_glo[j][Code2Type(C1, obs_h->obstypenum_glo, obs_h->obscode_glo)] / C_V;
|
|
||||||
}
|
|
||||||
|
|
||||||
int best_epoch = select_epoch(Weeksec, sPRN, nav_b, satnum, SIGN);
|
for (int j = 0; j < sat_num; j++) {
|
||||||
if (best_epoch == -1)//when the sPRN is not exist function will return -1
|
|
||||||
break;
|
|
||||||
if (SIGN == BDS) detat_toc = Weeksec - nav_b[best_epoch].TOE - 14;
|
|
||||||
else detat_toc = Weeksec - nav_b[best_epoch].TOE;
|
|
||||||
|
|
||||||
//Iterative approximate propagation time
|
//Match system and assign the sPRN
|
||||||
//Exclude GLONASS
|
if (GNSS == GPS) {
|
||||||
if (SIGN == GLO) {
|
sPRN = obs_e->sPRN_GPS[j];
|
||||||
pos_t.delta_t = PERS -
|
PERS = obs_b->obs_gps[j][code2type(C1, obs_h->obstypenum_gps, obs_h->obscode_gps)] / C_V;
|
||||||
station.delta_TR +
|
}
|
||||||
nav_b[best_epoch].sa0 +
|
else if (GNSS == GAL) {
|
||||||
nav_b[best_epoch].sa1 * detat_toc;
|
sPRN = obs_e->sPRN_GAL[j];
|
||||||
pos_t.deltat = 0.0;
|
PERS = obs_b->obs_gal[j][code2type(C1, obs_h->obstypenum_gal, obs_h->obscode_gal)] / C_V;
|
||||||
|
}
|
||||||
|
else if (GNSS == BDS) {
|
||||||
|
sPRN = obs_e->sPRN_BDS[j];
|
||||||
|
PERS = obs_b->obs_bds[j][code2type(C2, obs_h->obstypenum_bds, obs_h->obscode_bds)] / C_V;
|
||||||
|
}
|
||||||
|
else if (GNSS == GLO) {
|
||||||
|
sPRN = obs_e->sPRN_GLO[j];
|
||||||
|
PERS = obs_b->obs_glo[j][code2type(C1, obs_h->obstypenum_glo, obs_h->obscode_glo)] / C_V;
|
||||||
|
}
|
||||||
|
|
||||||
while (fabs(pos_t.delta_t - pos_t.deltat) > 1.0e-9) {
|
//Match the nearest satellite of nav with this epoch
|
||||||
pos_t = glo_pos(best_epoch, Weeksec, nav_b, obs_h, pos_t);
|
int best_epoch = select_epoch(Weeksec, sPRN, nav_b, satnum, GNSS);
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
pos_t.delta_t = PERS -
|
|
||||||
station.delta_TR +
|
|
||||||
nav_b[best_epoch].sa0 +
|
|
||||||
nav_b[best_epoch].sa1 * detat_toc +
|
|
||||||
nav_b[best_epoch].sa2 * pow(detat_toc, 2);
|
|
||||||
pos_t.deltat = 0.0;
|
|
||||||
while (fabs(pos_t.delta_t - pos_t.deltat) > 1.0e-9) {
|
|
||||||
pos_t = sat_pos(sPRN, best_epoch, Weeksec, gnsscode, nav_b, obs_h, pos_t);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//Satellite blh position calculation
|
|
||||||
tem1 = XYZ2BLH(tem1, pos_t.X, pos_t.Y, pos_t.Z);
|
|
||||||
blh.B = rad2deg(tem1.B);
|
|
||||||
blh.L = rad2deg(tem1.L);
|
|
||||||
blh.H = tem1.H;
|
|
||||||
|
|
||||||
double deltax = pos_t.X - obs_h->apX;
|
if (best_epoch == -1)//when the sPRN is not exist function will return -1
|
||||||
double deltay = pos_t.Y - obs_h->apY;
|
break;
|
||||||
double deltaz = pos_t.Z - obs_h->apZ;
|
|
||||||
|
|
||||||
tem2 = BLH2ENU(tem2, station.B, station.L, deltax, deltay, deltaz);
|
if (GNSS == BDS) detat_toc = Weeksec - nav_b[best_epoch].TOE - 14;//BDST = GPST + 14s
|
||||||
enu.E = tem2.E;
|
|
||||||
enu.N = tem2.N;
|
else detat_toc = Weeksec - nav_b[best_epoch].TOE;
|
||||||
enu.U = tem2.U;
|
|
||||||
//Satellite elevation Angle calculation
|
//Iterative approximate propagation time
|
||||||
tem3 = RAHCAL(tem3, enu.E, enu.N, enu.U);
|
if (GNSS == GLO) {
|
||||||
rah.R = tem3.R;
|
|
||||||
rah.A = rad2deg(tem3.A);
|
//Get the approximately transit of signal
|
||||||
rah.H = rad2deg(tem3.H);
|
pos_t.delta_t = PERS - 0 +
|
||||||
if (blh.H < 0 || rah.H < 10 || nav_b[best_epoch].sHEA != 0) {
|
nav_b[best_epoch].sa0 +
|
||||||
continue;
|
nav_b[best_epoch].sa1 * detat_toc;
|
||||||
}
|
|
||||||
else {
|
pos_t.deltat = 0.0;
|
||||||
if (SIGN == GPS) {
|
//Satellite position calculation
|
||||||
fprintf(res_file, "\nG %02d| %15.05f %15.05f %15.05f %15.05f %15.05f %15.05f %16.13f"
|
while (fabs(pos_t.delta_t - pos_t.deltat) > 1.0e-9) {
|
||||||
, sPRN, pos_t.X, pos_t.Y, pos_t.Z
|
pos_t = glo_pos(best_epoch, Weeksec, nav_b, obs_h, pos_t);
|
||||||
, obs_b->obs_gps[j][Code2Type(C1, obs_h->obstypenum_gps, obs_h->obscode_gps)]
|
}
|
||||||
, obs_b->obs_gps[j][Code2Type(C2, obs_h->obstypenum_gps, obs_h->obscode_gps)]
|
}
|
||||||
, rah.H, pos_t.delta_clk);//GPS satellite pos output
|
//Exclude GLONASS
|
||||||
}
|
else {
|
||||||
else if (SIGN == GAL) {
|
|
||||||
fprintf(res_file, "\nE %02d| %15.05f %15.05f %15.05f %15.05f %15.05f %15.05f %16.13f"
|
//Get the approximately transit of signal
|
||||||
, sPRN, pos_t.X, pos_t.Y, pos_t.Z
|
pos_t.delta_t = PERS - 0 +
|
||||||
, obs_b->obs_gal[j][Code2Type(C1, obs_h->obstypenum_gal, obs_h->obscode_gal)]
|
nav_b[best_epoch].sa0 +
|
||||||
, obs_b->obs_gal[j][Code2Type(C6, obs_h->obstypenum_gal, obs_h->obscode_gal)]
|
nav_b[best_epoch].sa1 * detat_toc +
|
||||||
, rah.H, pos_t.delta_clk);//Galileo satellite pos output
|
nav_b[best_epoch].sa2 * pow(detat_toc, 2);
|
||||||
}
|
|
||||||
else if (SIGN == BDS) {
|
pos_t.deltat = 0.0;
|
||||||
if (sPRN >= 19) {
|
//Satellite position calculation
|
||||||
fprintf(res_file, "\nCC%02d| %15.05f %15.05f %15.05f %15.05f %15.05f %15.05f %16.13f"
|
while (fabs(pos_t.delta_t - pos_t.deltat) > 1.0e-9) {
|
||||||
, sPRN, pos_t.X, pos_t.Y, pos_t.Z
|
pos_t = sat_pos(sPRN, best_epoch, Weeksec, GNSS, nav_b, obs_h, pos_t);
|
||||||
, obs_b->obs_bds[j][Code2Type(C2, obs_h->obstypenum_bds, obs_h->obscode_bds)]
|
}
|
||||||
, obs_b->obs_bds[j][Code2Type(C7, obs_h->obstypenum_bds, obs_h->obscode_bds)]
|
}
|
||||||
, rah.H, pos_t.delta_clk);//BDS-3 satellite pos output
|
//Satellite blh position calculation
|
||||||
}
|
tem_blh = xyz2blh(tem_blh, pos_t.X, pos_t.Y, pos_t.Z);
|
||||||
else {
|
in_blh.B = rad2deg(tem_blh.B);
|
||||||
fprintf(res_file, "\nCB%02d| %15.05f %15.05f %15.05f %15.05f %15.05f %15.05f %16.13f"
|
in_blh.L = rad2deg(tem_blh.L);
|
||||||
, sPRN, pos_t.X, pos_t.Y, pos_t.Z
|
in_blh.H = tem_blh.H;
|
||||||
, obs_b->obs_bds[j][Code2Type(C2, obs_h->obstypenum_bds, obs_h->obscode_bds)]
|
|
||||||
, obs_b->obs_bds[j][Code2Type(C7, obs_h->obstypenum_bds, obs_h->obscode_bds)]
|
double deltax = pos_t.X - obs_h->apX;
|
||||||
, rah.H, pos_t.delta_clk);//BDS-2 satellite pos output
|
double deltay = pos_t.Y - obs_h->apY;
|
||||||
}
|
double deltaz = pos_t.Z - obs_h->apZ;
|
||||||
}
|
|
||||||
else if (SIGN == GLO) {
|
tem_enu = blh2enu(tem_enu, obs_h->apB, obs_h->apL, deltax, deltay, deltaz);
|
||||||
fprintf(res_file, "\nR %02d| %15.05f %15.05f %15.05f %15.05f %15.05f %15.05f %16.13f"
|
in_enu.E = tem_enu.E;
|
||||||
, sPRN, pos_t.X, pos_t.Y, pos_t.Z
|
in_enu.N = tem_enu.N;
|
||||||
, obs_b->obs_glo[j][Code2Type(C1, obs_h->obstypenum_glo, obs_h->obscode_glo)]
|
in_enu.U = tem_enu.U;
|
||||||
, obs_b->obs_glo[j][Code2Type(C2, obs_h->obstypenum_glo, obs_h->obscode_glo)]
|
|
||||||
, rah.H, pos_t.delta_clk);//Galileo satellite pos output
|
//Satellite elevation Angle calculation
|
||||||
}
|
tem_rah = rahcal(tem_rah, in_enu.E, in_enu.N, in_enu.U);
|
||||||
}
|
in_rah.R = tem_rah.R;
|
||||||
}return 1;
|
in_rah.A = rad2deg(tem_rah.A);
|
||||||
|
in_rah.H = rad2deg(tem_rah.H);
|
||||||
|
if (in_blh.H < 0 || in_rah.H < Hangle || nav_b[best_epoch].sHEA != 0) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
else outputbodydata(obs_h, obs_b, pos_t, in_rah, res_file, sPRN, j, GNSS);
|
||||||
|
}return 1;
|
||||||
}
|
}
|
||||||
/* -------------------------------------------------------------------------- */
|
/**
|
||||||
/// @brief The entry function of full .dll package,
|
* The entrance of function.
|
||||||
/// @param nav_path The RINEX navigation file's path
|
*
|
||||||
/// @param obs_path The RINEX observation file's path
|
* \param nav_path: The RINEX navigation file's path
|
||||||
/// @param res_path The Satellite output file's path
|
* \param obs_path: The RINEX observation file's path
|
||||||
/// @param gnsscode The GNSS position you want to calculate
|
* \param res_path: The satellite position solution output path
|
||||||
/// @return 0 refer complete solution; -1 refer fail to complete solution
|
* \param GNSS: GNSS code
|
||||||
/// @return > 0 refer partlt complete solution
|
* \return
|
||||||
/* -------------------------------------------------------------------------- */
|
* -1 ,Can not open the nav file
|
||||||
double brdm2pos(char nav_path[260], char obs_path[260], char res_path[260], int gnsscode)
|
* -2 ,Can not open the obs file
|
||||||
|
* -3 ,Mismatch version or format of nav
|
||||||
|
* -4 ,No data of nav
|
||||||
|
* -5 ,Mismatch version or format of obs
|
||||||
|
* -6 ,No data of obs
|
||||||
|
* 0 ,Soulution generated completely
|
||||||
|
* >0 ,Some epoch cant be calculate
|
||||||
|
*/
|
||||||
|
double brdm2pos(char nav_path[MAXPATH], char obs_path[MAXPATH], char res_path[MAXPATH],
|
||||||
|
int GNSS, int Hangle)
|
||||||
{
|
{
|
||||||
int satnum, epochunum, result = 0;
|
int satnum, epochnum, result = 0;
|
||||||
pos_ts pos_t = { 0 };
|
pos_ts pos_t = { 0 };
|
||||||
xyz2blh tem2 = { 0 };
|
blh apblh = { 0 };
|
||||||
stations station = { 0 };
|
|
||||||
time_t gen_time; time(&gen_time);
|
pnav_head nav_h = NULL;
|
||||||
|
pnav_body nav_b = NULL;
|
||||||
|
pobs_head obs_h = NULL;
|
||||||
|
pobs_body obs_b = NULL;
|
||||||
|
pobs_epoch obs_e = NULL;
|
||||||
|
|
||||||
pnav_head nav_h = NULL;
|
FILE* fp_nav = fopen(nav_path, "r");
|
||||||
pnav_body nav_b = NULL;
|
if (fp_nav == NULL) return -1;//cant read nav file
|
||||||
pobs_head obs_h = NULL;
|
|
||||||
pobs_body obs_b = NULL;
|
|
||||||
pobs_epoch obs_e = NULL;
|
|
||||||
|
|
||||||
FILE* fp_nav = fopen(nav_path, "r");
|
//Get the amount of satellite
|
||||||
if (fp_nav == NULL) return -1;
|
satnum = getsatnum(fp_nav);
|
||||||
satnum = getsatnum(fp_nav);
|
|
||||||
|
|
||||||
switch (satnum) {
|
switch (satnum) {
|
||||||
case -1: return -3;//mismatch version or format
|
case -1: return -3;//mismatch version or format
|
||||||
case 0: return -4;//no data
|
case 0: return -4;//no data
|
||||||
default:
|
default: break;
|
||||||
break;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
rewind(fp_nav);
|
rewind(fp_nav);
|
||||||
nav_h = (pnav_head)malloc(sizeof(nav_head));
|
nav_h = (pnav_head)malloc(sizeof(nav_head));
|
||||||
nav_b = (pnav_body)malloc(sizeof(nav_body) * (satnum));
|
nav_b = (pnav_body)malloc(sizeof(nav_body) * (satnum));
|
||||||
if (nav_h && nav_b) {
|
|
||||||
read_n_h(fp_nav, nav_h); read_n_b(fp_nav, nav_b);
|
|
||||||
}
|
|
||||||
fclose(fp_nav);
|
|
||||||
|
|
||||||
FILE* fp_obs = fopen(obs_path, "r");
|
if (nav_h && nav_b) { read_n_h(fp_nav, nav_h); read_n_b(fp_nav, nav_b); }
|
||||||
if (fp_obs == NULL) return -2;
|
|
||||||
epochunum = get_epochnum(fp_obs);
|
fclose(fp_nav);
|
||||||
|
|
||||||
switch (epochunum) {
|
FILE* fp_obs = fopen(obs_path, "r");
|
||||||
case -1: return -5;//mismatch version or format
|
if (fp_obs == NULL) return -2;//cant read obs file
|
||||||
case 0: return -6;//no data
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
rewind(fp_obs);
|
//Get the amonut of obs epoch
|
||||||
obs_h = (pobs_head)malloc(sizeof(obs_head));
|
epochnum = get_epochnum(fp_obs);
|
||||||
if (obs_h) {
|
|
||||||
read_o_h(fp_obs, obs_h);
|
|
||||||
|
|
||||||
tem2 = XYZ2BLH(tem2, obs_h->apX, obs_h->apY, obs_h->apZ);
|
switch (epochnum) {
|
||||||
station.B = tem2.B; station.L = tem2.L; station.H = tem2.H;
|
case -1: return -5;//mismatch version or format
|
||||||
|
case 0: return -6;//no data
|
||||||
|
default: break;
|
||||||
|
}
|
||||||
|
rewind(fp_obs); obs_h = (pobs_head)malloc(sizeof(obs_head));
|
||||||
|
|
||||||
//Out put the header of solution file
|
if (obs_h) {
|
||||||
FILE* result_file_clear = fopen(res_path, "w");
|
|
||||||
fclose(result_file_clear);
|
|
||||||
FILE* result_file = fopen(res_path, "a+");
|
|
||||||
fprintf(result_file, "@ GENERATE PROGRAM : KNZ_GeoTrackLab ver1.5.3.1\n");
|
|
||||||
fprintf(result_file, "@ GENERATE TYPE : Satellite Position\n");
|
|
||||||
fprintf(result_file, "@ GENERATE TIME : %s", ctime(&gen_time));
|
|
||||||
fprintf(result_file, "@ OBS FILE PATH : %s\n", obs_path);
|
|
||||||
fprintf(result_file, "@ NAV FILE PATH : %s\n", nav_path);
|
|
||||||
fprintf(result_file, "@ TIME OF FIRST OBS : %4d %02d %02d %02d %02d %07.4f\n"
|
|
||||||
, obs_h->f_y, obs_h->f_m, obs_h->f_d, obs_h->f_h, obs_h->f_min, obs_h->f_sec);
|
|
||||||
fprintf(result_file, "@ TIME OF LAST OBS : %4d %02d %02d %02d %02d %07.4f\n"
|
|
||||||
, obs_h->l_y, obs_h->l_m, obs_h->l_d, obs_h->l_h, obs_h->l_min, obs_h->l_sec);
|
|
||||||
fprintf(result_file, "@ APPROX POSITION XYZ: %13.04f%13.04f%13.04f\n@ APPROX POSITION BLH: %12.07f %12.07f %12.07f\n"
|
|
||||||
, obs_h->apX, obs_h->apY, obs_h->apZ
|
|
||||||
, station.B, station.L, station.H);
|
|
||||||
fprintf(result_file, "END OF HEADER\n");
|
|
||||||
|
|
||||||
//Begin to calculate
|
//Read the header of obs
|
||||||
for (int i = 0; i < epochunum; i++) {
|
read_o_h(fp_obs, obs_h);
|
||||||
//Allocate memory for obs epoch and body data
|
|
||||||
obs_e = (pobs_epoch)malloc(sizeof(obs_epoch));
|
|
||||||
obs_b = (pobs_body)malloc(sizeof(obs_body));
|
|
||||||
|
|
||||||
read_o_eb(fp_obs, obs_h, obs_e, obs_b);
|
//Convert the approximately position (ECEF > LLA)
|
||||||
result += sat_pos_cal(obs_h, obs_e, obs_b, nav_b,
|
apblh = xyz2blh(apblh, obs_h->apX, obs_h->apY, obs_h->apZ);
|
||||||
result_file, station,
|
obs_h->apB = apblh.B;
|
||||||
gnsscode, satnum);
|
obs_h->apL = apblh.L;
|
||||||
|
obs_h->apH = apblh.H;
|
||||||
|
|
||||||
fprintf(result_file, "\n");
|
//Output header of solution
|
||||||
freeobs_e(obs_e, obs_b);
|
FILE* result_file = outputheader(obs_h, obs_path, nav_path, res_path);
|
||||||
}
|
|
||||||
free(obs_h); free(nav_h); free(nav_b);
|
//Begin to calculate
|
||||||
fprintf(result_file, "\nEND"); fclose(result_file);
|
for (int i = 0; i < epochnum; i++) {
|
||||||
if (epochunum == result) return 0;
|
|
||||||
}
|
//Allocate memory for obs epoch and body data
|
||||||
|
obs_e = (pobs_epoch)malloc(sizeof(obs_epoch));
|
||||||
|
obs_b = (pobs_body)malloc(sizeof(obs_body));
|
||||||
|
|
||||||
|
//Read epoch data
|
||||||
|
read_o_eb(fp_obs, obs_h, obs_e, obs_b);
|
||||||
|
|
||||||
|
//Calculate the position of satellite
|
||||||
|
result += sat_pos_cal(obs_h, obs_e, obs_b, nav_b,
|
||||||
|
result_file,
|
||||||
|
GNSS, satnum, Hangle);
|
||||||
|
|
||||||
|
|
||||||
|
fprintf(result_file, "\n");
|
||||||
|
|
||||||
|
//Free epoch data
|
||||||
|
freeobs_e(obs_e, obs_b);
|
||||||
|
}
|
||||||
|
//Output the signal of ending
|
||||||
|
fprintf(result_file, "\nEND"); fclose(result_file);
|
||||||
|
|
||||||
|
//free nav & obs memory of data
|
||||||
|
free(obs_h); free(nav_h); free(nav_b);
|
||||||
|
|
||||||
|
if (epochnum == result) return 0;
|
||||||
|
else return epochnum - result;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,103 @@
|
|||||||
|
#include "brdm2pos.h"
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
/*Output the header data of satllite position solution*/
|
||||||
|
FILE* outputheader(pobs_head obs_h,
|
||||||
|
char obs_path[MAXPATH], char nav_path[MAXPATH], char res_path[MAXPATH])
|
||||||
|
{
|
||||||
|
time_t gen_time;
|
||||||
|
time(&gen_time);
|
||||||
|
|
||||||
|
FILE* result_file_clear = fopen(res_path, "w");
|
||||||
|
fclose(result_file_clear);
|
||||||
|
FILE* result_file = fopen(res_path, "a+");
|
||||||
|
fprintf(result_file, "@ GENERATE PROGRAM : KNZ_GeoTrackLab ver1.5.4.1\n");
|
||||||
|
fprintf(result_file, "@ GENERATE TYPE : Satellite Position\n");
|
||||||
|
fprintf(result_file, "@ GENERATE TIME : %s", ctime(&gen_time));
|
||||||
|
fprintf(result_file, "@ OBS FILE PATH : %s\n", obs_path);
|
||||||
|
fprintf(result_file, "@ NAV FILE PATH : %s\n", nav_path);
|
||||||
|
fprintf(result_file, "@ TIME OF FIRST OBS : %4d %02d %02d %02d %02d %07.4f\n"
|
||||||
|
, obs_h->f_y, obs_h->f_m, obs_h->f_d, obs_h->f_h, obs_h->f_min, obs_h->f_sec);
|
||||||
|
fprintf(result_file, "@ TIME OF LAST OBS : %4d %02d %02d %02d %02d %07.4f\n"
|
||||||
|
, obs_h->l_y, obs_h->l_m, obs_h->l_d, obs_h->l_h, obs_h->l_min, obs_h->l_sec);
|
||||||
|
fprintf(result_file, "@ APPROX POSITION XYZ: %13.04f%13.04f%13.04f\n@ APPROX POSITION BLH: %12.07f %12.07f %12.07f\n"
|
||||||
|
, obs_h->apX, obs_h->apY, obs_h->apZ
|
||||||
|
, obs_h->apB, obs_h->apL, obs_h->apH);
|
||||||
|
fprintf(result_file, "END OF HEADER\n");
|
||||||
|
|
||||||
|
return result_file;
|
||||||
|
}
|
||||||
|
/*Ion correction by IF-IC*/
|
||||||
|
static double ionofree(pobs_body obs_b, pobs_head obs_h, int j, int GNSS)
|
||||||
|
{
|
||||||
|
double P1=0.0, P2=0.0, freq1=0.0, freq2=0.0;
|
||||||
|
//Match the code with system
|
||||||
|
switch (GNSS) {
|
||||||
|
case GPS:
|
||||||
|
P1 = obs_b->obs_gps[j][code2type(C1, obs_h->obstypenum_gps, obs_h->obscode_gps)];
|
||||||
|
P2 = obs_b->obs_gps[j][code2type(C2, obs_h->obstypenum_gps, obs_h->obscode_gps)];
|
||||||
|
freq1 = FREQ1; freq2 = FREQ2;
|
||||||
|
break;
|
||||||
|
case BDS:
|
||||||
|
P1 = obs_b->obs_bds[j][code2type(C2, obs_h->obstypenum_bds, obs_h->obscode_bds)];
|
||||||
|
P2 = obs_b->obs_bds[j][code2type(C7, obs_h->obstypenum_bds, obs_h->obscode_bds)];
|
||||||
|
freq1 = FREQ1_BDS; freq2 = FREQ2_BDS;
|
||||||
|
break;
|
||||||
|
case GAL:
|
||||||
|
P1 = obs_b->obs_gal[j][code2type(C1, obs_h->obstypenum_gal, obs_h->obscode_gal)];
|
||||||
|
P2 = obs_b->obs_gal[j][code2type(C5, obs_h->obstypenum_gal, obs_h->obscode_gal)];
|
||||||
|
freq1 = FREQ1; freq2 = FREQ6;
|
||||||
|
break;
|
||||||
|
case GLO:
|
||||||
|
P1 = obs_b->obs_glo[j][code2type(C1, obs_h->obstypenum_glo, obs_h->obscode_glo)];
|
||||||
|
P2 = obs_b->obs_glo[j][code2type(C2, obs_h->obstypenum_glo, obs_h->obscode_glo)];
|
||||||
|
freq1 = FREQ1_GLO; freq2 = FREQ2_GLO;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
//IF-IC
|
||||||
|
if (P1 != 0.0 && P2 != 0.0) {
|
||||||
|
P1 = (pow(freq1, 2) * P1) / (pow(freq1, 2) - pow(freq2, 2))
|
||||||
|
- (pow(freq2, 2) * P2) / (pow(freq1, 2) - pow(freq2, 2));
|
||||||
|
|
||||||
|
return P1;
|
||||||
|
}
|
||||||
|
if (P1 == 0.0 || P2 == 0.0) {
|
||||||
|
if (P1 == 0.0 && P2 != 0.0) return P2;
|
||||||
|
if (P1 != 0.0 && P2 == 0.0) return P1;
|
||||||
|
return 0.0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/*Output the satellite solution data*/
|
||||||
|
void outputbodydata(pobs_head obs_h, pobs_body obs_b,
|
||||||
|
pos_ts pos_t, rah in_rah, FILE* res_file,
|
||||||
|
int sPRN, int j, int GNSS)
|
||||||
|
{
|
||||||
|
double P = ionofree(obs_b, obs_h, j, GNSS);
|
||||||
|
|
||||||
|
if (P == 0) return;
|
||||||
|
|
||||||
|
switch (GNSS) {
|
||||||
|
case GPS:
|
||||||
|
fprintf(res_file, "\nG %02d| %15.05f %15.05f %15.05f %15.05f %15.05f %16.13f"
|
||||||
|
, sPRN, pos_t.X, pos_t.Y, pos_t.Z
|
||||||
|
, P, in_rah.H, pos_t.delta_clk);
|
||||||
|
break;
|
||||||
|
case BDS:
|
||||||
|
if (sPRN <= 5 || sPRN >= 59) break;
|
||||||
|
else;
|
||||||
|
fprintf(res_file, "\nC %02d| %15.05f %15.05f %15.05f %15.05f %15.05f %16.13f"
|
||||||
|
, sPRN, pos_t.X, pos_t.Y, pos_t.Z
|
||||||
|
, P, in_rah.H, pos_t.delta_clk);
|
||||||
|
break;
|
||||||
|
case GAL:
|
||||||
|
fprintf(res_file, "\nE %02d| %15.05f %15.05f %15.05f %15.05f %15.05f %16.13f"
|
||||||
|
, sPRN, pos_t.X, pos_t.Y, pos_t.Z
|
||||||
|
, P, in_rah.H, pos_t.delta_clk);
|
||||||
|
break;
|
||||||
|
case GLO:
|
||||||
|
fprintf(res_file, "\nR %02d| %15.05f %15.05f %15.05f %15.05f %15.05f %16.13f"
|
||||||
|
, sPRN, pos_t.X, pos_t.Y, pos_t.Z
|
||||||
|
, P, in_rah.H, pos_t.delta_clk);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
+69
-51
@@ -1,68 +1,86 @@
|
|||||||
#include "brdm2pos.h"
|
#include "brdm2pos.h"
|
||||||
using namespace std;
|
using namespace std;
|
||||||
/* -------------------------------------------------------------------------- */
|
/**
|
||||||
/// @brief convert UTC to GPS Second of week
|
* Convert Time format to GPS second of week.
|
||||||
/// @param y year
|
*
|
||||||
/// @param m month
|
* \param y: Year of
|
||||||
/// @param d day
|
* \param m: Month of
|
||||||
/// @param h hour
|
* \param d: Day of
|
||||||
/// @param min minute
|
* \param h: Hour of
|
||||||
/// @param sec second
|
* \param min: Minute of
|
||||||
/// @return return GPS Second of week
|
* \param sec: Second of
|
||||||
/* -------------------------------------------------------------------------- */
|
* \return GPS: Second of week
|
||||||
|
*/
|
||||||
double Time2GPST(int y, int m, int d, double h, int min, double sec)
|
double Time2GPST(int y, int m, int d, double h, int min, double sec)
|
||||||
{
|
{
|
||||||
if (m > 2)
|
if (m > 2)
|
||||||
{
|
{
|
||||||
y = y;
|
y = y;
|
||||||
m = m;
|
m = m;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m <= 2)
|
if (m <= 2)
|
||||||
{
|
{
|
||||||
y = y - 1;
|
y = y - 1;
|
||||||
m = m + 12;
|
m = m + 12;
|
||||||
}
|
}
|
||||||
|
|
||||||
h = h + min / 60.0 + sec / 3600.0;
|
h = h + min / 60.0 + sec / 3600.0;
|
||||||
double JD = (int)(365.25 * y) + (int)(30.6001 * (m + 1)) + d + h / 24.0 + 1720981.5;
|
double JD = (int)(365.25 * y) + (int)(30.6001 * (m + 1)) + d + h / 24.0 + 1720981.5;
|
||||||
double MJD = JD - 2400000.5;
|
double MJD = JD - 2400000.5;
|
||||||
int gpsweek = (int)((MJD - 44244) / 7);
|
int gpsweek = (int)((MJD - 44244) / 7);
|
||||||
double secofweek = (MJD - 44244.0 - gpsweek * 7.0) * 86400.0;
|
double secofweek = (MJD - 44244.0 - gpsweek * 7.0) * 86400.0;
|
||||||
return secofweek;
|
return secofweek;
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* Convert UTC(SU) time to GPS second of week.
|
||||||
|
*
|
||||||
|
* \param JD_UTCSU: JD of UTC(SU) time
|
||||||
|
* \return GPS: Second of week
|
||||||
|
*/
|
||||||
double JDUTC2GPST(double JD_UTCSU)
|
double JDUTC2GPST(double JD_UTCSU)
|
||||||
{
|
{
|
||||||
double n;//Leap second
|
double n;//Leap second
|
||||||
|
|
||||||
if (2451179.5000000 < JD_UTCSU && JD_UTCSU < 2453736.5000000) { n = 32.0; }
|
if (2451179.5000000 < JD_UTCSU && JD_UTCSU < 2453736.5000000) { n = 32.0; }
|
||||||
else if (2453736.5000000 < JD_UTCSU && JD_UTCSU < 2454832.5000000) { n = 33.0; }
|
else if (2453736.5000000 < JD_UTCSU && JD_UTCSU < 2454832.5000000) { n = 33.0; }
|
||||||
else if (2454832.5000000 < JD_UTCSU && JD_UTCSU < 2455927.5000000) { n = 34.0; }
|
else if (2454832.5000000 < JD_UTCSU && JD_UTCSU < 2455927.5000000) { n = 34.0; }
|
||||||
else if (2455927.5000000 < JD_UTCSU && JD_UTCSU < 2457023.5000000) { n = 35.0; }
|
else if (2455927.5000000 < JD_UTCSU && JD_UTCSU < 2457023.5000000) { n = 35.0; }
|
||||||
else if (2457023.5000000 < JD_UTCSU && JD_UTCSU < 2457754.5000000) { n = 36.0; }
|
else if (2457023.5000000 < JD_UTCSU && JD_UTCSU < 2457754.5000000) { n = 36.0; }
|
||||||
else if (2457754.5000000 < JD_UTCSU) { n = 37.0; }
|
else if (2457754.5000000 < JD_UTCSU) { n = 37.0; }
|
||||||
|
|
||||||
JD_UTCSU += ((n * 1 - 19) / 3600.0) / 24.0;
|
JD_UTCSU += ((n * 1 - 19) / 3600.0) / 24.0;
|
||||||
double MJD = JD_UTCSU - 2400000.5;
|
double MJD = JD_UTCSU - 2400000.5;
|
||||||
int gpsweek = (int)((MJD - 44244) / 7);
|
int gpsweek = (int)((MJD - 44244) / 7);
|
||||||
double secofweek = (MJD - 44244.0 - gpsweek * 7.0) * 86400.0;
|
double secofweek = (MJD - 44244.0 - gpsweek * 7.0) * 86400.0;
|
||||||
return secofweek;
|
return secofweek;
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* Convert UTC time to JD format.
|
||||||
|
*
|
||||||
|
* \param y: Year of UTC time
|
||||||
|
* \param m: Month of UTC time
|
||||||
|
* \param d: Day of UTC time
|
||||||
|
* \param h: Hour of UTC time
|
||||||
|
* \param min: Minute of UTC time
|
||||||
|
* \param sec: Second of UTC time
|
||||||
|
* \return JD:
|
||||||
|
*/
|
||||||
double UTCTime2JD(int y, int m, int d, double h, int min, double sec)
|
double UTCTime2JD(int y, int m, int d, double h, int min, double sec)
|
||||||
{
|
{
|
||||||
if (m > 2)
|
if (m > 2)
|
||||||
{
|
{
|
||||||
y = y;
|
y = y;
|
||||||
m = m;
|
m = m;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m <= 2)
|
if (m <= 2)
|
||||||
{
|
{
|
||||||
y = y - 1;
|
y = y - 1;
|
||||||
m = m + 12;
|
m = m + 12;
|
||||||
}
|
}
|
||||||
|
|
||||||
h = h + min / 60.0 + sec / 3600.0;
|
h = h + min / 60.0 + sec / 3600.0;
|
||||||
double JD = (int)(365.25 * y) + (int)(30.6001 * (m + 1)) + d + h / 24.0 + 1720981.5;
|
double JD = (int)(365.25 * y) + (int)(30.6001 * (m + 1)) + d + h / 24.0 + 1720981.5;
|
||||||
return JD;
|
return JD;
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user