Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to convert Earth Centered Inertial (ECI) coordinates to Earth Centered Earth Fixed (ECEF) AstroPy? Other?

I have position (x,y,z) and velocity (Vx,Vy,Vz) vectors in Earth Centered Inertial Coordinates (ECI) for a satellite orbit, and ultimately want to end up with geodetic coordinates (Latitude, Longitude, & Altitude).

According to this other Stack Overflow question it seems that I need to convert to Earth Centered Earth Fixed (ECEF) coordinates as an intermediate step (so ECI --> ECEF --> Lat/Lon/Alt).

I know ECI and ECEF share the same origin point (the center of mass of Earth) and the same z-axis that points to the North Pole. However, I am not sure what actual equations or adjustments I need to do to convert ECI to ECEF.

Otherwise, if anyone knows of any canned conversions on Astropy or something similar that would be even better. (I haven't seen ECI as an option on Astro Py or Space Py).

Here is the code I am using to generate my orbit and get the position and velocity vectors.

from scipy.constants import kilo
import orbital
from orbital import earth, KeplerianElements, Maneuver, plot, utilities
from orbital.utilities import Position, Velocity  
import matplotlib.pyplot as plt
import numpy as np

orbitPineapple = KeplerianElements.with_period(5760, body=earth, 
e=0.05, i=(np.deg2rad(0)), arg_pe=(np.deg2rad(30)))
plot(orbitPineapple)
plt.show()
print(orbitPineapple.r)
print(orbitPineapple.v)

Out: Position(x=5713846.540659178, y=3298890.8383577876, z=0.0) Velocity(x=-3982.305479346745, y=6897.555421488496, z=0.0)

like image 997
Rose Avatar asked Sep 26 '17 18:09

Rose


People also ask

What is the difference between the Earth centered inertial ECI and earth centered earth fixed ECEF frames?

ECEF and ECI coordinate frames have their origins at the Earth's CoM. ECI is called “inertial” where as the Earth Centered, Earth Fixed (ECEF) frame rotates wrt inertial space to remain fixed to the surface of the Earth.

What do you mean by ECEF Earth centered and Earth fixed coordinate system?

The Earth-Centered, Earth-Fixed (ECEF) coordinate system is also known as the "conventional terrestrial" coordinate system. It is a simple Cartesian coordinate system with the center of the earth at it's origin. The +X axis passes through the Equator and Prime Meridian intersection.

What are ECI coordinates?

The ECI coordinate system (see Figure 1) is typically defined as a Cartesian coordinate system, where the coordinates (position) are defined as the distance from the origin along the three orthogonal (mutually perpendicular) axes.


1 Answers

There are a number of different Earth Centered Inertial frames, and the answer depends on which one you have your coordinates in.

The most common is so-called J2000; which is defined w.r.t to the orientation of the Earth on Jan 1st 2000. Another common one is GCRF, which is almost the same (to within 80 milli arcseconds).

If it’s either of those two, you should be able to create an astropy EarthLocation object and access the lat, lon and height attributes like so

from astropy import coordinates as coord
from astropy import units as u
from astropy.time import Time
now = Time('2017-09-27 12:22:00')
# position of satellite in GCRS or J20000 ECI:
cartrep = coord.CartesianRepresentation(x=5713846.540659178, 
                                        y=3298890.8383577876,
                                        z=0., unit=u.m)
gcrs = coord.GCRS(cartrep, obstime=now)
itrs = gcrs.transform_to(coord.ITRS(obstime=now))
loc = coord.EarthLocation(*itrs.cartesian.cartrep )
print(loc.lat, loc.lon, loc.height)
like image 78
Stuart P Littlefair Avatar answered Oct 04 '22 10:10

Stuart P Littlefair