Skip to content

Commit 67a1465

Browse files
committed
Try reduce memory usage
1 parent 57de18b commit 67a1465

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

examples/plot_steps_nowcast.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@
1313
from pysteps import io, nowcasts, rcparams
1414
from pysteps.motion.lucaskanade import dense_lucaskanade
1515
from pysteps.postprocessing.ensemblestats import excprob
16-
from pysteps.utils import conversion, transformation
16+
from pysteps.utils import conversion, dimension, transformation
1717
from pysteps.visualization import plot_precip_field
1818

1919
# Set nowcast parameters
2020
n_ens_members = 12
21-
n_leadtimes = 12
21+
n_leadtimes = 6
2222
seed = 24
2323

2424
###############################################################################
@@ -54,6 +54,9 @@
5454
# Convert to rain rate
5555
R, metadata = conversion.to_rainrate(R, metadata)
5656

57+
# Upscale data to 2 km to limit memory usage
58+
R, metadata = dimension.aggregate_fields_space(R, metadata, 2000)
59+
5760
# Log-transform the data to unit of dBR, set the threshold to 0.1 mm/h
5861
R = transformation.dB_transform(R, threshold=0.1, zerovalue=-15.0)[0]
5962

@@ -116,9 +119,9 @@
116119
R_f = nowcast_method(
117120
R[-3:, :, :],
118121
V,
119-
12,
122+
n_leadtimes,
120123
n_ens_members=n_ens_members,
121-
n_cascade_levels=8,
124+
n_cascade_levels=6,
122125
R_thr=-10.0,
123126
kmperpixel=1.0,
124127
timestep=5,

0 commit comments

Comments
 (0)