Coordinate conversion from ECEF to ECI does not match pymap3d #5
Replies: 3 comments
-
This is expected from the simple ECI transform in this repo that does not account for nutation and other factors. Putting a position on the equator of a spheroid without those higher fidelity models in Astropy results in ECI also being on the equator. The Matlab Aerospace Blockset has ecef2eci() if needed or yes use Python + Astropy. |
Beta Was this translation helpful? Give feedback.
-
I edited the MATLAB code above so it has fewer bugs. I do not have access to a MATLAB license so I cannot verify what it returns, but I did run the following Python code just now, for reference:
The magnitude of the vector returned is very, very close to 6378137, the X-coordinate of Null Island in ECEF. |
Beta Was this translation helpful? Give feedback.
-
@scivision If you could run the MATLAB code and report what it returns for Null Island's ECI coordinates on January 1, 2000 at noon, that would be greatly appreciated. The lat/long/alt is 0, 0, 0 and ECEF is 6378137, 0, 0; I would also appreciate knowing the difference between the |
Beta Was this translation helpful? Give feedback.
-
Try finding the coordinates of Null Island (geodetic latitude 0, longitude 0, elevation 0) at noon on January 1, 2000 as per the following code:
[ecef_x, ecef_y, ecef_z] = geodetic2ecef(0, 0, 0)
J2K0 = datetime(2000, 1, 1, 12, 0, 'TimeZone', 'UTCLeapSeconds')
[eci_x, eci_y, eci_z] = ecef2eci(ecef_x, ecef_y, ecef_z, J2K0)
Then run the same code via
pymap3d
and you will see the difference:[J2K0_whole, J2k0_fraction] = py.matlab_datenum_to_datetime(J2K0)
J2K0_for_pymap3d = J2K0_whole + J2K0_fraction
eci_vector = py.pymap3d.ecef2eci(ecef_x, ecef_y, ecef_z, J2K0_for_pymap3d )
where
matlab_datenum_to_datetime
explicitly transforms the date as follows:I cannot figure out where the error is coming from, so I resorted to calling
pymap3d
from MATLAB since it usesastropy.
You might want to get rid of this repo and just recommend that route if you cannot fix the issue.Beta Was this translation helpful? Give feedback.
All reactions