前面博客中有提到过,文中给出了部分代码,在这篇博客里面,给出剩下的代码
# -*- coding:utf-8 -*-
"""
created on Fri Apr 29 08:26:10 2022
@author: xymeng
"""
import numpy as np
import math as mt
import matplotlib.pyplot as plt
import sklearn.metrics as ms
sqrt = mt.sqrt
'''以下为列表定义'''
X = []
Y = []
Z = []#定位结果
X0 = []
Y0 = []
Z0 = []#参考真值
delX = []
delY = []
delZ = []#两者差值
XT=[]
YT=[]
ZT=[]#将真值放到列表中
if __name__ == '__main__':
path = input('请输入pos定位结果文件:') #E://rtklib//rtklib-test1//不同方案对比数据//Huber权函数抗差最小二乘//MA36-x3-C-huber1.pos
path0 = input('请输入pos参考真值文件:')#E://rtklib//rtklib-test1//data//MA36x3-ppp.pos
'''以下代码是读取定位结果所有行的XYZ'''
with open(path,'r') as f:
lines = f.readlines()
for line in lines[0:len(lines)]:
if (line.strip('\n').split(' ')[0

该博客使用Python读取定位结果和参考真值文件,计算XYZ方向的均值、标准差和均方根误差(RMSE),并将误差以曲线图形式展示。主要涉及数据读取、统计计算及Matplotlib作图。
最低0.47元/天 解锁文章
296





