资源简介
运用python来读取广播星历,并计算其位置,计算过程设计rinex星历文件的读取,对读取的数据进行计算,和数据可视化
代码片段和文件信息
# -*- coding: utf-8 -*-
import numpy as np
import time
from scipy import optimize
from matplotlib import pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from datetime import datetime timedelta
# 把从Rinex读取的字符串日期中的年,月,日。。提取出来
def out_YMD(str):
Y = int(str[0:4])
M = int(str[5:7])
D = int(str[8:10])
hour = int(str[11:13])
minute = int(str[14:16])
sec = float(str[17:19])
return (Y M D hour minute sec)
# 格里高利里转换成儒略日
def d_to_mjd(tuple):
Y M D hour minute sec = tuple
D += hour / 24 + minute / 24 / 60 + sec / 24 / 3600
if M > 2:
new_Y = Y
new_M = M
else:
new_Y = Y - 1
new_M = M + 12
A = int(new_Y / 100)
B = 2 - A + int(A / 4)
JD = int(365.25 * (new_Y + 4716)) + int(30.6001 * (new_M + 1)) + D + B - 1524.5
return JD - 2400000.5
# 由约化儒略日计算星期几
def mjd_wd(mjd):
wd = ((mjd - 54899) % 7) + 1
return wd - 7 if (wd > 7) else wd
# 应该再创建一个函数,把上面的几个函数写在一起,直接一步调用了
class Renix_Read(object):
“““创建一个读取文件的类,暂时先将读取的各类值设为
属性#时间间隔单位为秒“““
def __init__(self filename interval):
self.interval = interval
self.filename = filename
self.gravitational_constant = 3.986005e14
self.We = 7.29211567e-5
self.Prn = []
self.Sqrt_a = []
self.Delta_n = []
self.a0 = []
self.a1 = []
self.a2 = []
self.Toc = []
self.Toe = []
self.M0 = []
self.Mk = []
self.E = []
self.W = []
self.Cuc = []
self.Crc = []
self.Cic = []
self.Cus = []
self.Crs = []
self.Cis = []
self.I0 = []
self.Idot = []
self.Omega = []
self.Omega_dot = []
self.time_observed = []
self.length = 0
def copy_n_times(self list): #后来加上的,把数据重复n次
“““广播星历需要外推,根据要计算的时间间隔,那么就要重复多少次“““
new_list = []
for x in list:
for i in range(7200 // self.interval):
new_list.append(x)
return new_list
def observe_time(self alist):
new_list = list(map(lambda str_time: datetime.strptime(str_time ‘%Y %m %d %H %M %S‘) - timedelta(
seconds=(3600 // self.interval - 1) * self.interval) alist))
new_new_list = new_list[:]
for j in range(self.length):
for i in range(int(7200 // self.interval)):
new_new_list[j * (7200 // self.interval) + i] = new_list[j * (7200 // self.interval) + i] + timedelta(
seconds=self.interval * i)
str_new_list = list(map(lambda time_obj: datetime.strftime(time_obj ‘%Y %m %d %H %M %S‘) new_new_list))
return str_new_list
def open_file(self):
PRN_list a0_list a1_list a2_list Iode_list Crs_list = [] [] [] [] [] []
Delta_n_list M0_list Cuc_list E_list Cus_list = [] [] [] [] []
相关资源
- python实现SGBM图像匹配算法
- python实现灰度直方图均衡化
- scrapy_qunar_one
- Python学习全系列教程永久可用
- python简明教程.chm
- 抽奖大转盘python的图形化界面
- 双边滤波器实验报告及代码python
- python +MYSQL+HTML实现21蛋糕网上商城
- Python-直播答题助手自动检测出题搜索
- OpenCV入门教程+OpenCV官方教程中文版
- Python 串口工具源码+.exe文件
- Python开发的全栈股票系统.zip
- Python操作Excel表格并将其中部分数据写
- python书籍 PDF
- 利用python绘制散点图
- python+labview+No1.vi
- 老男孩python项目实战
- python源码制作whl文件.rar
- python3.5可用的scipy
- PYTHON3 经典50案例.pptx
- 计算机科学导论-python.pdf
- python模拟鼠标点击屏幕
- windows鼠标自动点击py脚本
- 鱼c小甲鱼零基础学python全套课后题和
- Python 练习题100道
- Practical Programming 2nd Edition
- wxPython Application Development Cookbook
- python 3.6
- Python 3.5.2 中文文档 互联网唯一CHM版本
- python3.5.2.chm官方文档
评论
共有 条评论