Topos errors when calculating visible EarthSatellite
See original GitHub issueI feel like this is going to be my fault but here we go. I’m working on a python 2.7.x codebase and found AttributeError: 'Topos' object has no attribute 'position'
when trying to calculate visible EarthSatellites. I’ve tested again with a clean Python 3.7 environment with the same result though =\
The use case is mapping Iridium NEXT orbits against known positions and times.
If anyone has any pointers or can see where I have flubbed that would be awesome!
Reproduction
Platform: Windows 10
python-3.7.1 jplephem-2.9 numpy-1.16.1 sgp4-1.4 skyfield-1.10
Code
from skyfield.api import Topos, load
ts = load.timescale()
t = ts.utc(2019, 2, 17, 11, 18, 7)
stations_url = 'http://celestrak.com/NORAD/elements/iridium-NEXT.txt'
satellites = load.tle(stations_url)
print(satellites['IRIDIUM 161'])
sat_pos_geocentric = satellites['IRIDIUM 161'].at(t)
print(sat_pos_geocentric.position.km)
subpoint = sat_pos_geocentric.subpoint()
print('Latitude:', subpoint.latitude)
print('Longitude:', subpoint.longitude)
print('Elevation (m):', int(subpoint.elevation.m))
bluffton = Topos('40.8939 N', '83.8917 W')
difference = sat_pos_geocentric - bluffton
print(difference)
Output
$ python skyfield-test.py
EarthSatellite 'IRIDIUM 161' number=43478 epoch=2019-02-23T06:25:35Z
[ 3062.67696436 -4537.7038142 4554.02354446]
Latitude: 39deg 59' 04.2"
Longitude: -12deg 29' 18.0"
Elevation (m): 751740
Traceback (most recent call last):
File "skyfield-test.py", line 15, in <module>
difference = sat_pos_geocentric - bluffton
File "C:\Users\Kahn.non-free\.virtualenvs\inreach-kml-util-4s0grwMn\lib\site-packages\skyfield\positionlib.py", line 63, in __sub__
p = self.position.au - body.position.au
AttributeError: 'Topos' object has no attribute 'position'
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Understanding Satellite Imagery
Visible satellite imagery is a depiction of the amount of solar radiation reflected back from the earth and clouds (albedo). Shades of light...
Read more >Chapter 2 Cloud type identification by satellites
The clouds as seen from the satellite may be classified into high, middle and low level clouds. We should take note that of...
Read more >Show visible satellite passes · Issue #327 · skyfielders/python ...
One issue I have with this method is to find the visible pass requires first calculating the current pass and then determine if...
Read more >Newcomers Earth Observation Guide
Most EO satellites are in specific low Earth polar orbits called "Sun-Synchronous Orbits (SSO)", whose altitude and inclination are precisely calculated so that ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yes,
sat
is just a string. The debugging that put me on the right track was printing the iterated output.What do you mean by “you don’t actually have an
EarthSatellite
”? Issat
a different sort of object?In any case, I’m glad you figured everything out and got a working script! Thanks for posting the working code, it may help future readers who find this discussion through a web search.