Package gavo :: Package stc :: Module times
[frames] | no frames]

Module times

source code

Helpers for time parsing and conversion.

Functions
 
parseISODT(value) source code
 
jdnToDateTime(jd)
returns a ``datetime.datetime`` instance for a julian day number.
source code
 
mjdToDateTime(mjd)
returns a ``datetime.datetime`` instance for a modified julian day number.
source code
 
bYearToDateTime(bYear)
returns a datetime.datetime instance for a fractional Besselian year.
source code
 
jYearToDateTime(jYear)
returns a datetime.datetime instance for a fractional (julian) year.
source code
 
dateTimeToJdn(dt)
returns a julian day number (including fractionals) from a datetime instance.
source code
 
dateTimeToMJD(dt)
returns a modified julian date for a datetime instance.
source code
 
dateTimeToBYear(dt) source code
 
dateTimeToJYear(dt)
returns a fractional (julian) year for a datetime.datetime instance.
source code
 
getSeconds(td)
returns the number of seconds corresponding to a timedelta object.
source code
 
TTtoTAI(tdt)
returns TAI for a (datetime.datetime) TDT.
source code
 
TAItoTT(tai)
returns TDT for a (datetime.datetime) TAI.
source code
 
TDBtoTT(tdb)
returns an approximate TT from a TDB.
source code
 
TTtoTDB(tt)
returns approximate TDB from TT.
source code
 
TTtoTCG(tt)
returns TT from TCG.
source code
 
TCGtoTT(tcg)
returns TT from TCG.
source code
 
TCBtoTT(tcb)
returns an approximate TCB from a TT.
source code
 
TTtoTCB(tt)
returns an approximate TT from a TCB.
source code
 
getLeapSeconds(dt, table=[(datetime.datetime(1971, 12, 31, 23, 59, 59), datetime.timede...)
returns TAI-UTC for the datetime dt.
source code
 
UTCtoTT(utc)
returns TT from UTC.
source code
 
TTtoUTC(tt)
returns UTC from TT.
source code
 
getTransformFromScales(fromScale, toScale) source code
 
getTransformFromSTC(fromSTC, toSTC) source code
 
datetimeMapperFactory(colDesc) source code
Variables
  JD_MJD = 2400000.5
  dtJ2000 = datetime.datetime(2000, 1, 1, 12, 0)
  dtB1950 = datetime.datetime(1949, 12, 31, 22, 9, 46, 861900)
  leapSecondTable = [(datetime.datetime(1971, 12, 31, 23, 59, 59...
  ttLeapSecondTable = [(datetime.datetime(1971, 12, 31, 23, 59, ...
  timeConversions = {'TAI': (<__builtin__.function object>, <__b...
  __package__ = 'gavo.stc'
  dt = datetime.timedelta(0, 34)
  t = datetime.datetime(2008, 12, 31, 23, 59, 59)
Function Details

jdnToDateTime(jd)

source code 

returns a ``datetime.datetime`` instance for a julian day number.

Decorators:
  • @utils.document

mjdToDateTime(mjd)

source code 

returns a ``datetime.datetime`` instance for a modified julian day number.

Beware: This loses a couple of significant digits due to transformation to jd.

Decorators:
  • @utils.document

bYearToDateTime(bYear)

source code 

returns a datetime.datetime instance for a fractional Besselian year.

This uses the formula given by Lieske, J.H., A&A 73, 282 (1979).

Decorators:
  • @utils.document

jYearToDateTime(jYear)

source code 

returns a datetime.datetime instance for a fractional (julian) year.

This refers to time specifications like J2001.32.

Decorators:
  • @utils.document

dateTimeToJdn(dt)

source code 

returns a julian day number (including fractionals) from a datetime instance.

Decorators:
  • @utils.document

dateTimeToMJD(dt)

source code 

returns a modified julian date for a datetime instance.

Decorators:
  • @utils.document

dateTimeToJYear(dt)

source code 

returns a fractional (julian) year for a datetime.datetime instance.

Decorators:
  • @utils.document

TTtoTAI(tdt)

source code 

returns TAI for a (datetime.datetime) TDT.

Decorators:
  • @utils.document

TAItoTT(tai)

source code 

returns TDT for a (datetime.datetime) TAI.

Decorators:
  • @utils.document

TDBtoTT(tdb)

source code 

returns an approximate TT from a TDB.

The simplified formula 2.222-1 from [EXS] is used.

TTtoTDB(tt)

source code 

returns approximate TDB from TT.

The simplified formula 2.222-1 from [EXS] is used.

TTtoTCG(tt)

source code 

returns TT from TCG.

This uses 2.223-5 from [EXS].

TCGtoTT(tcg)

source code 

returns TT from TCG.

This uses 2.223-5 from [EXS].

TCBtoTT(tcb)

source code 

returns an approximate TCB from a TT.

This uses [EXS] 2.223-2 and the approximate conversion from TDB to TT.

TTtoTCB(tt)

source code 

returns an approximate TT from a TCB.

This uses [EXS] 2.223-2 and the approximate conversion from TT to TDB.

UTCtoTT(utc)

source code 

returns TT from UTC.

The leap second table is complete through 2009-5.

>>> getLeapSeconds(datetime.datetime(1998,12,31,23,59,58))
datetime.timedelta(0, 31)
>>> TTtoTAI(UTCtoTT(datetime.datetime(1998,12,31,23,59,59)))
datetime.datetime(1999, 1, 1, 0, 0, 30)
>>> TTtoTAI(UTCtoTT(datetime.datetime(1999,1,1,0,0,0)))
datetime.datetime(1999, 1, 1, 0, 0, 32)

TTtoUTC(tt)

source code 

returns UTC from TT.

The leap second table is complete through 2009-5.

>>> TTtoUTC(UTCtoTT(datetime.datetime(1998,12,31,23,59,59)))
datetime.datetime(1998, 12, 31, 23, 59, 59)
>>> TTtoUTC(UTCtoTT(datetime.datetime(1999,1,1,0,0,0)))
datetime.datetime(1999, 1, 1, 0, 0)

Variables Details

leapSecondTable

Value:
[(datetime.datetime(1971, 12, 31, 23, 59, 59),
  datetime.timedelta(0, 10)),
 (datetime.datetime(1972, 6, 30, 23, 59, 59),
  datetime.timedelta(0, 11)),
 (datetime.datetime(1972, 12, 31, 23, 59, 59),
  datetime.timedelta(0, 12)),
 (datetime.datetime(1973, 12, 31, 23, 59, 59),
  datetime.timedelta(0, 13)),
...

ttLeapSecondTable

Value:
[(datetime.datetime(1971, 12, 31, 23, 59, 35, 816000),
  datetime.timedelta(0, 10)),
 (datetime.datetime(1972, 6, 30, 23, 59, 36, 816000),
  datetime.timedelta(0, 11)),
 (datetime.datetime(1972, 12, 31, 23, 59, 37, 816000),
  datetime.timedelta(0, 12)),
 (datetime.datetime(1973, 12, 31, 23, 59, 38, 816000),
  datetime.timedelta(0, 13)),
...

timeConversions

Value:
{'TAI': (<__builtin__.function object>, <__builtin__.function object>)\
,
 'TCB': (<__builtin__.function object>, <__builtin__.function object>)\
,
 'TCG': (<__builtin__.function object>, <__builtin__.function object>)\
,
 'TDB': (<__builtin__.function object>, <__builtin__.function object>)\
,
...