Time scale conversion
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 and 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: 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(); |