Skip to main content

time_range.TimeRange

An inclusive window of calendar days, start through end.

Usage

Source

time_range.TimeRange(
    start,
    end,
)

The one object a pipeline hands to both the search and the composite: ~s1bursts.query.SearchQuery selects the acquisitions that fall on any of its days, and ResolutionWeighter.compose_*() names and tags the product with it. Because both take the same window, the product’s dates describe exactly what was searched.

Days have no time of day, so there is nothing to be exclusive about: a window 2023-07-18 through 2023-10-15 covers every acquisition on October 15. Filters that compare instants get the same span from half_open().

Parameters

start: DateLike

First and last day of the window. An instant names the UTC calendar day it falls on, the resolution every date tag is written at.

end: DateLike
First and last day of the window. An instant names the UTC calendar day it falls on, the resolution every date tag is written at.

Raises

ValueError
If end is before start.

Methods

Name Description
__contains__() Whether value falls on one of the window’s days.
__post_init__() Check the order of the days.
__str__() Return the window as start..end.
half_open() Return the window as [start, stop) naive UTC instants.

__contains__()

Whether value falls on one of the window’s days.

Usage

Source

__contains__(value)

__post_init__()

Check the order of the days.

Usage

Source

__post_init__()

Separate from __init__ because a validation library that builds a dataclass from its fields, pydantic for one, skips __init__ but still calls this.


__str__()

Return the window as start..end.

Usage

Source

__str__()

half_open()

Return the window as [start, stop) naive UTC instants.

Usage

Source

half_open()

stop is the midnight after end, so a filter that keeps start <= t < stop keeps every instant of every day of the window.