1 from __future__
import division, absolute_import
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.
10 Returned keywords: TAI, UT1, LST, UTC_TAI.
15 __all__ = [
"showTime"]
18 """Implement the Show Time command
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)
24 currTAI = tcc.base.tai()
29 site = coordConv.Site(tccActor.obj.site)
30 tccActor.earth.updateSite(site, currTAI)
32 currLAST = coordConv.lastFromTAI(currTAI, site)
33 currUT1 = site.ut1_tai + currTAI
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,),
42 msgStr =
"; ".join(msgStrList)
43 tccActor.writeToUsers(
'i', msgStr, cmd=userCmd)
44 if setDone
and not userCmd.isDone:
45 userCmd.setState(userCmd.Done)