getMidpointFromTimespan#

lsst.ap.association.getMidpointFromTimespan(timespan, allowUnbounded=True)#

Safely retrieve the midpoint in TAI from a Timespan.

Parameters#

timespanlsst.daf.butler.Timespan of astropy.time.Time

A Timespan centered on the midpoint of a visit.

allowUnboundedbool, optional

If set, return the start or end of an unbounded timespan.

Returns#

midpointastropy.time.Time

The midpoint of the timespan.

Raises#

ValueError

Raised if either the start or end of the timespan is None, and allowUnbounded is not set.

ValueError

Raised if the timespan is empty.