Advertisement
Guest User

Untitled

a guest
Dec 12th, 2021
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.65 KB | None | 0 0
  1.     import numpy as np
  2.     import matplotlib.pyplot as plt
  3.  
  4.     fname = 'Akatsuki Venus Osculating Elements daily horizons_results.txt'
  5.  
  6.     with open(fname, 'r') as infile:
  7.         lines = infile.readlines()
  8.  
  9.     print(len(lines))
  10.  
  11.     iSOE = [i for i, line in enumerate(lines) if "$$SOE" in line][0]
  12.     iEOE = [i for i, line in enumerate(lines) if "$$EOE" in line][0]
  13.  
  14.     istart = 7 + 13
  15.     lines = [line.split(',') for line in lines[iSOE+1+istart:iEOE]]
  16.  
  17.     data = np.array([[float(thing) for thing in line[2:-1]]for line in lines])
  18.     JD = np.array([float(line[0]) for line in lines])
  19.     years = 2016 + (JD - 2457388.5)/365.2564
  20.  
  21.  
  22.     EC, QR, IN, OM, W, Tp, N, MA, TA, A, AD, PR = data.T
  23.  
  24.     things = EC, IN, OM, W, A
  25.     names = 'Ecc', 'Inc(°)', 'Ω(°)', 'ω(°)', 'a(km)'
  26.  
  27.     goodies = list(zip(things, names))
  28.     fig, axes = plt.subplots(len(goodies), 1)
  29.     for ax, (thing, name) in zip(axes, goodies):
  30.         ax.plot(years, thing)
  31.         ax.set_ylabel(name)
  32.     plt.suptitle('Akatsuki osculating elements (JPL Horizons)')
  33.     plt.show()
  34.  
  35.     """
  36.          EC     Eccentricity, e
  37.          QR     Periapsis distance, q (km)
  38.          IN     Inclination w.r.t X-Y plane, i (degrees)
  39.          OM     Longitude of Ascending Node, OMEGA, (degrees)
  40.          W      Argument of Perifocus, w (degrees)
  41.          Tp     Time of periapsis (Julian Day Number)
  42.          N      Mean motion, n (degrees/sec)
  43.          MA     Mean anomaly, M (degrees)
  44.          TA     True anomaly, nu (degrees)
  45.          A      Semi-major axis, a (km)
  46.          AD     Apoapsis distance (km)
  47.          PR     Sidereal orbit period (sec)
  48.    """
  49.  
  50.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement