RTKPLOT导出卫星数据并进行Python天空图绘制

RTKPLOT导出卫星数据并进行Python天空图绘制

RTKPLOT导出卫星数、DOP值、高度角等信息

依次点击File->Open Obs File,File->Open Nav File,分别导入观测文件及导航文件。点击右上角的设置,在Satellite System中选择卫星系统,Elevation Mask中设置卫星截止高度角。
RTKPLOT导出卫星数据并进行Python天空图绘制_第1张图片
RTKPLOT导出卫星数据并进行Python天空图绘制_第2张图片

依次点击File->Save # of Sats/DOP 可对可见卫星数/DOP值进行保存。依次点击File->Save AZ/EL/SNR/MP可对卫星方位角/卫星高度角/信噪比/L1多路径进行保存,保存数据如下,可以此进行重绘制。

RTKPLOT导出卫星数据并进行Python天空图绘制_第3张图片

【Python】根据导出的AZ/EL/SNR/MP数据进行天空图绘制

单系统代码:

import math
import matplotlib.pyplot as plt

f = open('cpt-base.txt', 'r') #Add the derived file path

ID=[]
AZ=[]
EL=[]

ln = f.readline()
while ln:
    ln = f.readline()
    if not ln:
        break
    str = ln.split()

    id = str[2]
    az = float(str[3])/180*math.pi
    el = 90 - float(str[4])
    
    ID.append(id)
    AZ.append(az)
    EL.append(el)

f.close()
ax = plt.subplot(111, projection='polar')
ax.set_theta_direction(-1)
ax.set_theta_zero_location('N')
ax.set_rticks([0,15,30,45,60,75,90])

satnum = 32
if  (ID[0][0] == 'G'):
    satnum = 32
elif(ID[0][0] == 'R'):
    satnum = 27
elif(ID[0][0] == 'E'):
    satnum = 36
elif(ID[0][0] == 'C'):
    satnum = 51
SATAZ=[]
SATEL=[]
SATID=[]
for i in range(1,satnum):
    for j in range(0,len(ID)):
        if int(ID[j][1:3])==i:
            az=AZ[j]
            SATAZ.append(az)
            el=EL[j]
            SATEL.append(el)
            id=ID[j]
            SATID.append(id)
    if len(SATAZ)>0:
        c = ax.scatter(SATAZ,SATEL,s=1, marker=".",alpha=0.75)

        ax.text(SATAZ[0],SATEL[0],SATID[0])
        SATAZ = []
        SATEL = []
        SATID = []

ax.yaxis.set_label_position('right')
ax.tick_params('y', labelleft=False)
plt.savefig('skyplot.jpg', dpi=360)
plt.show()

单系统结果:
RTKPLOT导出卫星数据并进行Python天空图绘制_第4张图片
多系统代码:

import math
import matplotlib.pyplot as plt

f = open('AZ_EL_SNR_MP.txt', 'r')

ID=[]
PRN=[]
AZ=[]
EL=[]

ln = f.readline()
while ln:
    ln = f.readline()
    if not ln:
        break
    str = ln.split()

    id = str[2]
    prn = int(str[2][1:3])
    if (str[2][0] == 'R'):
        prn = prn+ 32
    elif (str[2][0] == 'E'):
        prn = prn+ 59
    elif (str[2][0] == 'C'):
        prn = prn+ 95
    az = float(str[3])/180*math.pi
    el = 90 - float(str[4])

    ID.append(id)
    PRN.append(prn)
    AZ.append(az)
    EL.append(el)
f.close()
ax = plt.subplot(111, projection='polar')
ax.set_theta_direction(-1)
ax.set_theta_zero_location('N')
ax.set_rticks([0,15,30,45,60,75,90])

SATAZ=[]
SATEL=[]
SATID=[]
for i in range(1,146):
    for j in range(0,len(ID)):
        if int(PRN[j])==i:
            az=AZ[j]
            SATAZ.append(az)
            el=EL[j]
            SATEL.append(el)
            id=ID[j]
            SATID.append(id)
    if len(SATAZ)>0:
        if i<=32:
            c = ax.scatter(SATAZ, SATEL,s=1, color='b', marker=".", alpha=0.75)
        elif i<=59:
            c = ax.scatter(SATAZ, SATEL,s=1, color='r', marker=".", alpha=0.75)
        elif i<=95:
            c = ax.scatter(SATAZ, SATEL,s=1, color='g', marker=".", alpha=0.75)
        else:
            c = ax.scatter(SATAZ, SATEL,s=1, color='y', marker=".", alpha=0.75)
        middle=int(len(SATAZ)/2)
        ax.text(SATAZ[middle],SATEL[middle],SATID[0],fontsize=8)
        SATAZ = []
        SATEL = []
        SATID = []

ax.yaxis.set_label_position('right')
ax.tick_params('y', labelleft=False)
plt.savefig('skyplot.jpg', dpi=360)
plt.show()

多系统结果:

RTKPLOT导出卫星数据并进行Python天空图绘制_第5张图片

你可能感兴趣的:(RTKLIB,GNSS数据与产品,python,python)