<< CL_dat_now Coordinates and frames CL_dat_str2cal >>

CelestLab >> Coordinates and frames > CL_dat_scaleConvert

CL_dat_scaleConvert

Time scale conversion

Calling Sequence

cjd_out = CL_dat_scaleConvert(ts_in, ts_out, cjd_in [,ut1_tref, tt_tref])

Description

Parameters

type_in:

(string) Input time scale: "TREF", "TT", "TAI", "UT1", "UTC", "TDB", "TCB" (1x1)

type_out:

(string) Output time scale: "TREF", "TT", "TAI", "UT1", "UTC", "TDB", "TCB" (1x1)

cjd_in:

Input date (modified julian day from 1950.0). (1xN)

ut1_tref:

(optional) UT1-TREF [seconds]. Default is %CL_UT1_TREF (1x1 or 1xN)

tt_tref:

(optional) TT-TREF [seconds]. Default is %CL_TT_TREF (1x1 or 1xN)

cjd_out:

Output date (modified julian day from 1950.0).(1xN)

Authors

Examples

// Example 1: TAI to UTC
// Note the "%nan" during the time of the added second (UTC time undefined)
dt_sec = -2 : 0.2 : 1.5;
cjd_tai = CL_dat_scaleConvert("UTC", "TAI", 21550) + dt_sec / 86400;
cjd_utc = CL_dat_scaleConvert("TAI", "UTC", cjd_tai);
[dt_sec; (cjd_utc-cjd_tai)*86400]'

// Example 2: Offsets between TREF and various time scales (sec)
cjd_tref = CL_dat_now() + (-365.25 * 10 : 5 : 0);
utc_tref = (CL_dat_scaleConvert("TREF", "UTC", cjd_tref) - cjd_tref) *  86400;
tai_tref = (CL_dat_scaleConvert("TREF", "TAI", cjd_tref) - cjd_tref) *  86400;
tt_tref  = (CL_dat_scaleConvert("TREF", "TT",  cjd_tref) - cjd_tref) *  86400;
tcb_tref = (CL_dat_scaleConvert("TREF", "TCB", cjd_tref) - cjd_tref) *  86400;
scf();
plot(cjd_tref, [utc_tref; tai_tref; tt_tref; tcb_tref], "thickness", 2);
CL_g_legend(gca(), ["UTC", "TAI", "TT", "TCB"]);
CL_g_stdaxes();

Report an issue
<< CL_dat_now Coordinates and frames CL_dat_str2cal >>