question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Document how to convert coordinate from ECI to LLA

See original GitHub issue

I’ve been reading over the documentation and I can’t quite figure out how to leverage skyfield to convert a coordinate from earth-centered inertial (ECI, given as x, y, z) to LLA (lat, long, altitude). Consider the following example

from datetime import datetime, timedelta
obs_time = datetime(2000, 1, 1) + timedelta(seconds=240)   # observe at 2000-01-01 00:04:00

# Given x, y, z coordinates in ECI [meters]
eci = (2183457.758387, 1924098.065987, 5898755.881731)

# What I would like to do
lat, lon, alt = eci_to_lla(eci, obs_time)

# expected output should be somewhere over eastern europe
# lat = 63.7398
# lon = 40.3853
# alt = 199473.0 

Is there a class in skyfield.positionlib that I can use to accomplish this calculation?

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
Cory-Kramercommented, Feb 24, 2021

You’re correct, I had to update the line below it as well, edited my comment above to reflect that.

0reactions
brandon-rhodescommented, Feb 24, 2021

Thank you @brandon-rhodes that worked perfectly!

Great! Now I just need to figure out where this will go in the documentation. Might take a week or two.

Just had to tweak the Distance line to the following…

But, if I’m reading correctly, that would leave d as a plain Python list. Wouldn’t that raise an AttributeError in the next line where d is asked for its .au attribute?

Read more comments on GitHub >

github_iconTop Results From Across the Web

eci2lla - MathWorks
This MATLAB function converts Earth-centered inertial (ECI) coordinates, specified by position, to latitude, longitude, altitude (LLA) geodetic coordinates.
Read more >
Convert ECI coordinates to latitude/longitude?
It gives a good explanation of how to convert between the two co-ordinate systems. It seems getting the latitude from ECI is straight ......
Read more >
geo2eci.pro
NAME: ; GEO2ECI ; ; PURPOSE: ; Convert geographic spherical coordinates to ... geographic spherical coordinates [latitude, longitude, ; altitude] to ECI ......
Read more >
Geocentric to topocentric conversion - PROJ
When conversion between geographic and topocentric coordinates is desired, the topocentric conversion must be preceded by the Geodetic to cartesian conversion ...
Read more >
Geographic coordinate conversion - Wikipedia
In geodesy, conversion among different geographic coordinate systems is made necessary by the different geographic coordinate systems in use across the ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found