|
3 | 3 | Ensemble verification |
4 | 4 | ===================== |
5 | 5 |
|
6 | | -This tutorial shows how to compute and plot an extrapolation nowcast using |
7 | | -MeteoSwiss radar data. |
| 6 | +In this tutorial we perform a verification of a probabilistic extrapolation nowcast |
| 7 | +using MeteoSwiss radar data. |
8 | 8 |
|
9 | 9 | """ |
10 | 10 |
|
|
37 | 37 | ############################################################################### |
38 | 38 | # Load the data from the archive |
39 | 39 | # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 40 | +# |
| 41 | +# The data are upscaled to 2 km resolution to limit the memory usage and thus |
| 42 | +# be able to afford a larger number of ensemble members. |
40 | 43 |
|
41 | 44 | root_path = data_source["root_path"] |
42 | 45 | path_fmt = data_source["path_fmt"] |
|
58 | 61 | # Convert to rain rate |
59 | 62 | R, metadata = conversion.to_rainrate(R, metadata) |
60 | 63 |
|
61 | | -# Upscale data to 2 km to limit memory usage |
| 64 | +# Upscale data to 2 km |
62 | 65 | R, metadata = dimension.aggregate_fields_space(R, metadata, 2000) |
63 | 66 |
|
64 | 67 | # Plot the rainfall field |
|
84 | 87 | # Estimate the motion field |
85 | 88 | V = dense_lucaskanade(R) |
86 | 89 |
|
87 | | -# The STEPES nowcast |
| 90 | +# Perform the ensemble nowcast with STEPS |
88 | 91 | nowcast_method = nowcasts.get_method("steps") |
89 | 92 | R_f = nowcast_method( |
90 | 93 | R[-3:, :, :], |
|
119 | 122 | # Verification |
120 | 123 | # ------------ |
121 | 124 | # |
122 | | -# Pysteps includes a number of verification metrics to help users to analyze |
123 | | -# the general characteristics of the nowcasts in terms of consistency and |
124 | | -# quality (or goodness). |
125 | | -# Here, we will verify our probabilistic forecasts using the ROC curve, |
| 125 | +# Pysteps includes a number of verification metrics to help users to analyze |
| 126 | +# the general characteristics of the nowcasts in terms of consistency and |
| 127 | +# quality (or goodness). |
| 128 | +# Here, we will verify our probabilistic forecasts using the ROC curve, |
126 | 129 | # reliability diagrams, and rank histograms, as implemented in the verification |
127 | 130 | # module of pysteps. |
128 | 131 |
|
|
160 | 163 | verification.ROC_curve_accum(roc, P_f, R_o[-1, :, :]) |
161 | 164 | fig, ax = plt.subplots() |
162 | 165 | verification.plot_ROC(roc, ax, opt_prob_thr=True) |
163 | | -ax.set_title("ROC curve (+ %i min)" % (n_leadtimes * timestep)) |
| 166 | +ax.set_title("ROC curve (+%i min)" % (n_leadtimes * timestep)) |
164 | 167 | plt.show() |
165 | 168 |
|
166 | 169 | ############################################################################### |
|
171 | 174 | verification.reldiag_accum(reldiag, P_f, R_o[-1, :, :]) |
172 | 175 | fig, ax = plt.subplots() |
173 | 176 | verification.plot_reldiag(reldiag, ax) |
174 | | -ax.set_title("Reliability diagram (+ %i min)" % (n_leadtimes * timestep)) |
| 177 | +ax.set_title("Reliability diagram (+%i min)" % (n_leadtimes * timestep)) |
175 | 178 | plt.show() |
176 | 179 |
|
177 | 180 | ############################################################################### |
|
182 | 185 | verification.rankhist_accum(rankhist, R_f[:, -1, :, :], R_o[-1, :, :]) |
183 | 186 | fig, ax = plt.subplots() |
184 | 187 | verification.plot_rankhist(rankhist, ax) |
185 | | -ax.set_title("Rank histogram (+ %i min)" % (n_leadtimes * timestep)) |
| 188 | +ax.set_title("Rank histogram (+%i min)" % (n_leadtimes * timestep)) |
186 | 189 | plt.show() |
187 | 190 |
|
188 | 191 | # sphinx_gallery_thumbnail_number = 5 |
0 commit comments