- pysteps.blending.linear_blending.forecast(precip, precip_metadata, velocity, timesteps, timestep, nowcast_method, precip_nwp=None, precip_nwp_metadata=None, start_blending=120, end_blending=240, fill_nwp=True, saliency=False, nowcast_kwargs=None)#
Generate a forecast by linearly or saliency-based blending of nowcasts with NWP data
precip (array_like) – Array containing the input precipitation field(s) ordered by timestamp from oldest to newest. The time steps between the inputs are assumed to be regular.
precip_metadata (dict) – Metadata dictionary containing (at least) the transform, unit and threshold attributes as described in the documentation of
array_like (velocity;) – Array of shape (2, m, n) containing the x- and y-components of the advection field. The velocities are assumed to represent one time step between the inputs. All values are required to be finite.
timesteps (int) – Number of time steps to forecast.
timestep (int or float) – The time difference (in minutes) between consecutive forecast fields.
nowcast_method (str) – Name of the nowcasting method. See
pysteps.nowcasts.interfacefor the list of available methods.
precip_nwp (array_like or NoneType, optional) – Array of shape (timesteps, m, n) in the case of no ensemble or of shape (n_ens_members, timesteps, m, n) in the case of an ensemble containing the NWP precipitation fields ordered by timestamp from oldest to newest. The time steps between the inputs are assumed to be regular (and identical to the time step between the nowcasts). If no NWP data is given the value of precip_nwp is None and no blending will be performed.
precip_nwp_metadata (dict or NoneType, optional) – NWP metadata dictionary containing (at least) the transform, unit and threshold attributes as described in the documentation of
start_blending (int, optional) – Time stamp (in minutes) after which the blending should start. Before this only the nowcast data is used.
end_blending (int, optional) – Time stamp (in minutes) after which the blending should end. Between start_blending and end_blending the nowcasts and NWP data are linearly merged with each other. After end_blending only the NWP data is used.
fill_nwp (bool, optional) – Standard value is True. If True, the NWP data will be used to fill in the no data mask of the nowcast.
saliency (bool, optional) – Default value is False. If True, saliency will be used for blending. The blending is based on intensities and forecast times as described in [HCLK15]. The blended product preserves pixel intensities with time if they are strong enough based on their ranked salience.
nowcast_kwargs (dict, optional) – Dictionary containing keyword arguments for the nowcast method.
precip_blended – Array of shape (timesteps, m, n) in the case of no ensemble or of shape (n_ens_members, timesteps, m, n) in the case of an ensemble containing the precipation forecast generated by linearly blending the nowcasts and the NWP data. n_ens_members equals the maximum no. of ensemble members in either the nowcast or nwp model(s).
- Return type: