Skip to content

TimeRange Class

The TimeRange class provides an iterator for generating sequences of epochs over a time range with a specified step size. It is particularly useful for orbit propagation, trajectory sampling, and time-series analysis.

TimeRange

TimeRange(epoch_start: Epoch, epoch_end: Epoch, step: float)

Iterator that generates a sequence of epochs over a time range.

TimeRange creates an iterator that yields epochs from a start time to an end time with a specified step size in seconds. This is useful for propagating orbits, sampling trajectories, or generating time grids for analysis.

Parameters:

Name Type Description Default
epoch_start Epoch

Starting epoch for the range

required
epoch_end Epoch

Ending epoch for the range

required
step float

Time step in seconds between consecutive epochs

required

Examples:

1
2
3
4
5
6
from brahe import Epoch, TimeRange, TimeSystem
start = Epoch.from_datetime(2024, 1, 1, 0, 0, 0.0, 0.0, TimeSystem.UTC)
end = start + 3600.0  # One hour later
time_range = TimeRange(start, end, 60.0)  # 60-second steps
for epoch in time_range:
    print(epoch)

Initialize instance.