def plotFwdAzimuth(self): if len(self.fwd_azimuth)==0: for i in range(len(self.coordinates)-1): fwd=geog.course(self.coordinates[i],self.coordinates[i+1]) self.fwd_azimuth.append(fwd) delta=len(self.time)-len(self.fwd_azimuth) plt.plot(self.time[:-delta],self.fwd_azimuth) plt.xlabel("Время(мин)") plt.ylabel("Истинный курс(град)") plt.title("Истинный курс") plt.show()
def turn_angle_coords(coords): if len(coords) != 3: raise ValueError("coords must have length 3") angles = geog.course(coords[:-1], coords[1:]) a = angles[1] - angles[0] if a < -180: a += 360 elif a > 180: a -= 360 return a
if __name__ == "__main__": parser = GPGGAParser("gpgga1.txt") time = parser.getTimeList() height = parser.getHeightList() speed = parser.getSpeedList() delta_distance = parser.getDistList() distance = list() for i in range(len(delta_distance) - 1): delta = 0 for j in range(i): delta += delta_distance[j] distance.append(delta) fwd_azimuth = list() coordinates = parser.getCoordinates() for i in range(len(coordinates) - 1): fwd = geog.course(coordinates[i], coordinates[i + 1]) fwd_azimuth.append(fwd) plt.figure(1) delta = len(time) - len(height) plt.plot(time, height) plt.xlabel("Время(мин)") plt.ylabel("Высота(м)") plt.figure(2) delta = len(time) - len(speed) plt.plot(time[:-delta], speed) plt.xlabel("Время(мин)") plt.ylabel("Скорость(км/ч)") plt.figure(3) delta = len(time) - len(distance) plt.plot(time[:-delta], distance) plt.xlabel("Время(мин)")