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

Поисковые слова: п п п п п п п п п п п п п п п п п п п п п п п п п п п п п п п п п п п п п п
lsst.tcc: python/tcc/cmd/showTime.py Source File
lsst.tcc  1.2.2-3-g89ecb63
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
showTime.py
Go to the documentation of this file.
1 from __future__ import division, absolute_import
2 """
3 From TCC documentation:
4 Returns the current time in several time systems. The time returned is the
5 time the command was parsed. There is not attempt to compensate for delays
6 in transmitting the time string. However, the various kinds of time returned
7 are consistent with each other. Note that there is a SET TIME command, but it
8 calibrates the TCC's clock from the observatory's time standard.
9 
10 Returned keywords: TAI, UT1, LST, UTC_TAI.
11 """
12 import tcc.base
13 import coordConv
14 
15 __all__ = ["showTime"]
16 
17 def showTime(tccActor, userCmd, setDone=True):
18  """Implement the Show Time command
19 
20  @param[in,out] tccActor tcc actor
21  @param[in,out] userCmd user command
22  @param[in] setDone set userCmd done? (ignored if userCmd is already done)
23  """
24  currTAI = tcc.base.tai()
25 
26  # make a copy of site and update that at the current TAI
27  # making a copy is probably silly, but avoids the possibility that the "show time" command
28  # could influence tracking (except by delaying it)
29  site = coordConv.Site(tccActor.obj.site)
30  tccActor.earth.updateSite(site, currTAI)
31 
32  currLAST = coordConv.lastFromTAI(currTAI, site)
33  currUT1 = site.ut1_tai + currTAI
34 
35  msgStrList = [
36  "TAI=%0.3f" % (currTAI,),
37  "LAST=%0.4f" % (currLAST,),
38  "UT1=%0.3f" % (currUT1,),
39  "UTC_TAI=%0.0f" % (site.utc_tai,),
40  "UT1_TAI=%0.3f" % (site.ut1_tai,),
41  ]
42  msgStr = "; ".join(msgStrList)
43  tccActor.writeToUsers('i', msgStr, cmd=userCmd)
44  if setDone and not userCmd.isDone:
45  userCmd.setState(userCmd.Done)