Skip to content

Commit

Permalink
Create Time objects with precision=6
Browse files Browse the repository at this point in the history
We would like to get microseconds in our ISO output form.
  • Loading branch information
timj committed Oct 3, 2024
1 parent ea48778 commit 5061f26
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion python/lsst/daf/butler/time_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,9 @@ def nsec_to_astropy(self, time_nsec: int) -> astropy.time.Time:
time that is outside of that range.
"""
jd1, jd2 = divmod(time_nsec, 1_000_000_000)
return astropy.time.Time(float(jd1), jd2 / 1_000_000_000, format="unix_tai_fast", scale="tai")
return astropy.time.Time(
float(jd1), jd2 / 1_000_000_000, format="unix_tai_fast", scale="tai", precision=6
)

def times_equal(
self, time1: astropy.time.Time, time2: astropy.time.Time, precision_nsec: float = 1.0
Expand Down

0 comments on commit 5061f26

Please sign in to comment.