Convert time scale
cjd_out = CL_dat_scaleConvert(ts_in, ts_out, cjd_in [,ut1_tref, tt_tref])
Converts a date from one time scale to another.
The available time scales are "TREF", "TT", "TAI", "UT1", "UTC", "TDB", "TCB".
See Dates and time scales for more details.
Notes:
- The input and output dates must be of the same type ("cjd").
- If both ts_in and ts_out are different from UT1 and TREF, the value of ut1_tref has no influence on the results.
- If both ts_in and ts_out are different from TT and TREF, the value of tt_tref has no influence on the results.
- TDB is supposed identical to TT.
(string) Input time scale: "TREF", "TT", "TAI", "UT1", "UTC", "TDB", "TCB" (1x1)
(string) Output time scale: "TREF", "TT", "TAI", "UT1", "UTC", "TDB", "TCB" (1x1)
Input date (modified julian day from 1950.0). (1xN)
(optional) UT1-TREF [seconds]. Default is %CL_UT1_TREF (1x1 or 1xN)
(optional) TT-TREF [seconds]. Default is %CL_TT_TREF (1x1 or 1xN)
Output date (modified julian day from 1950.0).(1xN)
CNES - DCT/SB
// 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(); | ![]() | ![]() |