Ticket #482 (closed defect: fixed)

Opened 11 years ago

Last modified 10 years ago

Implement database stored function to convert TAI to UTC and vice versa

Reported by: jbecla Owned by: ktl
Priority: normal Milestone:
Component: database Keywords:
Cc: smm, fpierfed Blocked By: #733
Blocking: Project: LSST
Version Number:
How to repeat:

not applicable

Description

#405 determined that all times in the database will be stored using TAI in integral microseconds as BIGINTs. MOPS inherently uses UTC (I think as MJDs), however. Conversion functions are available in the DateTime class for this, but it may be necessary to implement them as database stored functions. See discussion in #405.

Change History

comment:1 Changed 11 years ago by ktl

  • Status changed from new to assigned

comment:2 Changed 11 years ago by ktl

  • Owner changed from ktl to fpierfed
  • Status changed from assigned to needinfo

Is this functionality actually needed in a database stored function, or can the lsst::daf::base::DateTime class be used to provide this for MOPS?

comment:3 Changed 11 years ago by fpierfed

  • Owner changed from fpierfed to ktl
  • Status changed from needinfo to assigned

Interesting question. Ideally we should perform the conversion in MOPS (and/or in the wrappers to code that requires UTC). The problems I can see here are

  1. Timescale (can we do this in time for DC3?).
  2. Complexity (lots of places in the code will need to convert between UTC and TAI).
  3. Compatibility with Pan-STARRS.

And frankly I do not know what is best.

comment:4 Changed 10 years ago by ktl

  • Status changed from assigned to inTicketWork

Initial implementations of TAI <-> UTC and TAI, UTC -> MJD have been checked into DMS/cat/tickets/482/sql/setup_storedFunctions.sql.

comment:5 Changed 10 years ago by ktl

These implementations, like the DateTime class in daf_base, use nanoseconds, not microseconds. Changing this is not difficult, if #405 decides differently.

comment:6 Changed 10 years ago by ktl

  • Blocked By 733 added

comment:7 Changed 10 years ago by ktl

  • Status changed from inTicketWork to assigned

Fixed implementations, along with tests, were merged to the trunk in [9095].

comment:8 Changed 10 years ago by ktl

  • Status changed from assigned to closed
  • Resolution set to fixed
Note: See TracTickets for help on using tickets.