(ANSWERED) Observe a planet from a satellite #604
-
I have a satellite with a camera on it. I'd like to take a picture of Jupiter. I cannot figure out what RA/Dec direction I should look in. I start by picking a time: from dateutil.parser import parse
import skyfield.api as sf
import numpy as np
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) I then set an inertial position of the satellite (I don't have a TLE to initialize an EarthSatellite object, just an ECI position and time) 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, eci_z_m])
sat_position = Geocentric(p.au, t=t)
observer = sf.wgs84.subpoint(sat_position).at(t) I get the ephemeris of Jupiter planets = sf.load("de440.bsp")
target = planets["JUPITER BARYCENTER"] Here is what I'd like to do: direction = sat_position.observe(target).apparent()
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-68-f3693bf3c06e> in <module>
----> 1 sat_position.observe(target).apparent()
AttributeError: 'Geocentric' object has no attribute 'observe' direction = observer.observe(target).apparent()
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-54-e4f28b2d8a31> in <module>
----> 1 observer.observe(target).apparent()
AttributeError: 'Geocentric' object has no attribute 'observe' The best I can do is direction = (target - observer).radec() but that gives me the instantaneous position. Given that it takes 43 minutes for light to get from Jupiter to my camera, my camera has moved almost half an orbit and Jupiter will have moved with respect to the background stars. Of course, this doesn't work either. direction = (target - observer).apparent()
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-70-08e4737a0eb3> in <module>
----> 1 direction = (target - observer).apparent()
AttributeError: 'Geometric' object has no attribute 'apparent' Do I have to convert my inertial position to Earth fixed? If so, what is the best way to do that? Ultimately, isn't RA/Dec an inertial coordinate? I've tried the same thing using the ICRF class and get the same results. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
Hi! I think I was able to figure out what is going wrong. Here is how I edited your example:
The Let me know if that produces the numbers you are expecting! |
Beta Was this translation helpful? Give feedback.
Hi! I think I was able to figure out what is going wrong. Here is how I edited your example: