This function converts a Julian Date from the Barycentric Dynamical Time (TDB) scale to the Terrestrial Time (TT) scale.

The conversion relies on the model previously set by the function calceph_time_set_relationship_tt_tdb().

The input Julian Date is provided as two double-precision numbers (jd0_tdb and jdfrac_tdb) to maintain precision. The result is returned in the output variables jd0_tt and jdfrac_tt.

Depending on the selected model:

  • Model 0: Retrieves the offset with calceph_compute_unit().

  • Model 1: Uses the internal default model from the TLS file.

The following example converts a TDB date to TT:

t_calcephbin *peph;
double jd0_tdb = 2451545.0;
double jdfrac_tdb = 0.5;
double jd0_tt, jdfrac_tt;

/* open the ephemeris file */
peph = calceph_open("example_lsk.tls");
if (peph != NULL)
{
    /* Convert TDB to TT */
    if (calceph_time_jd_tdb_to_jd_tt(peph, jd0_tdb, jdfrac_tdb,
                                     &jd0_tt, &jdfrac_tt) != 0)
    {
        printf("TT Date: %f + %f\n", jd0_tt, jdfrac_tt);
    }

    calceph_close(peph);
}