Home > atmlab > time > mjd2gmst.m

mjd2gmst

PURPOSE ^

MJD2GMST Convert modified julian date to greenwich mean sidereal time.

SYNOPSIS ^

function [gmst] = mjd2gmst(mjd)

DESCRIPTION ^

 MJD2GMST Convert modified julian date to greenwich mean sidereal time.
   [gmst] = mjd2gmst(mjd) converts modified julian date to greenwich mean
   sidereal time using the algorithm from the Astronomical Almanac 2002,
   pg. B6.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

DOWNLOAD ^

mjd2gmst.m

SOURCE CODE ^

0001 function [gmst] = mjd2gmst(mjd)
0002 % MJD2GMST Convert modified julian date to greenwich mean sidereal time.
0003 %   [gmst] = mjd2gmst(mjd) converts modified julian date to greenwich mean
0004 %   sidereal time using the algorithm from the Astronomical Almanac 2002,
0005 %   pg. B6.
0006 
0007 %----------------------------------------------------------------
0008 % Craig Haley 20/09/01
0009 %   30-06-04 CSH made small changes
0010 %   05-01-05 CSH modifed to use mjd rather than converting to jd
0011 %----------------------------------------------------------------
0012 
0013 %calculate the greenwich mean sidereal time at midnight
0014 mjd2000 = 51544.5;        %Modified Julian Date of Epoch J2000.0
0015 int_mjd = floor(mjd);
0016 frac_mjd = mjd-int_mjd;
0017 Tu = (int_mjd-mjd2000)/36525.0;
0018 gmst = 24110.54841+Tu.*(8640184.812866+Tu.*(0.093104-Tu*6.2e-6));
0019 
0020 %add the mean sidereal time interval from midnight to time
0021 gmst = mod(gmst+frac_mjd*86400*1.00273790934,86400);
0022 
0023 %convert to hours
0024 gmst = gmst/3600;

Generated on Mon 15-Sep-2014 13:31:28 by m2html © 2005