Closed Tucktuckgoose closed 5 years ago
I'm not sure what happens if you try to loop over a geocentric
object — you could add print(geo)
to the loop so we can see what kind of object you got?
I'm having basically the same error in a similar circumstance. When I run a print
line in the loop it prints the object as <Geocentric position and velocity at date t>
.
It looks like it's not handling the time array well. If I instead run with a single time instead of an array of times, it solves just fine.
The .position
method works just fine with the time array.
Well, I can force the issue with something like geo.center=399
. Then it runs without issue.
What is the purpose of the if self.center != 399:
check on line 464 of positionlib.py
anyway? Why 399?
399 is the Earth's center (the geocenter) as defined by NAIF: https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/FORTRAN/req/naif_ids.html#Planets%20and%20Satellites
Update: my guess below is wrong-- line 84 of sgp4lib.py sets center = 399
. So maybe try mapping over the list or, as Brandon suggested, printing to make sure you're actually getting back what you want.
THE PARAGRAPH BELOW IS WRONG:
I'm guessing the object satellite.at(time_range)
returns is measured geocentrically, but geo.center
isn't set to 399 for some reason. I think tweaking satellite.at
would fix this.
Happily, this appears to have been fixed during a recent refactoring! I can't reproduce it now with Skyfield master
. Please re-open if this recurs in the future.
I am relatively new to both python and skyfield, and I am messing around to see what the capabilities are. I have successfully been able to calculate ISS coordinates in Lat, Long, Alt for a single point in time, but I am trying to write a program to generate a csv of those positions across a range of times. Here is my code up to this point.
At the line
subpoint = geo.subpoint()
I get the error:Is there a problem with creating subpoints from an array, or am I doing something wrong?
Thanks and Merry Christmas!