hydromt_wflow.WflowModel.setup_precip_from_point_timeseries#
- WflowModel.setup_precip_from_point_timeseries(precip_fn: str | DataFrame | Dataset, interp_type: str = 'nearest', precip_stations_fn: str | GeoDataFrame | None = None, index_col: str | None = None, buffer: float = 100000.0, **kwargs) None [source]#
Generate gridded precipitation from point timeseries (requires wradlib).
Adds model layer:
precip: precipitation [mm]
Supported interpolation methods: * uniform: Applies spatially uniform precipitation to the model. Only works when precip_fn contains a single timeseries. * nearest: Nearest-neighbour interpolation, also works with a single station. * idw: Inverse-distance weighting using 1 / distance ** p. * linear: Linear interpolation using scipy.interpolate.LinearNDInterpolator, may result in missing values when station coverage is limited. * ordinarykriging: Interpolate using Ordinary Kriging, see wradlib documentation for a full explanation: wradlib.ipol.OrdinaryKriging <https://docs.wradlib.org/en/latest/generated/wradlib.ipol.OrdinaryKriging.html>. * externaldriftkriging: Kriging interpolation including an external drift, see wradlib documentation for a full explanation: wradlib.ipol.ExternalDriftKriging <https://docs.wradlib.org/en/latest/generated/wradlib.ipol.ExternalDriftKriging.html>.
- Parameters:
precip_fn (str, pd.DataFrame, xr.Dataset) –
Precipitation source as DataFrame or GeoDataset. - DataFrame: the index column should contain time and the other columns should correspond to the name or ID values of the stations in precip_stations_fn. - GeoDataset: the dataset should contain the variable ‘precip’ and the dimensions ‘time’ and ‘index’.
Required variable: ‘time’, ‘precip’ [mm]
interp_type (str) – Interpolation method. Options: “nearest”, “idw”, “linear”, “ordinarykriging”, “externaldriftkriging”.
precip_stations_fn (str, gpd.GeoDataFrame, optional) – Source for the locations of the stations as points: (x, y) or (lat, lon). Only required if precip_fn is of type DataFrame.
index_col (str, optional) – Column in precip_stations_fn to use for station ID values, by default None.
buffer (float, optional) – Buffer around the basins in metres to determine which stations to include. Set to 100 km (1e5 metres) by default.
**kwargs – Additional keyword arguments passed to the interpolation function. Supported arguments depend on the interpolation type: - nnearest: Maximum number of neighbors for interpolation (default: 4). - p: Power parameter for IDW interpolation (default: 2). - remove_missing: Mask NaN values in the input data (default: False). - cov: Covariance model for Kriging (default: ‘1.0 Exp(10000.)’). - src_drift: External drift values at source points (stations). - trg_drift: External drift values at target points (grid).
See also
hydromt_wflow.workflows.forcing.spatial_interpolation wradlib.ipol.interpolate <https://docs.wradlib.org/en/latest/ipol.html#wradlib.ipol.interpolate>