gordias.util.time_period.get_first_and_last_indices#
- gordias.util.time_period.get_first_and_last_indices(time_range: TimeRange, times: TimesHelper, calendar: str) tuple[int, int]#
Given a time vector return the first and last index for the time range.
- Parameters:
time_range (gordias.util.time_string.TimeRange) –
TimeRangeobject representing the time range.times (TimesHelper) –
TimesHelperobject for the time vector representing a netCDF time variable object.calendar (str) – A calendar to define the indices.
- Returns:
start (int | float) – The start index of the time range for the given calendar.
end (int | float) – The end index of the time range for the given calendar.