Time::TT::OffsetKnot - MJD/offset tuple for realisations of TT


        use Time::TT::OffsetKnot;

        $pt = Time::TT::OffsetKnot($mjd, $offset_ns, 9);

        $tai_instant = $pt->x;
        $instant = $pt->y;
        $role = $pt->role;


This class assists in implementing a realisation of Terrestrial Time (TT) by interpolation using the Time::TT::InterpolatingRealisation class. Many such time scales are defined by tables of data giving the difference between TAI and the time scale at 00:00 UTC on various days. An object of this class represents such a data point (knot), supplying the Math::Interpolator::Knot interface required.

The calculations required in order to generate the actual numbers to interpolate with are performed lazily and memoised. Until these numbers (which will be Math::BigRat objects) are generated, the raw data is stored very space-efficiently. Construction of the knot object is quick.


Time::TT::OffsetKnot->new(MJD, OFFSET, UNIT)

Creates and returns an object representing a knot where at the integral Modified Julian Date MJD (interpreted according to UTC) the time scale of interest differed from TAI by OFFSET * 10^-UNIT seconds. For example, if OFFSET is 43.5 and UNIT is 9 then the time scale differs from TAI by 43.5 ns.

MJD must be purely a string of digits. OFFSET must be a string in decimal numeric syntax, matching /[-+]?[0-9]+(?:\.[0-9]+)?/. UNIT must be non-negative.

If the OFFSET value is positive then it indicates that the time scale is behind TAI. If the OFFSET value is negative then the time scale is ahead of TAI. This is the sense of the offset found in TAI-TAI(k) files. If the raw data is in the sense TT(k)-TT(TAI) then the sign will have to be reversed before passing it to this constructor.



These methods are part of the standard Math::Interpolator::Knot interface.


Math::Interpolator::Knot, Time::TT::InterpolatingRealisation


Andrew Main (Zefram) <>


Copyright (C) 2006, 2007, 2010, 2012 Andrew Main (Zefram) <>


This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.