File Exchange

image thumbnail


version (2.06 MB) by Abel Brown
Celestial to Terrestrial transformation (i.e. MJ2000 to ECEF)


Updated 17 Aug 2015

From GitHub

View license on GitHub

Pure MATLAB implementation of the Celestial to Terrestrial coordinate transformation which can be used to convert position, velocity, and acceleration between MJ2000 and ECEF reference frames.
These classes facilitates the CIO based celestial to terrestrial transformation (see figure). The main function is GCRS2ITRS which provides the 3x3 celestial to terrestrial transformation matrix. In order to obtain the necessary EOP information use helper object USNO.m.
There is a detailed write up in the docs/latex folder which explains this transformation in detail as well as explains the matrix formulation implemented in MATLAB. All relevant references are listed in the References section. Select papers are avaliable in the docs/refs folder.
Default 2010 IERS convention.

Run unit tests via: UnitTests.exe()

Example Usage:

% date time UTC: 2004/04/06 07:51:28.386
fMJD_UTC = 53101.3274118751;

% init EOP object
eopobj = USNO();

% pull latest EOP data from USNO servers

% interpolate EOP information for date and time
[xp,yp,du,dt] = eopobj.getEOP(fMJD_UTC);

% Vallado et al. 2006, AIAA [meters]
X_itrs = [-1033.4793830, 7901.2952754, 6380.3565958]';

% dx,dy = 0 [meters]
X_gcrs = [5102.5089592, 6123.0114033, 6378.1369247]';

% compute the 3x3 transformation matrix
GC2IT = IERS.GCRS2ITRS(fMJD_UTC,dt,du,xp,yp);

% perform the coordinate/position conversion: C -> T
X = GC2IT*X_gcrs;

% compute the error in meters
err = sum(sqrt((X-X_itrs).^2))


IERS 2010

IERS 2003


SOFA Library


Time Reference Cookbook:

Validation Routines:




NOVAS Comparison:

David Vallado, Seago J., Seidelmann P., Implementation Issues
Surrounding the New IAU Reference Systems for Astrodynamics,
AIAA, AAS 06-134, 2006

Cite As

Abel Brown (2021). IERS4m (, GitHub. Retrieved .

Comments and Ratings (1)

Chaoyang Zhang

it is faster than SOFA matlab.
for the velocity rotation, one should not use the DS2R, which is defined by the solar day instead of the sidereal day. The real earth rotation rate is around 7.29e-5 instead of 7.27e-5. A simple way to verify, using the IERS.ERA to calculate epoch t and t+1second and subtract one from another and you can get the earth rotation rate.
The annotation for the EOP parameters are wrong but the code is correct. e.g. du is UT1-UTC.

To make it faster, in USNO
one may add one more line at the end of the function:
function this = initWithFinalsHttp (this,kind)

% save the EOP2000finalall.txt


replace this.bullA=this.initWithFinalsHttp(); in

function this = initWIthEOPdata(this,opt)


MATLAB Release Compatibility
Created with R2015a
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!