Archived
See update notes:
This commit is contained in:
1 parent
a3fb64a657
commit
8059c482e3
13 files changed
+387
-118
No files matched your search
@@ -10,8 +10,8 @@ Support version of RINEX:
|
|||||||
Support system of GNSS:
|
Support system of GNSS:
|
||||||
* GPS: Satellite position solving & Receiver station orientation
|
* GPS: Satellite position solving & Receiver station orientation
|
||||||
* Galileo : Satellite position solving & Receiver station orientation
|
* Galileo : Satellite position solving & Receiver station orientation
|
||||||
* GLONASS : Satellite position solving
|
* GLONASS : Satellite position solving(OINP)
|
||||||
* BeiDou / Compass : Satellite position solving
|
* BeiDou / Compass : Satellite position solving(OINP)
|
||||||
|
|
||||||
Support method of orientation
|
Support method of orientation
|
||||||
* Pseudorange positioning
|
* Pseudorange positioning
|
||||||
@@ -33,6 +33,10 @@ Support method of orientation
|
|||||||
|
|
||||||
## Project Update
|
## Project Update
|
||||||
|
|
||||||
|
Update: 2024/11/03:
|
||||||
|
1. KNZ_GeoTrackLab: Fix some bug, Modify some UI logic.
|
||||||
|
2. KNZ_GeoTrackLab: Complete the function of Satellite track plot.
|
||||||
|
|
||||||
Update: 2024/11/03:
|
Update: 2024/11/03:
|
||||||
1. KNZ_GeoTrackLab: Fix some bug, Modify some UI logic.
|
1. KNZ_GeoTrackLab: Fix some bug, Modify some UI logic.
|
||||||
2. KNZ_GeoTrackLab: Remove 3D plot function.
|
2. KNZ_GeoTrackLab: Remove 3D plot function.
|
||||||
|
|||||||
+6
-2
@@ -33,10 +33,14 @@
|
|||||||
|
|
||||||
## 项目更新
|
## 项目更新
|
||||||
|
|
||||||
|
更新:2024/10/31:
|
||||||
|
1. KNZ_GeoTrackLab: 修复一些bug, 优化UI逻辑。
|
||||||
|
2. KNZ_GeoTrackLab: 完成卫星轨迹绘图功能。
|
||||||
|
|
||||||
更新: 2024/10/31:
|
更新: 2024/10/31:
|
||||||
1. KNZ_GeoTrackLab: 修复一些bug, 优化UI逻辑.
|
1. KNZ_GeoTrackLab: 修复一些bug, 优化UI逻辑。
|
||||||
2. KNZ_GeoTrackLab: 移除3D绘图功能。
|
2. KNZ_GeoTrackLab: 移除3D绘图功能。
|
||||||
2. KNZ_GeoTrackLab: 合并功能并专一化.
|
2. KNZ_GeoTrackLab: 合并功能并专一化。
|
||||||
3. KNZ_GeoTrackLab: 新增:
|
3. KNZ_GeoTrackLab: 新增:
|
||||||
卫星轨迹投影图(还未实现功能化)。
|
卫星轨迹投影图(还未实现功能化)。
|
||||||
|
|
||||||
|
|||||||
+17
-15
@@ -1,13 +1,15 @@
|
|||||||
|
# @ File : Config_file.py
|
||||||
#
|
#
|
||||||
|
# Copyright (c) 2024 KenanZhu. All Right Reserved.
|
||||||
#
|
#
|
||||||
|
# @ Author : KenanZhu
|
||||||
|
# @ Time : 2024/11/04
|
||||||
|
# @ Brief : Initialize the configuration file.
|
||||||
|
# #
|
||||||
|
# @ IDE : PyCharm 2024.2.1 (Community Edition)
|
||||||
#
|
#
|
||||||
#
|
# ----------------------------------------------------------------------------------------
|
||||||
#
|
|
||||||
#
|
|
||||||
#
|
|
||||||
#
|
|
||||||
#
|
|
||||||
#-----------------------------------------------------------------#
|
|
||||||
from configparser import ConfigParser
|
from configparser import ConfigParser
|
||||||
|
|
||||||
class Configinit:
|
class Configinit:
|
||||||
@@ -20,8 +22,8 @@ class Configinit:
|
|||||||
def load_config(self):
|
def load_config(self):
|
||||||
# -------------------------------------------------------------------------------
|
# -------------------------------------------------------------------------------
|
||||||
# >
|
# >
|
||||||
# Method:
|
# Method: load_config
|
||||||
# Brief :
|
# Brief : Load config file, if not exist, regenerate the config.
|
||||||
# Author: @KenanZhu All Right Reserved.
|
# Author: @KenanZhu All Right Reserved.
|
||||||
# -------------------------------------------------------------------------------
|
# -------------------------------------------------------------------------------
|
||||||
try:
|
try:
|
||||||
@@ -33,8 +35,8 @@ class Configinit:
|
|||||||
def get_config(self):
|
def get_config(self):
|
||||||
# -------------------------------------------------------------------------------
|
# -------------------------------------------------------------------------------
|
||||||
# >
|
# >
|
||||||
# Method:
|
# Method: get_config
|
||||||
# Brief :
|
# Brief : Capture config instance handle.
|
||||||
# Author: @KenanZhu All Right Reserved.
|
# Author: @KenanZhu All Right Reserved.
|
||||||
# -------------------------------------------------------------------------------
|
# -------------------------------------------------------------------------------
|
||||||
self.config.read(self.config_filepath)
|
self.config.read(self.config_filepath)
|
||||||
@@ -43,8 +45,8 @@ class Configinit:
|
|||||||
def create_config(self):
|
def create_config(self):
|
||||||
# -------------------------------------------------------------------------------
|
# -------------------------------------------------------------------------------
|
||||||
# >
|
# >
|
||||||
# Method:
|
# Method: create_config
|
||||||
# Brief :
|
# Brief : Generate the initial config file.
|
||||||
# Author: @KenanZhu All Right Reserved.
|
# Author: @KenanZhu All Right Reserved.
|
||||||
# -------------------------------------------------------------------------------
|
# -------------------------------------------------------------------------------
|
||||||
### Config for software info
|
### Config for software info
|
||||||
@@ -81,8 +83,8 @@ class Configinit:
|
|||||||
def save_config(self):
|
def save_config(self):
|
||||||
# -------------------------------------------------------------------------------
|
# -------------------------------------------------------------------------------
|
||||||
# >
|
# >
|
||||||
# Method:
|
# Method: save_config
|
||||||
# Brief :
|
# Brief : Save changes of config file.
|
||||||
# Author: @KenanZhu All Right Reserved.
|
# Author: @KenanZhu All Right Reserved.
|
||||||
# -------------------------------------------------------------------------------
|
# -------------------------------------------------------------------------------
|
||||||
with open(self.config_filepath, 'w') as configfile:
|
with open(self.config_filepath, 'w') as configfile:
|
||||||
|
|||||||
+286
-56
@@ -1,24 +1,31 @@
|
|||||||
|
# @ File : Func_callback.py
|
||||||
#
|
#
|
||||||
|
# Copyright (c) 2024 KenanZhu. All Right Reserved.
|
||||||
#
|
#
|
||||||
|
# @ Author : KenanZhu
|
||||||
|
# @ Time : 2024/11/04
|
||||||
|
# @ Brief : Interactive control callback function class.
|
||||||
|
# #
|
||||||
|
# @ IDE : PyCharm 2024.2.1 (Community Edition)
|
||||||
#
|
#
|
||||||
#
|
# ----------------------------------------------------------------------------------------
|
||||||
#
|
|
||||||
#
|
|
||||||
#
|
|
||||||
#
|
|
||||||
#
|
|
||||||
#-----------------------------------------------------------------#
|
|
||||||
### Std
|
### Std
|
||||||
|
import math
|
||||||
import threading
|
import threading
|
||||||
|
|
||||||
|
import numpy as np
|
||||||
import ctypes as ct
|
import ctypes as ct
|
||||||
import tkinter as tk
|
import tkinter as tk
|
||||||
|
import cartopy.crs as ccrs
|
||||||
|
|
||||||
from tkinter import filedialog
|
from tkinter import filedialog
|
||||||
from tkinter import colorchooser
|
from tkinter import colorchooser
|
||||||
|
|
||||||
class CALLBACK:
|
class CALLBACK:
|
||||||
def __init__(self, cfg, cfg_get):
|
def __init__(self, cfg, cfg_get):
|
||||||
|
# init
|
||||||
|
# -------------------------------------------------------------------------------
|
||||||
self.cfg = cfg
|
self.cfg = cfg
|
||||||
self.cfg_get = cfg_get
|
self.cfg_get = cfg_get
|
||||||
|
|
||||||
@@ -58,20 +65,19 @@ class CALLBACK:
|
|||||||
if self.outdir.get(i):
|
if self.outdir.get(i):
|
||||||
self.outvar += (self.outdir.get(i),)
|
self.outvar += (self.outdir.get(i),)
|
||||||
### Const value
|
### Const value
|
||||||
global blank, C_V
|
global blank
|
||||||
blank = ' '
|
blank = ' '
|
||||||
C_V = 299792458
|
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def Move_center(hwnd, win_x, win_y):
|
def Move_center(hwnd, win_x, win_y):
|
||||||
# -------------------------------------------------------------------------------
|
# -------------------------------------------------------------------------------
|
||||||
# >
|
# >
|
||||||
# Method:
|
# Method: Move_Ccenter
|
||||||
# Brief :
|
# Brief : Move the window to the center of screen.
|
||||||
# Param :
|
# Param : hwnd : instance handle of window
|
||||||
#
|
# win_x: the x size of window
|
||||||
#
|
# win_y: the y size of window
|
||||||
# Return:
|
# Return: none
|
||||||
# Author: @KenanZhu All Right Reserved.
|
# Author: @KenanZhu All Right Reserved.
|
||||||
# -------------------------------------------------------------------------------
|
# -------------------------------------------------------------------------------
|
||||||
position_x = int((hwnd.winfo_screenwidth() - win_x) / 2)
|
position_x = int((hwnd.winfo_screenwidth() - win_x) / 2)
|
||||||
@@ -81,12 +87,13 @@ class CALLBACK:
|
|||||||
def Calcuconfirm(self, cionbox, ctrobox, canglebox, systemv):
|
def Calcuconfirm(self, cionbox, ctrobox, canglebox, systemv):
|
||||||
# -------------------------------------------------------------------------------
|
# -------------------------------------------------------------------------------
|
||||||
# >
|
# >
|
||||||
# Method:
|
# Method: Calcuconfirm
|
||||||
# Brief :
|
# Brief : Callback function of confirm button of options window
|
||||||
# Param :
|
# Param : cionbox : iono combobox handle
|
||||||
#
|
# ctrobox : trop combobox handle
|
||||||
#
|
# canglabox: elev angle of sat combobox handle
|
||||||
# Return:
|
# systemv : sat system button handle
|
||||||
|
# Return: none
|
||||||
# Author: @KenanZhu All Right Reserved.
|
# Author: @KenanZhu All Right Reserved.
|
||||||
# -------------------------------------------------------------------------------
|
# -------------------------------------------------------------------------------
|
||||||
|
|
||||||
@@ -99,13 +106,13 @@ class CALLBACK:
|
|||||||
def Colorchoose(self, hwndparent, i, colorlab, mode):
|
def Colorchoose(self, hwndparent, i, colorlab, mode):
|
||||||
# -------------------------------------------------------------------------------
|
# -------------------------------------------------------------------------------
|
||||||
# >
|
# >
|
||||||
# Method:
|
# Method: Colorchoose
|
||||||
# Brief :
|
# Brief : Color choose card of options callback function.
|
||||||
# Param : hwndparent :
|
# Param : hwndparent : instance handle of options window
|
||||||
# i : 0==e & 1==n & 2==u & 3==satn
|
# i : 0==e & 1==n & 2==u & 3==satn
|
||||||
# colorlab :
|
# colorlab : color label handle
|
||||||
# mode :
|
# mode : 0==undo & 1==select & 2==save change
|
||||||
# Return:
|
# Return: none
|
||||||
# Author: @KenanZhu All Right Reserved.
|
# Author: @KenanZhu All Right Reserved.
|
||||||
# -------------------------------------------------------------------------------
|
# -------------------------------------------------------------------------------
|
||||||
match mode:
|
match mode:
|
||||||
@@ -141,13 +148,13 @@ class CALLBACK:
|
|||||||
def Linewchoose(self, entry0, entry1, entry2, mode):
|
def Linewchoose(self, entry0, entry1, entry2, mode):
|
||||||
# -------------------------------------------------------------------------------
|
# -------------------------------------------------------------------------------
|
||||||
# >
|
# >
|
||||||
# Method:
|
# Method: Linewchoose
|
||||||
# Brief :
|
# Brief : Line width selection of plot.
|
||||||
# Param : entry0 : spinbox handle
|
# Param : entry0 : spinbox handle
|
||||||
# entry1 : spinbox handle
|
# entry1 : spinbox handle
|
||||||
# entry2 : spinbox handle
|
# entry2 : spinbox handle
|
||||||
# mode : 0==undo & 1==confirm
|
# mode : 0==undo & 1==confirm
|
||||||
# Return:
|
# Return: none
|
||||||
# Author: @KenanZhu All Right Reserved.
|
# Author: @KenanZhu All Right Reserved.
|
||||||
# -------------------------------------------------------------------------------
|
# -------------------------------------------------------------------------------
|
||||||
match mode:
|
match mode:
|
||||||
@@ -165,11 +172,11 @@ class CALLBACK:
|
|||||||
def Dir_or_name_get(path, mode):
|
def Dir_or_name_get(path, mode):
|
||||||
# -------------------------------------------------------------------------------
|
# -------------------------------------------------------------------------------
|
||||||
# >
|
# >
|
||||||
# Method:
|
# Method: Dir_or_name_get
|
||||||
# Brief :
|
# Brief : Get the filedir or filename form path
|
||||||
# Param : path :
|
# Param : path : file path
|
||||||
# mode : 0==get file name & 1==get file dir
|
# mode : 0==get file name & 1==get file dir
|
||||||
# Return:
|
# Return: mode==0 return filename,mode==1 return file dir
|
||||||
# Author: @KenanZhu All Right Reserved.
|
# Author: @KenanZhu All Right Reserved.
|
||||||
# -------------------------------------------------------------------------------
|
# -------------------------------------------------------------------------------
|
||||||
global nameend, filename, filedir
|
global nameend, filename, filedir
|
||||||
@@ -198,10 +205,11 @@ class CALLBACK:
|
|||||||
def GetObsFilePath(self, hwndparent, ObsFileSelectBox):
|
def GetObsFilePath(self, hwndparent, ObsFileSelectBox):
|
||||||
# -------------------------------------------------------------------------------
|
# -------------------------------------------------------------------------------
|
||||||
# >
|
# >
|
||||||
# Method:
|
# Method: GetObsFilePath
|
||||||
# Brief :
|
# Brief : Get obs file path of RINEX.
|
||||||
# Param :
|
# Param : hwndparent : instance handle of RINEX processor window
|
||||||
# Return:
|
# ObsFileSelectBox : string value of path combobox
|
||||||
|
# Return: none
|
||||||
# Author: @KenanZhu All Right Reserved.
|
# Author: @KenanZhu All Right Reserved.
|
||||||
# -------------------------------------------------------------------------------
|
# -------------------------------------------------------------------------------
|
||||||
path = filedialog.askopenfilename(
|
path = filedialog.askopenfilename(
|
||||||
@@ -222,10 +230,11 @@ class CALLBACK:
|
|||||||
def GetNavFilePath(self, hwndparent, NavFileSelectBox):
|
def GetNavFilePath(self, hwndparent, NavFileSelectBox):
|
||||||
# -------------------------------------------------------------------------------
|
# -------------------------------------------------------------------------------
|
||||||
# >
|
# >
|
||||||
# Method:
|
# Method: GetNavFilePath
|
||||||
# Brief :
|
# Brief : Get nav file path of RINEX.
|
||||||
# Param :
|
# Param : hwndparent : instance handle of RINEX processor window
|
||||||
# Return:
|
# NavFileSelectBox : string value of path combobox
|
||||||
|
# Return: none
|
||||||
# Author: @KenanZhu All Right Reserved.
|
# Author: @KenanZhu All Right Reserved.
|
||||||
# -------------------------------------------------------------------------------
|
# -------------------------------------------------------------------------------
|
||||||
path = filedialog.askopenfilename(
|
path = filedialog.askopenfilename(
|
||||||
@@ -247,10 +256,11 @@ class CALLBACK:
|
|||||||
def AskDirectory(self, hwndparent, AskDirectorySelectBox):
|
def AskDirectory(self, hwndparent, AskDirectorySelectBox):
|
||||||
# -------------------------------------------------------------------------------
|
# -------------------------------------------------------------------------------
|
||||||
# >
|
# >
|
||||||
# Method:
|
# Method: AskDirectory
|
||||||
# Brief :
|
# Brief : Get the output file diectory.
|
||||||
# Param :
|
# Param : hwndparent : instance handle of RINEX processor window
|
||||||
# Return:
|
# AskDirectorySelectBox : instance handle of dir combox
|
||||||
|
# Return: none
|
||||||
# Author: @KenanZhu All Right Reserved.
|
# Author: @KenanZhu All Right Reserved.
|
||||||
# -------------------------------------------------------------------------------
|
# -------------------------------------------------------------------------------
|
||||||
path = filedialog.askdirectory(parent=hwndparent)
|
path = filedialog.askdirectory(parent=hwndparent)
|
||||||
@@ -269,10 +279,12 @@ class CALLBACK:
|
|||||||
AskDirectorySelectButton):
|
AskDirectorySelectButton):
|
||||||
# -------------------------------------------------------------------------------
|
# -------------------------------------------------------------------------------
|
||||||
# >
|
# >
|
||||||
# Method:
|
# Method: AskOrNotCheck
|
||||||
# Brief :
|
# Brief : Check the file diectory.
|
||||||
# Param :
|
# Param : AskOrNotCheckVar : button int value
|
||||||
# Return:
|
# AskDirectorySelectBox : instance handle of dir combobox
|
||||||
|
# AskDirectorySelectButton : instance handle dir select button
|
||||||
|
# Return: none
|
||||||
# Author: @KenanZhu All Right Reserved.
|
# Author: @KenanZhu All Right Reserved.
|
||||||
# -------------------------------------------------------------------------------
|
# -------------------------------------------------------------------------------
|
||||||
if AskOrNotCheckVar.get() == 0:
|
if AskOrNotCheckVar.get() == 0:
|
||||||
@@ -290,11 +302,8 @@ class CALLBACK:
|
|||||||
DirectorySelectBoxVar):
|
DirectorySelectBoxVar):
|
||||||
# -------------------------------------------------------------------------------
|
# -------------------------------------------------------------------------------
|
||||||
# >
|
# >
|
||||||
# Method:
|
# Method: ExecuteFile
|
||||||
# Brief :
|
# Brief : Execute RINEX file into .ksln.
|
||||||
# Param :
|
|
||||||
#
|
|
||||||
# Return:
|
|
||||||
# Author: @KenanZhu All Right Reserved.
|
# Author: @KenanZhu All Right Reserved.
|
||||||
# -------------------------------------------------------------------------------
|
# -------------------------------------------------------------------------------
|
||||||
statemsg = ""
|
statemsg = ""
|
||||||
@@ -364,6 +373,227 @@ class CALLBACK:
|
|||||||
DirectorySelectBoxVar))
|
DirectorySelectBoxVar))
|
||||||
T.start()
|
T.start()
|
||||||
|
|
||||||
|
def OpenkslnFile(self,
|
||||||
|
explot,nxplot,uxplot,satnplot,visbplot,
|
||||||
|
canvas0,canvas1,plotstate):
|
||||||
|
# -------------------------------------------------------------------------------
|
||||||
|
# >
|
||||||
|
# Method: OpenkslnFile
|
||||||
|
# Brief : Plot by open ksln as pos solution.
|
||||||
|
# Author: @KenanZhu All Right Reserved.
|
||||||
|
# -------------------------------------------------------------------------------
|
||||||
|
path = filedialog.askopenfilename(title='Open as Pos Solution',
|
||||||
|
filetypes=[('Solution File(*.ksln)', '*.ksln'),
|
||||||
|
('All Files', '*.*')])
|
||||||
|
with open(path,'r')as f:
|
||||||
|
while 1:
|
||||||
|
line = f.readline()
|
||||||
|
if line.find('APPROX POSITION XYZ')>=0:
|
||||||
|
apx = float(line[22:35])
|
||||||
|
apy = float(line[35:48])
|
||||||
|
apz = float(line[48:61])
|
||||||
|
elif line.find('APPROX POSITION BLH')>=0:
|
||||||
|
apb = float(line[22:35])
|
||||||
|
apl = float(line[35:48])
|
||||||
|
aph = float(line[48:61])
|
||||||
|
S = np.array([
|
||||||
|
[-math.sin(apl) , math.cos(apl) , 0],
|
||||||
|
[-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)]
|
||||||
|
])
|
||||||
|
elif line.find('INTERVAL')>=0:
|
||||||
|
ive = float(line[22:27])
|
||||||
|
elif line.find('<END OF HEADER')>=0:
|
||||||
|
plotstate.config(text="Reading...")
|
||||||
|
break
|
||||||
|
|
||||||
|
satnum = 0
|
||||||
|
ENU = np.empty((3,0))
|
||||||
|
EPO = np.empty((1,0))
|
||||||
|
NUM = np.empty((1,0))
|
||||||
|
while 1:
|
||||||
|
line = f.readline()
|
||||||
|
if line[0:1]=='>':
|
||||||
|
satnum = 0
|
||||||
|
EPO = np.hstack((EPO,[[float(line[1:6])]]))
|
||||||
|
plotstate.config(text='Reading...%5d/%5d Mode: Single solving'
|
||||||
|
%(int(line[1:6]), int(86400/ive)))
|
||||||
|
|
||||||
|
elif line[0:1]==self.system.get(int(
|
||||||
|
self.cfg_get['Options_Calc']['sat_system']
|
||||||
|
)) and line.find('END')==-1 and line.find('Rec')==-1:
|
||||||
|
satnum += 1
|
||||||
|
|
||||||
|
elif line.find('Rec:')>=0:
|
||||||
|
if line.find('insufficient')>=0:
|
||||||
|
ds = np.array([
|
||||||
|
[0],
|
||||||
|
[0],
|
||||||
|
[0]
|
||||||
|
])
|
||||||
|
else:
|
||||||
|
ds = np.array([
|
||||||
|
[float(line[ 4:13])],
|
||||||
|
[float(line[14:23])],
|
||||||
|
[float(line[24:33])]
|
||||||
|
])
|
||||||
|
ENU = np.hstack((ENU,S@ds))
|
||||||
|
NUM = np.hstack((NUM,[[satnum]]))
|
||||||
|
elif line.find('END')>=0:
|
||||||
|
# plot on the e
|
||||||
|
# -------------------------------------------------------------------
|
||||||
|
explot.clear()
|
||||||
|
nxplot.clear()
|
||||||
|
uxplot.clear()
|
||||||
|
# plot on n
|
||||||
|
# -------------------------------------------------------------------
|
||||||
|
explot.plot(
|
||||||
|
EPO[0, :],
|
||||||
|
ENU[0, :],
|
||||||
|
marker='.',
|
||||||
|
linestyle=':',
|
||||||
|
ms=self.cfg_get['Options_Draw']['e_line'],
|
||||||
|
color=self.cfg_get['Options_Draw']['e_color'],
|
||||||
|
linewidth=self.cfg_get['Options_Draw']['e_line'],
|
||||||
|
)
|
||||||
|
explot.set_title(' E-W(m)', x=0.02, y=0, fontsize=8)
|
||||||
|
explot.grid(True, linestyle='--', alpha=0.7)
|
||||||
|
# plot on u
|
||||||
|
# -------------------------------------------------------------------
|
||||||
|
nxplot.plot(
|
||||||
|
EPO[0, :],
|
||||||
|
ENU[1, :],
|
||||||
|
marker='.',
|
||||||
|
linestyle=':',
|
||||||
|
ms=self.cfg_get['Options_Draw']['n_line'],
|
||||||
|
color=self.cfg_get['Options_Draw']['n_color'],
|
||||||
|
linewidth=self.cfg_get['Options_Draw']['n_line'],
|
||||||
|
)
|
||||||
|
nxplot.set_title(' N-S(m)', x=0.02, y=0, fontsize=8)
|
||||||
|
nxplot.grid(True, linestyle='--', alpha=0.7)
|
||||||
|
# plot on u
|
||||||
|
# -------------------------------------------------------------------
|
||||||
|
uxplot.plot(
|
||||||
|
EPO[0, :],
|
||||||
|
ENU[2, :],
|
||||||
|
marker='.',
|
||||||
|
linestyle=':',
|
||||||
|
ms=self.cfg_get['Options_Draw']['u_line'],
|
||||||
|
color=self.cfg_get['Options_Draw']['u_color'],
|
||||||
|
linewidth=self.cfg_get['Options_Draw']['u_line'],
|
||||||
|
)
|
||||||
|
uxplot.set_title(' U-D(m)', x=0.02, y=0, fontsize=8)
|
||||||
|
uxplot.grid(True, linestyle='--', alpha=0.7)
|
||||||
|
canvas0.draw()
|
||||||
|
|
||||||
|
satnplot.clear()
|
||||||
|
satnplot.plot(
|
||||||
|
EPO[0, :],
|
||||||
|
NUM[0, :],
|
||||||
|
ms=5,
|
||||||
|
marker='|',
|
||||||
|
linewidth=0,
|
||||||
|
linestyle=None,
|
||||||
|
color=self.cfg_get['Options_Draw']['sat_amount_color'],
|
||||||
|
)
|
||||||
|
satnplot.set_title('Valid Satellite Numbers', loc='left', fontsize=8)
|
||||||
|
satnplot.set_xlabel('Epochs')
|
||||||
|
satnplot.grid(True, linestyle='--', alpha=0.7)
|
||||||
|
|
||||||
|
canvas1.draw()
|
||||||
|
|
||||||
|
f.close()
|
||||||
|
|
||||||
|
plotstate.config(text="Plot form: %s" % path)
|
||||||
|
break
|
||||||
|
|
||||||
|
def _OpenkslnFile(self,
|
||||||
|
explot, nxplot, uxplot, satnplot, visbplot,
|
||||||
|
canvas0, canvas1, plotstate):
|
||||||
|
T = threading.Thread(
|
||||||
|
target=lambda :self.OpenkslnFile(
|
||||||
|
explot,nxplot,uxplot,satnplot,visbplot,
|
||||||
|
canvas0,canvas1,plotstate)
|
||||||
|
)
|
||||||
|
T.start()
|
||||||
|
|
||||||
|
def Plot2polar(self, sattrack, plotstate, canvas2):
|
||||||
|
# -------------------------------------------------------------------------------
|
||||||
|
# >
|
||||||
|
# Method:
|
||||||
|
# Brief :
|
||||||
|
# Author: @KenanZhu All Right Reserved.
|
||||||
|
# -------------------------------------------------------------------------------
|
||||||
|
path = filedialog.askopenfilename(title='Open as Sat Solution',
|
||||||
|
filetypes=[('Solution File(*.ksln)', '*.ksln'),
|
||||||
|
('All Files', '*.*')])
|
||||||
|
sattrack.clear()
|
||||||
|
with open(path,'r') as f:
|
||||||
|
while 1:
|
||||||
|
line = f.readline()
|
||||||
|
if line.find('APPROX POSITION BLH')>=0:
|
||||||
|
apb = math.degrees( float(line[22:35]) )
|
||||||
|
apl = math.degrees( float(line[35:48]) )
|
||||||
|
elif line.find('GENERATE SOURCE')>=0:
|
||||||
|
marker = line[22:26]
|
||||||
|
elif line.find('INTERVAL')>=0:
|
||||||
|
ive = float(line[22:27])
|
||||||
|
elif line.find('<END OF HEADER')>=0:
|
||||||
|
break
|
||||||
|
epoch = 0
|
||||||
|
while 1:
|
||||||
|
line =f.readline()
|
||||||
|
if line[0:1]=='>':
|
||||||
|
epoch = int(line[1:6])
|
||||||
|
plotstate.config(text="Reading...%5d/%5d Mode: Sat track plot"
|
||||||
|
%(int(line[1:6]), int(86400/ive)))
|
||||||
|
elif line[0:1]==blank:
|
||||||
|
pass
|
||||||
|
elif line[0:1]==self.system.get(int(self.cfg_get['Options_Calc']['sat_system'])
|
||||||
|
) and line.find('END')==-1 and line.find('Rec')==-1:
|
||||||
|
if epoch % 10==0:
|
||||||
|
b = math.degrees( float(line[ 4:13]) )
|
||||||
|
l = math.degrees( float(line[14:23]) )
|
||||||
|
sattrack.scatter(l,b,color='b',s=2,
|
||||||
|
transform=ccrs.PlateCarree())
|
||||||
|
else:
|
||||||
|
pass
|
||||||
|
|
||||||
|
elif line.find('END')>=0:
|
||||||
|
plotstate.config(text="Plotting...")
|
||||||
|
|
||||||
|
sattrack.scatter(apl, apb, color='#ff8000', s=35,
|
||||||
|
transform=ccrs.PlateCarree())
|
||||||
|
sattrack.text(apl, apb, blank * 4 + marker, color='#ff8000',
|
||||||
|
fontsize=12, fontweight='bold'
|
||||||
|
, transform=ccrs.PlateCarree())
|
||||||
|
plotstate.config(text="Reading...")
|
||||||
|
|
||||||
|
sattrack.coastlines(resolution='110m')
|
||||||
|
sattrack.gridlines()
|
||||||
|
canvas2.draw()
|
||||||
|
|
||||||
|
plotstate.config(text="Done !")
|
||||||
|
|
||||||
|
def _Plot2polar(self, sattrack, plotstate, canvas2):
|
||||||
|
T = threading.Thread(
|
||||||
|
target=lambda :self.Plot2polar(sattrack, plotstate, canvas2)
|
||||||
|
)
|
||||||
|
T.start()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
+8
-7
@@ -1,13 +1,14 @@
|
|||||||
|
# @ File : UI_about.py
|
||||||
#
|
#
|
||||||
|
# Copyright (c) 2024 KenanZhu. All Right Reserved.
|
||||||
#
|
#
|
||||||
|
# @ Author : KenanZhu
|
||||||
|
# @ Time : 2024/11/04
|
||||||
|
# @ Brief : Help info window class.
|
||||||
|
# #
|
||||||
|
# @ IDE : PyCharm 2024.2.1 (Community Edition)
|
||||||
#
|
#
|
||||||
#
|
# ----------------------------------------------------------------------------------------
|
||||||
#
|
|
||||||
#
|
|
||||||
#
|
|
||||||
#
|
|
||||||
#
|
|
||||||
#-----------------------------------------------------------------#
|
|
||||||
|
|
||||||
### Std
|
### Std
|
||||||
import tkinter as tk
|
import tkinter as tk
|
||||||
|
|||||||
+26
-10
@@ -1,13 +1,14 @@
|
|||||||
|
# @ File : UI_main.py
|
||||||
#
|
#
|
||||||
|
# Copyright (c) 2024 KenanZhu. All Right Reserved.
|
||||||
#
|
#
|
||||||
|
# @ Author : KenanZhu
|
||||||
|
# @ Time : 2024/11/04
|
||||||
|
# @ Brief : Main window class.
|
||||||
|
# #
|
||||||
|
# @ IDE : PyCharm 2024.2.1 (Community Edition)
|
||||||
#
|
#
|
||||||
#
|
# ----------------------------------------------------------------------------------------
|
||||||
#
|
|
||||||
#
|
|
||||||
#
|
|
||||||
#
|
|
||||||
#
|
|
||||||
#-----------------------------------------------------------------#
|
|
||||||
|
|
||||||
### Self
|
### Self
|
||||||
import Ui_view as vie
|
import Ui_view as vie
|
||||||
@@ -28,6 +29,8 @@ from matplotlib.backends.backend_tkagg import (
|
|||||||
|
|
||||||
import tkinter as tk
|
import tkinter as tk
|
||||||
import tkinter.font as tkfont
|
import tkinter.font as tkfont
|
||||||
|
import cartopy.crs as ccrs
|
||||||
|
#import cartopy.feature as cfeature
|
||||||
import matplotlib as mpl
|
import matplotlib as mpl
|
||||||
mpl.use('TkAgg')
|
mpl.use('TkAgg')
|
||||||
import matplotlib.pyplot as plt
|
import matplotlib.pyplot as plt
|
||||||
@@ -201,12 +204,17 @@ class MAINGUI:
|
|||||||
### File > Open... > Open Pos Solution
|
### File > Open... > Open Pos Solution
|
||||||
openmenu.add_command(
|
openmenu.add_command(
|
||||||
label="Open Pos Solution",
|
label="Open Pos Solution",
|
||||||
accelerator='Ctrl+S'
|
accelerator='Ctrl+S',
|
||||||
|
command=lambda :self.func._OpenkslnFile(
|
||||||
|
self.ex,self.nx,self.ux,self.satn,self.satvisb,
|
||||||
|
self.canvas0,self.canvas1,self.plotstate)
|
||||||
)
|
)
|
||||||
### File > Open... > Open Sat Solution
|
### File > Open... > Open Sat Solution
|
||||||
openmenu.add_command(
|
openmenu.add_command(
|
||||||
label="Open Sat Solution",
|
label="Open Sat Solution",
|
||||||
accelerator='Ctrl+S'
|
accelerator='Ctrl+S',
|
||||||
|
command=lambda :self.func._Plot2polar(
|
||||||
|
self.sattrack,self.plotstate,self.canvas2)
|
||||||
)
|
)
|
||||||
### File > Open... > Open RINEX
|
### File > Open... > Open RINEX
|
||||||
openmenu.add_command(
|
openmenu.add_command(
|
||||||
@@ -380,13 +388,21 @@ class MAINGUI:
|
|||||||
|
|
||||||
plt.rc('font', family='Segoe UI')
|
plt.rc('font', family='Segoe UI')
|
||||||
fig = plt.figure()
|
fig = plt.figure()
|
||||||
self.sattrack = fig.add_subplot(projection='polar')
|
self.sattrack = fig.add_subplot(
|
||||||
|
projection=ccrs.PlateCarree()
|
||||||
|
)
|
||||||
|
self.sattrack.coastlines(resolution='110m')
|
||||||
|
self.sattrack.gridlines()
|
||||||
fig.subplots_adjust(
|
fig.subplots_adjust(
|
||||||
left=0,
|
left=0,
|
||||||
bottom=0.03,
|
bottom=0.03,
|
||||||
right=1,
|
right=1,
|
||||||
top=0.95
|
top=0.95
|
||||||
)
|
)
|
||||||
|
for spine in ['right', 'left']:
|
||||||
|
self.sattrack.spines[spine].set_visible(False)
|
||||||
|
self.sattrack.set_facecolor('#f5f5f5')
|
||||||
|
|
||||||
self.canvas2 = FigureCanvasTkAgg(fig, self.Figurefrm_Sky)
|
self.canvas2 = FigureCanvasTkAgg(fig, self.Figurefrm_Sky)
|
||||||
self.canvas2.draw()
|
self.canvas2.draw()
|
||||||
self.canvas2.get_tk_widget().pack(side=tk.BOTTOM, fill=tk.BOTH, expand=tk.YES)
|
self.canvas2.get_tk_widget().pack(side=tk.BOTTOM, fill=tk.BOTH, expand=tk.YES)
|
||||||
|
|||||||
+8
-7
@@ -1,13 +1,14 @@
|
|||||||
|
# @ File : UI_options.py
|
||||||
#
|
#
|
||||||
|
# Copyright (c) 2024 KenanZhu. All Right Reserved.
|
||||||
#
|
#
|
||||||
|
# @ Author : KenanZhu
|
||||||
|
# @ Time : 2024/11/04
|
||||||
|
# @ Brief : Plot options window class.
|
||||||
|
# #
|
||||||
|
# @ IDE : PyCharm 2024.2.1 (Community Edition)
|
||||||
#
|
#
|
||||||
#
|
# ----------------------------------------------------------------------------------------
|
||||||
#
|
|
||||||
#
|
|
||||||
#
|
|
||||||
#
|
|
||||||
#
|
|
||||||
#-----------------------------------------------------------------#
|
|
||||||
|
|
||||||
### Std
|
### Std
|
||||||
from PIL import ImageTk
|
from PIL import ImageTk
|
||||||
|
|||||||
+8
-7
@@ -1,13 +1,14 @@
|
|||||||
|
# @ File : UI_processor.py
|
||||||
#
|
#
|
||||||
|
# Copyright (c) 2024 KenanZhu. All Right Reserved.
|
||||||
#
|
#
|
||||||
|
# @ Author : KenanZhu
|
||||||
|
# @ Time : 2024/11/04
|
||||||
|
# @ Brief : RINEX file processor window class.
|
||||||
|
# #
|
||||||
|
# @ IDE : PyCharm 2024.2.1 (Community Edition)
|
||||||
#
|
#
|
||||||
#
|
# ----------------------------------------------------------------------------------------
|
||||||
#
|
|
||||||
#
|
|
||||||
#
|
|
||||||
#
|
|
||||||
#
|
|
||||||
#-----------------------------------------------------------------#
|
|
||||||
|
|
||||||
### Std
|
### Std
|
||||||
from tkinter import ttk
|
from tkinter import ttk
|
||||||
|
|||||||
+8
-7
@@ -1,13 +1,14 @@
|
|||||||
|
# @ File : UI_view.py
|
||||||
#
|
#
|
||||||
|
# Copyright (c) 2024 KenanZhu. All Right Reserved.
|
||||||
#
|
#
|
||||||
|
# @ Author : KenanZhu
|
||||||
|
# @ Time : 2024/11/04
|
||||||
|
# @ Brief : File viewer window class.
|
||||||
|
# #
|
||||||
|
# @ IDE : PyCharm 2024.2.1 (Community Edition)
|
||||||
#
|
#
|
||||||
#
|
# ----------------------------------------------------------------------------------------
|
||||||
#
|
|
||||||
#
|
|
||||||
#
|
|
||||||
#
|
|
||||||
#
|
|
||||||
#-----------------------------------------------------------------#
|
|
||||||
|
|
||||||
### Std
|
### Std
|
||||||
from PIL import ImageTk
|
from PIL import ImageTk
|
||||||
|
|||||||
@@ -237,6 +237,7 @@ typedef struct nav_body{//Body data of file of nav: GPS BeiDou Galileo GLONASS
|
|||||||
typedef struct obs_head{//Header data of file of obs
|
typedef struct obs_head{//Header data of file of obs
|
||||||
double ver;
|
double ver;
|
||||||
char type[30];
|
char type[30];
|
||||||
|
char marker[10];
|
||||||
|
|
||||||
double apX;
|
double apX;
|
||||||
double apY;
|
double apY;
|
||||||
|
|||||||
@@ -603,6 +603,10 @@ void read_o_h(FILE* fp_obs, pobs_head obs_h)
|
|||||||
strncpy(obs_h->type, buff + 20, 30);
|
strncpy(obs_h->type, buff + 20, 30);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
else if (strstr(lable, "MARKER NAME")) {
|
||||||
|
strncpy(obs_h->marker, buff + 0, 10);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
else if (strstr(lable, "APPROX POSITION XYZ")) {
|
else if (strstr(lable, "APPROX POSITION XYZ")) {
|
||||||
obs_h->apX = strtonum(buff, 0, 14);
|
obs_h->apX = strtonum(buff, 0, 14);
|
||||||
obs_h->apY = strtonum(buff, 0 + 14, 14);
|
obs_h->apY = strtonum(buff, 0 + 14, 14);
|
||||||
|
|||||||
+4
-2
@@ -286,7 +286,7 @@ int sat_pos_cal(pobs_head obs_h, pobs_epoch obs_e, pobs_body obs_b,
|
|||||||
break;
|
break;
|
||||||
case GAL:
|
case GAL:
|
||||||
obs.Per1[k] = obs_b->obs_gal[j][code2type(C1, obs_h->obstypenum_gal, obs_h->obscode_gal)];
|
obs.Per1[k] = obs_b->obs_gal[j][code2type(C1, obs_h->obstypenum_gal, obs_h->obscode_gal)];
|
||||||
obs.Per2[k] = obs_b->obs_gal[j][code2type(C2, obs_h->obstypenum_gal, obs_h->obscode_gal)];
|
obs.Per2[k] = obs_b->obs_gal[j][code2type(C6, obs_h->obstypenum_gal, obs_h->obscode_gal)];
|
||||||
obs.freq1 = FREQ1; obs.freq2 = FREQ6;
|
obs.freq1 = FREQ1; obs.freq2 = FREQ6;
|
||||||
break;
|
break;
|
||||||
case GLO:
|
case GLO:
|
||||||
@@ -325,7 +325,9 @@ int sat_pos_cal(pobs_head obs_h, pobs_epoch obs_e, pobs_body obs_b,
|
|||||||
stop++;
|
stop++;
|
||||||
}solution(solu, obs_h, ap_X, ap_Y, ap_Z);
|
}solution(solu, obs_h, ap_X, ap_Y, ap_Z);
|
||||||
}
|
}
|
||||||
else;
|
else {
|
||||||
|
fprintf(solu,"\nRec:insufficient quantity of sat, sat=%d",k);
|
||||||
|
}
|
||||||
free(in_lsq.l); free(in_lsq.m); free(in_lsq.n); free(in_lsq.o);
|
free(in_lsq.l); free(in_lsq.m); free(in_lsq.n); free(in_lsq.o);
|
||||||
free(in_lsq.B); free(in_lsq.P); free(in_lsq.L);
|
free(in_lsq.B); free(in_lsq.P); free(in_lsq.L);
|
||||||
return 1;
|
return 1;
|
||||||
|
|||||||
+5
-3
@@ -35,7 +35,7 @@ static double trosaastamoinen(pobs_head obs_h, double elev)
|
|||||||
return dtrop;
|
return dtrop;
|
||||||
}
|
}
|
||||||
/*Tropshere correction with hopfiled model*/
|
/*Tropshere correction with hopfiled model*/
|
||||||
static double trohopfiled(pobs_head obs_h, double elev)
|
static double trohopfield(pobs_head obs_h, double elev)
|
||||||
{
|
{
|
||||||
double P0, e0, T0, deltaSd, deltaSw, dtropd, dtropw, dtrop;
|
double P0, e0, T0, deltaSd, deltaSw, dtropd, dtropw, dtrop;
|
||||||
double B = obs_h->apB, L = obs_h->apL, H = obs_h->apH;
|
double B = obs_h->apB, L = obs_h->apL, H = obs_h->apH;
|
||||||
@@ -99,7 +99,7 @@ static double restcorr(pobs_head obs_h, acct_obs obs, int ionopt, int tropopt,
|
|||||||
}
|
}
|
||||||
switch (tropopt) {
|
switch (tropopt) {
|
||||||
case 0:break;
|
case 0:break;
|
||||||
case 1:dtrop = trohopfiled(obs_h, elev); break;
|
case 1:dtrop = trohopfield(obs_h, elev); break;
|
||||||
case 2:dtrop = trosaastamoinen(obs_h, elev); break;
|
case 2:dtrop = trosaastamoinen(obs_h, elev); break;
|
||||||
}
|
}
|
||||||
P = P - diono - dtrop;
|
P = P - diono - dtrop;
|
||||||
@@ -139,7 +139,8 @@ stations designmat(pobs_head obs_h, acct_obs obs,
|
|||||||
R = sqrt(
|
R = sqrt(
|
||||||
pow(l[i] - X, 2) +
|
pow(l[i] - X, 2) +
|
||||||
pow(m[i] - Y, 2) +
|
pow(m[i] - Y, 2) +
|
||||||
pow(n[i] - Z, 2));
|
pow(n[i] - Z, 2)
|
||||||
|
);
|
||||||
B[i + satnum * 0] = -(l[i] - X) / R;
|
B[i + satnum * 0] = -(l[i] - X) / R;
|
||||||
B[i + satnum * 1] = -(m[i] - Y) / R;
|
B[i + satnum * 1] = -(m[i] - Y) / R;
|
||||||
B[i + satnum * 2] = -(n[i] - Z) / R;
|
B[i + satnum * 2] = -(n[i] - Z) / R;
|
||||||
@@ -167,6 +168,7 @@ FILE* headerout(pobs_head obs_h,
|
|||||||
fclose(result_file_clear);
|
fclose(result_file_clear);
|
||||||
FILE* result_file = fopen(res_path, "a+");
|
FILE* result_file = fopen(res_path, "a+");
|
||||||
fprintf(result_file, ">GENERATE PROGRAM : KNZ_GeoTrackLab ver%s\n", KNZ_GTL_VER);
|
fprintf(result_file, ">GENERATE PROGRAM : KNZ_GeoTrackLab ver%s\n", KNZ_GTL_VER);
|
||||||
|
fprintf(result_file, " GENERATE SOURCE : %.10s\n", obs_h->marker);
|
||||||
fprintf(result_file, " GENERATE TYPE : Satellite Position\n");
|
fprintf(result_file, " GENERATE TYPE : Satellite Position\n");
|
||||||
fprintf(result_file, " GENERATE TIME : %s", ctime(&gen_time));
|
fprintf(result_file, " GENERATE TIME : %s", ctime(&gen_time));
|
||||||
fprintf(result_file, " OBS FILE PATH : %s\n", obs_path);
|
fprintf(result_file, " OBS FILE PATH : %s\n", obs_path);
|
||||||
|
|||||||
Reference in new issue
Block a user