For logs I think it makes the most sense to log in whatever time system the computer is using. I also don't think the logging system should be using DateTime which would decouple the issue of logged time stamps from what DateTime does and allows us to eliminate UTC support from DateTime.
For purposes of closing this RFC I propose the following:
1) Remove support for all time systems except TAI from DateTime.
UTC is used in ctrl_events and ctrl_provenance and some obs_ packages. I propose that the ctrl_ packages use TAI. The usage in obs packages can be replaced by Astropy.time.Time.
2) Modify DateTime.toPython to return an Astropy.time.Time
...as per Jim Bosch's excellent suggestion. A global search turned up only 4 uses in 4 packages: daf_base, daf_butler, obs_subaru and pipe_drivers. So I think this will be easy.
3) Add class or static method DateTime.fromPython to construct a DateTime from an Astropy.time.Time.
This is simpler than Jim Bosch's suggestion, but it seems a pragmatic and easy first step. I would like to defer automatic conversion between DateTime and Astropy.time.Time (in either direction) to another RFC bcause I fear that it will be too far easy to forget to make new pybind11 wrapper take and return Astropy.time.Time instead of DateTime, leading to some code that deals with DateTime and some code that deals with Astropy.time.Time. Unless there is some clever way to make the obvious pybind11 wrapper manage the transition automatically, I think this is asking for trouble.
Thus I think it most important that we can easily manually convert between DateTime and Astropy.time.Time and less important that we do it automatically.
For logs I think it makes the most sense to log in whatever time system the computer is using. I also don't think the logging system should be using DateTime which would decouple the issue of logged time stamps from what DateTime does and allows us to eliminate UTC support from DateTime.
For purposes of closing this RFC I propose the following:
1) Remove support for all time systems except TAI from DateTime.
UTC is used in ctrl_events and ctrl_provenance and some obs_ packages. I propose that the ctrl_ packages use TAI. The usage in obs packages can be replaced by Astropy.time.Time.
2) Modify DateTime.toPython to return an Astropy.time.Time
...as per Jim Bosch's excellent suggestion. A global search turned up only 4 uses in 4 packages: daf_base, daf_butler, obs_subaru and pipe_drivers. So I think this will be easy.
3) Add class or static method DateTime.fromPython to construct a DateTime from an Astropy.time.Time.
This is simpler than Jim Bosch's suggestion, but it seems a pragmatic and easy first step. I would like to defer automatic conversion between DateTime and Astropy.time.Time (in either direction) to another RFC bcause I fear that it will be too far easy to forget to make new pybind11 wrapper take and return Astropy.time.Time instead of DateTime, leading to some code that deals with DateTime and some code that deals with Astropy.time.Time. Unless there is some clever way to make the obvious pybind11 wrapper manage the transition automatically, I think this is asking for trouble.
Thus I think it most important that we can easily manually convert between DateTime and Astropy.time.Time and less important that we do it automatically.