Timespan¶
- 
class lsst.daf.butler.Timespan¶
- Bases: - typing.Generic,- tuple- A generic 2-element named tuple for time intervals. - Parameters: - Notes - This class is generic because it is used for both Python literals (with - T == astropy.time.Time) and timestamps in SQLAlchemy expressions (with- T == sqlalchemy.sql.ColumnElement), including operations between those.- Python’s built-in - collections.namedtupleis not actually a type (just a factory for types), and- typing.NamedTupledoesn’t support generics, so neither can be used here (but also wouldn’t add much even if they could).- Attributes Summary - begin- Minimum timestamp in the interval (inclusive). - end- Maximum timestamp in the interval (inclusive). - Methods Summary - count($self, value, /)- Return number of occurrences of value. - index($self, value[, start, stop])- Return first index of value. - intersection()- Return a new - Timespanthat is contained by all of the given ones.- overlaps(other[, ops])- Test whether this timespan overlaps another. - Attributes Documentation - Methods Documentation - 
count($self, value, /)¶
- Return number of occurrences of value. 
 - 
index($self, value, start=0, stop=sys.maxsize, /)¶
- Return first index of value. - Raises ValueError if the value is not present. 
 - 
intersection() → Optional[lsst.daf.butler.core.timespan.Timespan]¶
- Return a new - Timespanthat is contained by all of the given ones.- Parameters: - *args
- All positional arguments are - Timespaninstances.
 - Returns: - Notes - Unlike - overlaps, this method does not support SQLAlchemy column expressions as operands.
 - 
overlaps(other, ops=<module 'operator' from '/opt/lsst/software/stack/python/miniconda3-4.7.12/envs/lsst-scipipe-2deae7a/lib/python3.7/operator.py'>) → Any¶
- Test whether this timespan overlaps another. - Parameters: - other : Timespan
- Another timespan whose begin and end values can be compared with those of - selfwith the- >=operator, yielding values that can be passed to- ops.or_and/or- ops.and_.
- ops : Any, optional
- Any object with - and_and- or_boolean operators. Defaults to the Python built-in- operatormodule, which is appropriate when- Tis a Python literal like- astropy.time.Time. When either operand contains SQLAlchemy column expressions, the- sqlalchemy.sqlmodule should be used instead.
 - Returns: 
- other : 
 
-