Advertisement
ziriuz84

Untitled

Jun 3rd, 2023
1,161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.82 KB | None | 0 0
  1. def object_ephemeris(payload):
  2.     location = EarthLocation.from_geodetic(
  3.         float(payload.location.longitude) * u.deg,
  4.         float(payload.location.latitude) * u.deg,
  5.         float(payload.location.altitude) * u.m,
  6.     )
  7.     if payload.stepping == "m":
  8.         step = 1 * u.minute
  9.     elif payload.stepping == "h":
  10.         step = "1h"
  11.     elif payload.stepping == "d":
  12.         step = "1d"
  13.     elif payload.stepping == "w":
  14.         step = "7d"
  15.     else:
  16.         print(_("Wrong code"))
  17.     eph = MPC.get_ephemeris(
  18.         str(payload.object_name), location=location, step=step, number=30
  19.     )
  20.     # eph = eph[
  21.     #     "date", "ra", "dec", "elongation", "v", "altitude", "proper motion", "direction"
  22.     # ]
  23.     ephemeris = eph.as_array().tolist()
  24.     ephemeris=json.dumps(ephemeris)
  25.     return ephemeris
  26.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement