本文整理汇总了Python中ephemeris.Ephemeris.getSatXYZ方法的典型用法代码示例。如果您正苦于以下问题:Python Ephemeris.getSatXYZ方法的具体用法?Python Ephemeris.getSatXYZ怎么用?Python Ephemeris.getSatXYZ使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ephemeris.Ephemeris
的用法示例。
在下文中一共展示了Ephemeris.getSatXYZ方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from ephemeris import Ephemeris [as 别名]
# 或者: from ephemeris.Ephemeris import getSatXYZ [as 别名]
#.........这里部分代码省略.........
self.seuil_elev_sat = int(parser.get('seuils','sat_elevation'))
# nav data path
self.nav_data_file = parser.get('data','nav')
self.coord_pivot = [float(parser.get('data','x_pivot')), float(parser.get('data','y_pivot')), float(parser.get('data','z_pivot'))]
self.coord_mobile = [float(parser.get('data','x_mobile')), float(parser.get('data','y_mobile')), float(parser.get('data','z_mobile'))]
# obs data paths
self.obs_data_file = parser.get('data','obs').split(",")
###########################################################################
def simpleDifference(self, phase_r1_s1, phase_r1_s2):
"""Fonction pour calculer les simples differences"""
sd = phase_r1_s1 - phase_r1_s2
return sd
###########################################################################
def cleanObservations(self):
j=0
"""Fonction pour supprimer les observations qui ne respectent pas les seuils"""
for i in range(0, len(self.obs)):
# Suppression des données avec SNR
for raw in self.obs[i].rxm_raw:
j+=1
if raw[9] <= self.seuil_snr:
self.obs[i].rxm_raw = np.delete(self.obs[i].rxm_raw, j)
j-=1
def doubleDifference(self, phase_r1_s1, phase_r1_s2, phase_r2_s1, phase_r2_s2):
"""Fonction pour calculer les doubles differences"""
dd = self.simpleDifference(phase_r1_s1, phase_r1_s2) - self.simpleDifference(phase_r2_s1, phase_r2_s2)
return dd
def getRo(self, x_sat, y_sat, z_sat, x_rec, y_rec, z_rec):
"""Calculer la pseudo distance entre le recepteur et le satellite"""
return math.sqrt(pow(x_sat - x_rec, 2) + pow(y_sat - y_rec, 2) + pow(z_sat - z_rec, 2))
def getRMS(self, phase_double_difference, pseudorange_double_difference):
"""Fonction pour calculer le RMS"""
return (phase_double_difference - (1/LAMBDA_L1 * pseudorange_double_difference + math.floor(phase_double_difference - 1/LAMBDA_L1 * pseudorange_double_difference)))
###########################################################################
def sat_rec_vector(self, x_s, y_s, z_s, x_r, y_r, z_r):
"""Calculer le vecteur recepteur -> satellite"""
V = []
V.append(x_s - x_r)
V.append(y_s - y_r)
V.append(z_s - z_r)
return V
###########################################################################
def buildDoubleDifferences(self):
"""Construire les doubles differences"""
coord_sat_tmp = [0.0, 0.0, 0.0]
t = Timing()
flag = 0
# Il faut d'abord choisir le satellite pivot
for i in range(0, self.obs[0].rxm_raw.shape[0]):
for j in range(0, self.eph.nav_data.shape[0]):
year = int(self.eph.nav_data[j, 1]) + 2000
month = int(self.eph.nav_data[j, 2])
day = int(self.eph.nav_data[j, 3])
hour = int(self.eph.nav_data[j, 4])
minute = int(self.eph.nav_data[j, 5])
sec = int(self.eph.nav_data[j, 6])
if self.obs[0].rxm_raw[i,7] == self.eph.nav_data[j,0] and math.fabs(t.weekToW_ToGPSUnixTime(
self.obs[0].rxm_raw[i,1], self.obs[0].rxm_raw[i,0]) - t.iso_ToGPSUnixTime(
year, month, day, hour, minute, sec
)) < 7200000:
coord_sat_tmp = self.eph.getSatXYZ(int(self.obs[0].rxm_raw[i, 0] / 1000), self.eph.nav_data[j])
print(coord_sat_tmp)
if 10 < float(180 * self.getSatElevation(coord_sat_tmp[0], coord_sat_tmp[1], coord_sat_tmp[2],
self.coord_pivot[0],self.coord_pivot[1],self.coord_pivot[2])/math.pi):
print(float(180 * self.getSatElevation(coord_sat_tmp[0], coord_sat_tmp[1], coord_sat_tmp[2],
self.coord_pivot[0],self.coord_pivot[1],self.coord_pivot[2])/math.pi))
print(self.eph.nav_data[j,0])
print(str(year)+"/"+str(month)+"/"+str(day)+"/"+str(hour)+"/"+str(minute)+"/"+str(sec))
print(str(self.obs[0].rxm_raw[i,0])+"/"+str(self.obs[0].rxm_raw[i,1]))
flag = 1
break
if flag == 1:
break
for i in range(1, len(self.obs)):
# Le nombre des DD = Nbre de cubes fixes x Nbre de cube mobile
print("OK2")
###########################################################################
def getSatElevation(self, x_s, y_s, z_s, x_r, y_r, z_r):
"""Calculer l elevation d un satellite"""
sat_rec_geoc = self.sat_rec_vector(x_s, y_s, z_s, x_r, y_r, z_r)
sat_rec_loc = geocentrique2local(sat_rec_geoc[0], sat_rec_geoc[1], sat_rec_geoc[2])
norm = math.sqrt( sat_rec_loc[0,0] * sat_rec_loc[0,0] + sat_rec_loc[1,0] * sat_rec_loc[1,0] + sat_rec_loc[2,0] * sat_rec_loc[2,0] )
elevation = math.asin(sat_rec_geoc[2] / norm )
return elevation