The current lsst::daf::base::DateTime can only read and write ISO8601 strings as UTC. This means it cannot easily be used to read or write FITS header dates, which have the following requirements:
- TAI dates are supported, by setting TIMESYS=TAI (very useful, since TAI is a uniform time system, so it makes a logical choice for recording dates)
- FITS ISO8601 dates cannot contain a "Z" (or other time zone character)
I propose the following modifications:
- DateTime(std::string const& iso8601) gain a time system argument that defaults to UTC. This is necessary in order to easily and correctly read valid FITS dates, e.g. for massaging raw data into our format.
- DateTime.toString() gains two arguments:
- a time system argument that defaults to UTC. This allows us to easily write TAI dates to our FITS files, which is a clear win.
- a flag that controls whether to output the "Z". This saves the trouble of stripping that character manually, increasing the chances that programmers will write correct FITS dates. However, we can live without it if necessary.
If accepted, I would like to implement this as part of
DM-5503. If rejected then I suggest the following:
- Always write dates as MJD TAI and never as ISO8601. This has two minor concerns:
- MJD potentially loses some digits
- ISO dates have some human readability advantages (though MJD is also nice for other reasons, which is probably why both are often written)
- Do not support reading raw dates whose dates are ISO8601 TAI. I do not know if this will be a problem for any cameras that we presently support; in many cases dates are written as both MJD and ISO8601, giving us an alternative for reading, and of course many cameras write UTC dates.