Skip to content

(ANSWERED) Observe a planet from a satellite #604

Answered by JoshPaterson
craigim asked this question in Q&A
Discussion options

You must be logged in to vote

Hi! I think I was able to figure out what is going wrong. Here is how I edited your example:

from dateutil.parser import parse
import skyfield.api as sf
import numpy as np
from skyfield.positionlib import Geocentric, Barycentric

planets = sf.load("de440.bsp")
jupiter = planets["JUPITER BARYCENTER"]
earth = planets["EARTH"]

iso_time_string = "2021-03-14T15:09:26.5359Z"
ts = sf.load.timescale(builtin=True)
epoch = parse(iso_time_string, fuzzy=True)
t = ts.from_datetime(epoch)

mean_rad = 6371008.8
altitude =  540000.0
eci_m = np.random.normal(size=(3))
eci_m /= np.sqrt(np.sum(eci_m*eci_m))
eci_m *= (mean_rad + altitude)
eci_x_m, eci_y_m, eci_z_m = eci_m
p = sf.Distance(m=[eci_x_m, eci_y_m…

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@craigim
Comment options

@JoshPaterson
Comment options

@brandon-rhodes
Comment options

@craigim
Comment options

Answer selected by craigim
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants