Документ взят из кэша поисковой машины. Адрес оригинального документа : http://www.apo.nmsu.edu/Telescopes/TCC/html/time_8py_source.html
Дата изменения: Tue Sep 15 02:25:37 2015
Дата индексирования: Sun Apr 10 00:19:06 2016
Кодировка:

Поисковые слова: закон вина
lsst.tcc: python/tcc/util/time.py Source File
lsst.tcc  1.2.2-3-g89ecb63
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
time.py
Go to the documentation of this file.
1 from __future__ import division, absolute_import
2 
3 import RO.PhysConst
4 
5 from tcc.base import tai
6 
7 __all__ = ["daySecFromDate", "dateFromSecInDay", "secInDayFromDate"]
8 
9 _HalfDaySec = RO.PhysConst.SecPerDay / 2.0
10 
11 def daySecFromDate(date):
12  """!Convert a TAI date (MJD, seconds) to (days, seconds in the day)
13  """
14  fracDays = date / RO.PhysConst.SecPerDay
15  day = int(fracDays)
16  sec = (fracDays - day) * RO.PhysConst.SecPerDay
17  return (day, sec)
18 
19 def secInDayFromDate(date):
20  """!Convert a date to seconds in the day (losing day information)
21 
22  A convenience wrapper around daySecFromDate, since we rarely care about the day
23  (the main use case is computing seconds in the day for the old axis controller interface).
24  """
25  return daySecFromDate(date)[1]
26 
27 def dateFromSecInDay(secInDay):
28  """!Convert TAI seconds in the day to a full TAI date (MJD, seconds)
29  """
30  currDate = tai()
31  currDay, currSecInDay = daySecFromDate(currDate)
32 
33  if secInDay > currSecInDay + _HalfDaySec:
34  actDay = currDay - 1
35  elif secInDay < currSecInDay - _HalfDaySec:
36  actDay = currDay + 1
37  else:
38  actDay = currDay
39  return secInDay + (actDay * RO.PhysConst.SecPerDay)
40 
def daySecFromDate
Convert a TAI date (MJD, seconds) to (days, seconds in the day)
Definition: time.py:11
def secInDayFromDate
Convert a date to seconds in the day (losing day information)
Definition: time.py:19
def dateFromSecInDay
Convert TAI seconds in the day to a full TAI date (MJD, seconds)
Definition: time.py:27
double tai()
Definition: tai.cc:7