GNSS卫星钟差二次差计算

直接开门见山吧。

        对钟差的估计结果精度分析采用与参考精密钟差作二次差的比较方法,即先选择某个参考卫星,估计的钟差和参考精密钟差各卫星对各自参考卫星作一次差,消除由于时间基准选择不同引起的钟差差异。然后消除了时间基准选择不同引起的钟差差异。然后将消除了时间基准影响的钟差星间差与参考精密钟差的星间差再次做差,统计二次差时间序列的钟差偏差、消除钟差星间偏差的STD及RMS。

以我的理解,是由于卫星钟差与接收机钟差都是未知数,所以导致时间基准不一致,各个钟差产品之间存在一个时间基准,通过进行二次差,可以消除时间基准选择不同引起的钟差差异。

计算流程如上所示。

python代码实现如下

import os
from tkinter import filedialog
import numpy as np
import matplotlib.pyplot as plt


def read_two_file(path1, path2):
    '''

    :param path1:机构发布的精密钟差,真值
    :param path2: 自己生成的
    :return: 一次差的值
    '''
    judge = 1
    file_true = open(path1, 'r', encoding='utf-8')
    file = open(path2, 'r', encoding='utf-8')
    lines_true = file_true.readlines()[240:-120]  # 调整长度大小
    lines = file.readlines()[240:-120]  # 调整长度大小
    list_true = []
    list = []

    # 读入文件
    # print("range(len(lines) - 120, len(lines))\n")
    for i in range(len(lines)):
        a = lines_true[i].split(" ")
        aa = []
        bb = []
        for x in a:
            if (x != ''):
                aa.append(x)
        times_true = eval(aa[4]) * 3600 + eval(aa[5]) * 60 + eval(aa[6])
        b = lines[i].split(" ")
        for x in b:
            if (x != ''):
                bb.append(x)
        times = eval(bb[4]) * 3600 + eval(bb[5]) * 60 + eval(bb[6])
        if (int(times) == int(times_true)):
            list_true.append(eval(aa[7]))
            list.append(eval(bb[7]))
        else:
            judge = 0
            print("两个历元不一致,有问题")

    # 进行第一次差分
    list_true = np.array(list_true)
    list = np.array(list)
    list_1 = list_true - list
    return list_1


if __name__ == '__main__':
    sat_list = []

    F = []
    print("选择解算的钟差值\n")
    foldername = filedialog.askdirectory()
    f_list = os.listdir(foldername)
    for filename in f_list:
        if os.path.splitext(filename)[1] == '.clk':
            F.append(filename)
            sat_list.append(filename.split('.')[0])
    sat_list.sort()

    print("选择精密钟差值\n")
    foldername_true = filedialog.askdirectory()

    # 参考卫星路径
    Refer_sat = "G02"  # 参考卫星
    path1 = foldername_true + "/" + Refer_sat + ".clk"  # 参考卫星精密钟差值路径
    path2 = foldername + "/" + Refer_sat + ".clk"  # 参考卫星自己算的钟差值路径
    Refer_primary_difference = read_two_file(path1, path2)  # 参考卫星一次差列表
    for i in sat_list:
        path11 = foldername_true + "/" + i + ".clk"  # 精密钟差值路径
        path21 = foldername + "/" + i + ".clk"  # 自己算的钟差值路径
        primary_difference = read_two_file(path11, path21)  # 卫星一次差列表
        # 计算二次差
        second_difference = Refer_primary_difference - primary_difference
        plt.title(i)
        plt.plot(second_difference)
        plt.savefig("fig"+"/"+i+"fig.png")
        plt.close()
        std = np.std(second_difference)
        print("{}: {:.6e}".format(i, std))

  • 3
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值