|
12 | 12 | "%matplotlib qt" |
13 | 13 | ] |
14 | 14 | }, |
15 | | - { |
16 | | - "cell_type": "code", |
17 | | - "execution_count": 6, |
18 | | - "metadata": {}, |
19 | | - "outputs": [ |
20 | | - { |
21 | | - "data": { |
22 | | - "text/plain": [ |
23 | | - "<module 'meanderpy' from '/Users/zoltan/Dropbox/Channels/meanderpy/meanderpy/meanderpy.py'>" |
24 | | - ] |
25 | | - }, |
26 | | - "execution_count": 6, |
27 | | - "metadata": {}, |
28 | | - "output_type": "execute_result" |
29 | | - } |
30 | | - ], |
31 | | - "source": [ |
32 | | - "from importlib import reload\n", |
33 | | - "reload(mp)" |
34 | | - ] |
35 | | - }, |
36 | 15 | { |
37 | 16 | "cell_type": "markdown", |
38 | 17 | "metadata": {}, |
|
42 | 21 | }, |
43 | 22 | { |
44 | 23 | "cell_type": "code", |
45 | | - "execution_count": 3, |
| 24 | + "execution_count": 10, |
46 | 25 | "metadata": {}, |
47 | 26 | "outputs": [], |
48 | 27 | "source": [ |
49 | 28 | "nit = 2000 # number of iterations\n", |
50 | 29 | "W = 200.0 # channel width (m)\n", |
51 | 30 | "D = 6.0 # channel depth (m)\n", |
52 | | - "depths = D * np.ones((nit,)) # channel depths for different iterations \n", |
| 31 | + "depths = D * np.ones((nit,)) # channel depths for different iterations \n", |
53 | 32 | "pad = 100 # padding (number of nodepoints along centerline)\n", |
54 | 33 | "deltas = 50.0 # sampling distance along centerline \n", |
55 | 34 | "Cfs = 0.011 * np.ones((nit,)) # dimensionless Chezy friction factor\n", |
56 | 35 | "crdist = 2 * W # threshold distance at which cutoffs occur\n", |
57 | 36 | "kl = 60.0/(365*24*60*60.0) # migration rate constant (m/s)\n", |
58 | | - "kv = 1.0e-11 # vertical slope-dependent erosion rate constant (m/s)\n", |
59 | | - "dt = 2*0.05*365*24*60*60.0 # time step (s)\n", |
| 37 | + "kv = 1.0e-11 # vertical slope-dependent erosion rate constant (m/s)\n", |
| 38 | + "dt = 2*0.05*365*24*60*60.0 # time step (s)\n", |
60 | 39 | "dens = 1000 # density of water (kg/m3)\n", |
61 | 40 | "saved_ts = 20 # which time steps will be saved\n", |
62 | 41 | "n_bends = 30 # approximate number of bends you want to model\n", |
63 | | - "Sl = 0.002 # initial slope (matters more for submarine channels than rivers)\n", |
64 | | - "t1 = 500 # time step when incision starts\n", |
65 | | - "t2 = 700 # time step when lateral migration starts\n", |
| 42 | + "Sl = 0.002 # initial slope (matters more for submarine channels than rivers)\n", |
| 43 | + "t1 = 500 # time step when incision starts\n", |
| 44 | + "t2 = 700 # time step when lateral migration starts\n", |
66 | 45 | "t3 = 1200 # time step when aggradation starts\n", |
67 | | - "aggr_factor = 2e-9 # aggradation factor (m/s, about 0.18 m/year, it kicks in after t3)" |
| 46 | + "aggr_factor = 2e-9 # aggradation factor (m/s, about 0.18 m/year, it kicks in after t3)" |
68 | 47 | ] |
69 | 48 | }, |
70 | 49 | { |
|
76 | 55 | }, |
77 | 56 | { |
78 | 57 | "cell_type": "code", |
79 | | - "execution_count": 7, |
| 58 | + "execution_count": 11, |
80 | 59 | "metadata": {}, |
81 | 60 | "outputs": [], |
82 | 61 | "source": [ |
|
93 | 72 | }, |
94 | 73 | { |
95 | 74 | "cell_type": "code", |
96 | | - "execution_count": 8, |
| 75 | + "execution_count": 12, |
97 | 76 | "metadata": {}, |
98 | 77 | "outputs": [ |
99 | 78 | { |
100 | 79 | "name": "stderr", |
101 | 80 | "output_type": "stream", |
102 | 81 | "text": [ |
103 | | - "100%|███████████████████████████████████████| 2000/2000 [00:21<00:00, 91.67it/s]\n" |
| 82 | + "100%|██████████| 2000/2000 [00:16<00:00, 119.93it/s]\n" |
104 | 83 | ] |
105 | 84 | } |
106 | 85 | ], |
|
111 | 90 | }, |
112 | 91 | { |
113 | 92 | "cell_type": "code", |
114 | | - "execution_count": 9, |
| 93 | + "execution_count": 6, |
115 | 94 | "metadata": {}, |
116 | 95 | "outputs": [], |
117 | 96 | "source": [ |
|
130 | 109 | }, |
131 | 110 | { |
132 | 111 | "cell_type": "code", |
133 | | - "execution_count": 10, |
| 112 | + "execution_count": 7, |
134 | 113 | "metadata": {}, |
135 | 114 | "outputs": [], |
136 | 115 | "source": [ |
137 | | - "fig = chb.plot('morph', 20, 60, chb.cl_times[-1], len(chb.channels))" |
| 116 | + "# pb_age — Age of point bars (in years) at which they get covered by vegetation\n", |
| 117 | + "# ob_age — Age of oxbow lakes (in years) at which they get covered by vegetation\n", |
| 118 | + "\n", |
| 119 | + "fig = chb.plot('morph', pb_age=60, ob_age=100, end_time=chb.cl_times[-1], \n", |
| 120 | + " n_channels=len(chb.channels))\n" |
138 | 121 | ] |
139 | 122 | }, |
140 | 123 | { |
|
146 | 129 | }, |
147 | 130 | { |
148 | 131 | "cell_type": "code", |
149 | | - "execution_count": 14, |
| 132 | + "execution_count": 8, |
150 | 133 | "metadata": {}, |
151 | 134 | "outputs": [], |
152 | 135 | "source": [ |
153 | | - "fig = chb.plot('age', 20, 60, chb.cl_times[-1], len(chb.channels))" |
| 136 | + "fig = chb.plot('age', chb.cl_times[-1], len(chb.channels))" |
154 | 137 | ] |
155 | 138 | }, |
156 | 139 | { |
|
162 | 145 | }, |
163 | 146 | { |
164 | 147 | "cell_type": "code", |
165 | | - "execution_count": 9, |
| 148 | + "execution_count": null, |
166 | 149 | "metadata": {}, |
167 | | - "outputs": [], |
| 150 | + "outputs": [ |
| 151 | + { |
| 152 | + "name": "stdout", |
| 153 | + "output_type": "stream", |
| 154 | + "text": [ |
| 155 | + "Animation saved to: channel_evolution.mp4\n" |
| 156 | + ] |
| 157 | + }, |
| 158 | + { |
| 159 | + "data": { |
| 160 | + "text/plain": [ |
| 161 | + "<matplotlib.animation.FuncAnimation at 0x33baaead0>" |
| 162 | + ] |
| 163 | + }, |
| 164 | + "execution_count": 14, |
| 165 | + "metadata": {}, |
| 166 | + "output_type": "execute_result" |
| 167 | + } |
| 168 | + ], |
168 | 169 | "source": [ |
169 | | - "dirname = '/Users/zoltan/Dropbox/Channels/temp/'\n", |
170 | | - "chb.create_movie(xmin=10000, xmax=30000, plot_type='strat', filename='movie', dirname=dirname,\n", |
171 | | - " pb_age = 1, ob_age = 20, end_time = chb.cl_times[-1], n_channels = len(chb.channels))" |
| 170 | + "# this can take a couple of minutes\n", |
| 171 | + "# change file extension to .gif to save a file in gif format\n", |
| 172 | + "# change xmin, xmax to zoom in on a specific area\n", |
| 173 | + "\n", |
| 174 | + "chb.create_movie(xmin=10000, xmax=30000, plot_type='strat', \n", |
| 175 | + " filename='channel_evolution.mp4', fps=10, dpi=150)" |
172 | 176 | ] |
173 | 177 | }, |
174 | 178 | { |
|
184 | 188 | }, |
185 | 189 | { |
186 | 190 | "cell_type": "code", |
187 | | - "execution_count": 15, |
| 191 | + "execution_count": null, |
188 | 192 | "metadata": {}, |
189 | | - "outputs": [ |
190 | | - { |
191 | | - "name": "stderr", |
192 | | - "output_type": "stream", |
193 | | - "text": [ |
194 | | - "100%|█████████████████████████████████████████| 100/100 [00:39<00:00, 2.50it/s]" |
195 | | - ] |
196 | | - }, |
197 | | - { |
198 | | - "name": "stdout", |
199 | | - "output_type": "stream", |
200 | | - "text": [ |
201 | | - "43.98457647341001\n" |
202 | | - ] |
203 | | - }, |
204 | | - { |
205 | | - "name": "stderr", |
206 | | - "output_type": "stream", |
207 | | - "text": [ |
208 | | - "\n" |
209 | | - ] |
210 | | - } |
211 | | - ], |
| 193 | + "outputs": [], |
212 | 194 | "source": [ |
213 | 195 | "h_mud = 2.0 * np.ones((len(chb.channels),)) # thickness of overbank deposit for each time step\n", |
214 | 196 | "dx = 10.0 # gridcell size in meters\n", |
|
242 | 224 | }, |
243 | 225 | { |
244 | 226 | "cell_type": "code", |
245 | | - "execution_count": 25, |
| 227 | + "execution_count": 18, |
246 | 228 | "metadata": {}, |
247 | 229 | "outputs": [ |
248 | 230 | { |
249 | 231 | "name": "stderr", |
250 | 232 | "output_type": "stream", |
251 | 233 | "text": [ |
252 | | - "100%|███████████████████████████████████████| 2000/2000 [00:22<00:00, 90.27it/s]\n" |
| 234 | + "100%|██████████| 2000/2000 [00:17<00:00, 113.11it/s]\n" |
253 | 235 | ] |
254 | 236 | } |
255 | 237 | ], |
|
280 | 262 | }, |
281 | 263 | { |
282 | 264 | "cell_type": "code", |
283 | | - "execution_count": 27, |
| 265 | + "execution_count": 19, |
284 | 266 | "metadata": { |
285 | 267 | "tags": [] |
286 | 268 | }, |
287 | | - "outputs": [ |
288 | | - { |
289 | | - "name": "stderr", |
290 | | - "output_type": "stream", |
291 | | - "text": [ |
292 | | - "100%|█████████████████████████████████████████| 100/100 [01:07<00:00, 1.48it/s]\n" |
293 | | - ] |
294 | | - } |
295 | | - ], |
| 269 | + "outputs": [], |
296 | 270 | "source": [ |
297 | 271 | "# add a bit more incision:\n", |
298 | 272 | "for i in range(len(chb.channels)):\n", |
|
319 | 293 | }, |
320 | 294 | { |
321 | 295 | "cell_type": "code", |
322 | | - "execution_count": 23, |
| 296 | + "execution_count": 20, |
323 | 297 | "metadata": {}, |
324 | 298 | "outputs": [ |
325 | 299 | { |
326 | 300 | "name": "stderr", |
327 | 301 | "output_type": "stream", |
328 | 302 | "text": [ |
329 | | - "100%|█████████████████████████████████████████| 100/100 [01:00<00:00, 1.65it/s]\n" |
| 303 | + "100%|██████████| 100/100 [01:08<00:00, 1.45it/s]\n" |
330 | 304 | ] |
331 | 305 | } |
332 | 306 | ], |
|
349 | 323 | }, |
350 | 324 | { |
351 | 325 | "cell_type": "code", |
352 | | - "execution_count": 42, |
| 326 | + "execution_count": 21, |
353 | 327 | "metadata": {}, |
354 | 328 | "outputs": [], |
355 | 329 | "source": [ |
|
373 | 347 | }, |
374 | 348 | { |
375 | 349 | "cell_type": "code", |
376 | | - "execution_count": 43, |
| 350 | + "execution_count": 22, |
377 | 351 | "metadata": {}, |
378 | 352 | "outputs": [], |
379 | 353 | "source": [ |
|
383 | 357 | }, |
384 | 358 | { |
385 | 359 | "cell_type": "code", |
386 | | - "execution_count": 44, |
| 360 | + "execution_count": 23, |
387 | 361 | "metadata": {}, |
388 | 362 | "outputs": [ |
389 | 363 | { |
390 | 364 | "name": "stderr", |
391 | 365 | "output_type": "stream", |
392 | 366 | "text": [ |
393 | | - "100%|███████████████████████████████████████| 2000/2000 [00:23<00:00, 84.27it/s]\n" |
| 367 | + "100%|██████████| 2000/2000 [00:18<00:00, 109.57it/s]\n" |
394 | 368 | ] |
395 | 369 | } |
396 | 370 | ], |
|
409 | 383 | }, |
410 | 384 | { |
411 | 385 | "cell_type": "code", |
412 | | - "execution_count": 45, |
| 386 | + "execution_count": 24, |
413 | 387 | "metadata": {}, |
414 | 388 | "outputs": [ |
415 | 389 | { |
416 | 390 | "name": "stderr", |
417 | 391 | "output_type": "stream", |
418 | 392 | "text": [ |
419 | | - "100%|█████████████████████████████████████████| 100/100 [03:21<00:00, 2.01s/it]\n" |
| 393 | + " 0%| | 0/100 [00:00<?, ?it/s]/Users/zoltan/Documents/Channels/meanderpy/meanderpy/meanderpy.py:1435: FutureWarning: `square` is deprecated since version 0.25 and will be removed in version 0.27. Use `skimage.morphology.footprint_rectangle` instead.\n", |
| 394 | + " img1 = morphology.binary_dilation(img, morphology.square(2)).astype(np.uint8)\n", |
| 395 | + "100%|██████████| 100/100 [00:56<00:00, 1.78it/s]\n" |
420 | 396 | ] |
421 | 397 | } |
422 | 398 | ], |
|
435 | 411 | }, |
436 | 412 | { |
437 | 413 | "cell_type": "code", |
438 | | - "execution_count": 47, |
| 414 | + "execution_count": 26, |
439 | 415 | "metadata": {}, |
440 | 416 | "outputs": [], |
441 | 417 | "source": [ |
442 | | - "fig1,fig2,fig3 = chb_3d.plot_xsection(1000, [[0.9,0.9,0], [0.5,0.25,0]], 10)" |
| 418 | + "fig1,fig2,fig3 = chb_3d.plot_xsection(400, [[0.9,0.9,0], [0.5,0.25,0]], 10)" |
443 | 419 | ] |
444 | 420 | } |
445 | 421 | ], |
446 | 422 | "metadata": { |
447 | 423 | "kernelspec": { |
448 | | - "display_name": "Python 3 (ipykernel)", |
| 424 | + "display_name": "meanderpy", |
449 | 425 | "language": "python", |
450 | 426 | "name": "python3" |
451 | 427 | }, |
|
459 | 435 | "name": "python", |
460 | 436 | "nbconvert_exporter": "python", |
461 | 437 | "pygments_lexer": "ipython3", |
462 | | - "version": "3.11.4" |
| 438 | + "version": "3.14.2" |
463 | 439 | } |
464 | 440 | }, |
465 | 441 | "nbformat": 4, |
|
0 commit comments