gordias.util.time_period.extract_data_for_time_range#

gordias.util.time_period.extract_data_for_time_range(cube: Cube, time_range: TimeRange, padding: int = 0) ndarray[Any, dtype[_ScalarType_co]] | Any | None#

Extract data from the input cube for the given time range.

Parameters:
  • cube (iris.cube.Cube) – Input cube from which to extract data.

  • time_range (gordias.util.time_string.TimeRange) – TimeRange object representing the time range.

  • padding (int) – Padding of the time dimension in both edges of the time range. The values on the edges will be used as the fill value for the padding.

Returns:

Data array with the values from the time range.

Return type:

NDArray | array | None

Raises:

ValueError – If the time dimension is not the first dimension in the cube.