Skip to content

Commit 8ffbf40

Browse files
committed
Merge branch 'master' of https://github.com/pySTEPS/pysteps
2 parents 5bcef2e + f8adbf7 commit 8ffbf40

File tree

3 files changed

+31
-19
lines changed

3 files changed

+31
-19
lines changed

pysteps/nowcasts/extrapolation.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ def forecast(R, V, num_timesteps, extrap_method="semilagrangian", extrap_kwargs=
1414
field.
1515
V : array-like
1616
Array of shape (2,m,n) containing the x- and y-components of the advection
17-
field. The velocities are assumed to represent one time step.
17+
field. The velocities are assumed to represent one time step between the
18+
inputs.
1819
num_timesteps : int
1920
Number of time steps to forecast.
2021
@@ -24,14 +25,15 @@ def forecast(R, V, num_timesteps, extrap_method="semilagrangian", extrap_kwargs=
2425
Name of the extrapolation method to use. See the documentation of
2526
pysteps.extrapolation.interface.
2627
extrap_kwargs : dict
27-
Optional dictionary that is supplied as keyword arguments to the
28+
Optional dictionary that is expanded into keyword arguments for the
2829
extrapolation method.
2930
3031
Returns
3132
-------
3233
out : ndarray
3334
Three-dimensional array of shape (num_timesteps,m,n) containing a time
34-
series of nowcast precipitation fields.
35+
series of nowcast precipitation fields. The time step is taken from
36+
the advection field.
3537
3638
See also
3739
--------

pysteps/nowcasts/interface.py

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
11
import numpy as np
22

3-
"""The forecast methods in the nowcasts module implement the following interface:
3+
"""The methods in the nowcasts module implement the following interface:
44
5-
forecast(R, V, num_timesteps, keyword arguments)
5+
forecast(R, V, num_timesteps, **kwargs)
66
77
where R (m,n) is the input precipitation field and V (2,m,n) is an array
88
containing the x- and y-components of the m*n advection field. num_timesteps
99
is an integer specifying the number of time steps to forecast. The interface
1010
accepts optional keyword arguments specific to the given method.
1111
12-
The output depends on the type of the method. For deterministic methods, the
13-
output is a three-dimensional array of shape (num_timesteps,m,n) containing a
14-
time series of nowcast precipitation fields. For stochastic methods, the
15-
output is a four-dimensional array of shape (num_ensemble_members,num_timesteps,m,n).
12+
The output depends on the type of the method. For deterministic methods, the
13+
output is a three-dimensional array of shape (num_timesteps,m,n) containing a
14+
time series of nowcast precipitation fields. For stochastic methods that produce
15+
an ensemble, the output is a four-dimensional array of shape
16+
(num_ensemble_members,num_timesteps,m,n). The time step of the output is taken
17+
from the inputs.
1618
1719
"""
1820

@@ -25,14 +27,14 @@ def get_method(name):
2527
+-------------------+-----------------------------------------------------+
2628
| Name | Description |
2729
+===================+=====================================================+
28-
| eulerian | this approach simply keeps the last observation |
29-
| | frozen (Eulerian persistence) |
30+
| eulerian | this approach keeps the last observation frozen |
31+
| | (Eulerian persistence) |
3032
+-------------------+-----------------------------------------------------+
3133
| lagrangian or | this approach extrapolates the last observation |
32-
| extrapolation | following the motion field (Lagrangian persistence) |
34+
| extrapolation | using the motion field (Lagrangian persistence) |
3335
+-------------------+-----------------------------------------------------+
3436
| steps | implementation of the STEPS stochastic nowcasting |
35-
| | method as described in :cite:`Seed2003`, |
37+
| | method described in :cite:`Seed2003`, |
3638
| | :cite:`BPS2006` and :cite:`SPN2013` |
3739
+-------------------+-----------------------------------------------------+
3840

pysteps/nowcasts/steps.py

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,17 +63,19 @@ def forecast(R, V, n_timesteps, n_ens_members=24, n_cascade_levels=6, R_thr=None
6363
bandpass_filter_method : {'gaussian', 'uniform'}
6464
Name of the bandpass filter method to use with the cascade decomposition.
6565
See the documentation of pysteps.cascade.interface.
66-
noise_method : {'parametric','nonparametric','ssft','nested'}
66+
noise_method : {'parametric','nonparametric','ssft','nested',None}
6767
Name of the noise generator to use for perturbating the precipitation
68-
field. See the documentation of pysteps.noise.interface.
68+
field. See the documentation of pysteps.noise.interface. If set to None,
69+
no noise is generated.
6970
noise_stddev_adj : bool
7071
Optional adjustment for the standard deviations of the noise fields added
7172
to each cascade level. See pysteps.noise.utils.compute_noise_stddev_adjs.
7273
ar_order : int
7374
The order of the autoregressive model to use. Must be >= 1.
74-
vel_pert_method : {'bps'}
75-
Name of the noise generator to use for perturbing the velocity field. See
76-
the documentation of pysteps.noise.interface.
75+
vel_pert_method : {'bps',None}
76+
Name of the noise generator to use for perturbing the advection field. See
77+
the documentation of pysteps.noise.interface. If set to None, the advection
78+
field is not perturbed.
7779
conditional : bool
7880
If set to True, compute the statistics of the precipitation field
7981
conditionally by excluding the areas where the values are below the
@@ -128,13 +130,19 @@ def forecast(R, V, n_timesteps, n_ens_members=24, n_cascade_levels=6, R_thr=None
128130
If return_output is True, a four-dimensional array of shape
129131
(n_ens_members,n_timesteps,m,n) containing a time series of forecast
130132
precipitation fields for each ensemble member. Otherwise, a None value
131-
is returned.
133+
is returned. The time step is taken from the input precipitation fields R.
132134
133135
See also
134136
--------
135137
pysteps.extrapolation.interface, pysteps.cascade.interface,
136138
pysteps.noise.interface, pysteps.noise.utils.compute_noise_stddev_adjs
137139
140+
Notes
141+
-----
142+
If noise_method and vel_pert_method are set to None and n_ens_members is set
143+
to 1, the produced nowcast is deterministic (i.e. the S-PROG nowcast, see
144+
:cite:`Seed2003`).
145+
138146
References
139147
----------
140148
:cite:`Seed2003`, :cite:`BPS2006`, :cite:`SPN2013`

0 commit comments

Comments
 (0)