pysteps.extrapolation.semilagrangian.extrapolate¶
-
pysteps.extrapolation.semilagrangian.
extrapolate
(precip, velocity, num_timesteps, outval=nan, xy_coords=None, **kwargs)¶ Apply semi-Lagrangian extrapolation to a two-dimensional precipitation field.
Parameters: - precip : array-like
Array of shape (m,n) containing the input precipitation field. All values are required to be finite.
- velocity : array-like
Array of shape (2,m,n) containing the x- and y-components of the m*n advection field. All values are required to be finite.
- num_timesteps : int
Number of time steps to extrapolate.
- outval : float, optional
Optional argument for specifying the value for pixels advected from outside the domain. If outval is set to ‘min’, the value is taken as the minimum value of R. Default : np.nan
- xy_coords : ndarray, optional
Array with the coordinates of the grid dimension (2, m, n ).
- xy_coords[0] : x coordinates
- xy_coords[1] : y coordinates
By default, the xy_coords are computed for each extrapolation.
Returns: - out : array or tuple
If return_displacement=False, return a time series extrapolated fields of shape (num_timesteps,m,n). Otherwise, return a tuple containing the extrapolated fields and the total displacement along the advection trajectory.
Other Parameters: - D_prev : array-like
Optional initial displacement vector field of shape (2,m,n) for the extrapolation. Default : None
- n_iter : int
Number of inner iterations in the semi-Lagrangian scheme. Default : 3
- inverse : bool
If True, the extrapolation trajectory is computed backward along the flow (default), forward otherwise. Default : True
- return_displacement : bool
If True, return the total advection velocity (displacement) between the initial input field and the advected one integrated along the trajectory. Default : False
References
[GZ02] Germann et al (2002)