hydromt.workflows.forcing.resample_time#

hydromt.workflows.forcing.resample_time(da, freq, label='right', closed='right', upsampling='bfill', downsampling='mean', conserve_mass=True, logger=<Logger hydromt.workflows.forcing (WARNING)>)[source]#

Resample data to destination frequency.

Skip if input data already at output frequency.

Parameters:
  • da (xarray.DataArray) – Input data

  • freq (str, pd.timedelta) – Output frequency.

  • label ({'left', 'right'}, optional) – Side of each interval to use for labeling. By default ‘right’.

  • closed ({'left', 'right'}, optional) – Side of each interval to treat as closed. By default ‘right’.

  • upsampling (str, optional) – Resampling method if output frequency is higher, lower (resp.) compared to input frequency.

  • downsampling (str, optional) – Resampling method if output frequency is higher, lower (resp.) compared to input frequency.

  • conserve_mass (bool, optional) – If True multiply output with relative change in frequency to conserve mass

  • logger – The logger to use.

Returns:

pet – Resampled data.

Return type:

xarray.DataArray