Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def object_ephemeris(payload):
- location = EarthLocation.from_geodetic(
- float(payload.location.longitude) * u.deg,
- float(payload.location.latitude) * u.deg,
- float(payload.location.altitude) * u.m,
- )
- if payload.stepping == "m":
- step = 1 * u.minute
- elif payload.stepping == "h":
- step = "1h"
- elif payload.stepping == "d":
- step = "1d"
- elif payload.stepping == "w":
- step = "7d"
- else:
- print(_("Wrong code"))
- eph = MPC.get_ephemeris(
- str(payload.object_name), location=location, step=step, number=30
- )
- # eph = eph[
- # "date", "ra", "dec", "elongation", "v", "altitude", "proper motion", "direction"
- # ]
- ephemeris = eph.as_array().tolist()
- ephemeris=json.dumps(ephemeris)
- return ephemeris
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement