<< CL_dat_now Coordinates and frames CL_dat_str2cal >>

CelestLab >> Coordinates and frames > CL_dat_scaleConvert

CL_dat_scaleConvert

Convert time scale

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: UTC to TAI
cjd_utc = CL_dat_cal2cjd(2013,1,1);
cjd_tai = CL_dat_scaleConvert("UTC","TAI",cjd_utc);
cjd_tai = CL_dat_scaleConvert("UTC","TAI",cjd_utc,0,0); // => same

// Example 2: Offsets between TREF and various time scales (sec)
cjd_tref = CL_dat_cal2cjd(2000,1,1) : 10 : CL_dat_now("cjd");
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]);
h = CL_g_select(gca(), "Polyline"); h.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 >>