hydromt_sfincs.SfincsModel.setup_precip_forcing_from_grid#
- SfincsModel.setup_precip_forcing_from_grid(precip, dst_res: float = None, cumulative_input: bool = True, time_label: Literal['left', 'right'] = 'right', aggregate: bool = False, **kwargs)[source]#
Setup precipitation forcing from a gridded spatially varying data source.
SFINCS requires the mean precipitation rate in mm/hr over the upcoming interval. It will use the rate at the start of this interval and keep it constant throughout. This method can use rainfall rates in [mm/hr] directly, or transform accumulated precip [mm] over any constant time interval to precipitation rates.
Input precipitation can be specified as:
Cumulative precipitation (mm) over any constant time interval (e.g., 15/60/180 minutes). This will be converted to a rate (mm/hr) if
cumulative_input=True(default).Precipitation rate (mm/hr) at any time interval. Used as-is if
cumulative_input=False.
If
aggregate=True, a spatially uniform precipitation forcing is applied based on the domain-wide mean. Ifaggregate=False, distributed precipitation is applied using a NetCDF file. In that case, data is reprojected to the model CRS (and todst_resif provided).One of the following model layers will be added:
netamprfile: for distributed precipitation rate [mm/hr].
precipfile: for uniform precipitation rate [mm/hr].
Note
SFINCS updates the meteo forcing every 1800 seconds (
dtwnd=1800by default). If your dataset has smaller intervals,dtwndinsfincs.inpis adjusted automatically.Note
To allow precipitation rates to vary linearly over the time interval (instead of being constant), set
ampr_block = 0insfincs.inp.- Parameters:
precip (str or Path) –
Path to precipitation rasterdataset netcdf file.
Required variables: [‘precip’ (mm) or ‘precip’ (mm/hr)]
Required coordinates: [‘time’, ‘y’, ‘x’]
dst_res (float, optional) – Output resolution (m), by default None and computed from source data. Only used in combination with aggregate=False
cumulative_input (bool, optional) – Option to indicate whether the input precipitation is cumulative in mm (True, default) or a precipitation rate in mm/hr (False). When cumulative, the data is converted to mm/hr by dividing by the time interval of the input dataset.
time_label (literal, optional) – Label to prescribe whether the accumulation period of the precipitation is starting (left) or ending (right) at the validity date and time. This is only relevant if cumulative_input=True.
aggregate (bool, {'mean', 'median'}, optional) – Method to aggregate distributed input precipitation data. If True, mean aggregation is used, if False (default) the data is not aggregated and spatially distributed precipitation is returned.