Skip to content

Commit

Permalink
Merge pull request #51 from lsst-sitcom/tickets/DM-39698
Browse files Browse the repository at this point in the history
DM-39698: Add getExpRecordAge util
  • Loading branch information
mfisherlevine authored Jul 7, 2023
2 parents 7fc05bd + f5c81d4 commit 28c47f7
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions python/lsst/summit/utils/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -539,6 +539,22 @@ def getCurrentDayObs_humanStr():
return dayObsIntToString(getCurrentDayObs_int())


def getExpRecordAge(expRecord):
"""Get the time, in seconds, since the end of exposure.
Parameters
----------
expRecord : `lsst.daf.butler.DimensionRecord`
The exposure record.
Returns
-------
age : `float`
The age of the exposure, in seconds.
"""
return -1 * (expRecord.timespan.end - Time.now()).sec


def getSite():
"""Returns where the code is running.
Expand Down

0 comments on commit 28c47f7

Please sign in to comment.