-
Notifications
You must be signed in to change notification settings - Fork 7
/
fgout_tools_module.html
563 lines (515 loc) · 42.5 KB
/
fgout_tools_module.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />
<title>fgout_tools module for working with fgout grids — Clawpack 5.11.x documentation</title>
<link rel="stylesheet" href="_static/base.css" type="text/css" />
<link rel="stylesheet" href="_static/layout.css" type="text/css" />
<link rel="stylesheet" type="text/css" href="_static/pygments.css" />
<link rel="stylesheet" type="text/css" href="_static/flasky.css" />
<link rel="stylesheet" type="text/css" href="_static/graphviz.css" />
<script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script>
<script src="_static/jquery.js"></script>
<script src="_static/underscore.js"></script>
<script src="_static/_sphinx_javascript_frameworks_compat.js"></script>
<script src="_static/doctools.js"></script>
<script src="_static/sphinx_highlight.js"></script>
<link rel="shortcut icon" href="_static/clawicon.ico"/>
<link rel="author" title="About these documents" href="about.html" />
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
</head><body>
<div id="main-wrapper" class="sphinx">
<div id="header-wrapper">
<section id="header">
<!-- <h1><a href="http://clawpack.org/">Clawpack</a></h1> -->
<h1><a href="http://clawpack.org/">Clawpack-5</a></h1>
<nav>
<ul>
<li>
<a href="contents.html">Docs</a>
</li>
<li>
<a href="installing.html">Install</a>
</li>
<li>
<a class="" href="http://clawpack.org/gallery/index.html">Gallery</a>
</li>
<li>
<a href="about.html">Citation</a>
</li>
<li>
<a class="active" href="http://github.com/clawpack">GitHub</a>
</li>
<li>
<a class="" href="community.html">Community</a>
</li>
<li>
<a class="" href="developers.html">Contribute</a>
</li>
</ul>
</nav>
</section>
<div class="decoration"></div>
</div>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="nav-item nav-item-0"><a href="contents.html">Clawpack 5.11.x documentation</a> »</li>
<li class="nav-item nav-item-this"><a href="">fgout_tools module for working with fgout grids</a></li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<section id="fgout-tools-module-for-working-with-fgout-grids">
<span id="fgout-tools-module"></span><h1>fgout_tools module for working with fgout grids<a class="headerlink" href="#fgout-tools-module-for-working-with-fgout-grids" title="Permalink to this heading">¶</a></h1>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<ul class="simple">
<li><p><a class="reference internal" href="fgout.html#fgout"><span class="std std-ref">Fixed grid output (fgout)</span></a></p></li>
</ul>
</div>
<section id="module-clawpack.geoclaw.fgout_tools">
<span id="documentation-auto-generated-from-the-module-docstrings"></span><h2>Documentation auto-generated from the module docstrings<a class="headerlink" href="#module-clawpack.geoclaw.fgout_tools" title="Permalink to this heading">¶</a></h2>
<p>fgout_tools module: $CLAW/geoclaw/src/python/geoclaw/fgout_tools.py</p>
<p>Tools to specify and work with fgout grids, used to output GeoClaw solutions
on a fixed grid at a sequence of times, regardless of the AMR structure.</p>
<p>Includes:</p>
<ul class="simple">
<li><p>class FGoutFrame: used to hold a single frame of fgout output data</p></li>
<li><dl class="simple">
<dt>class FGoutGrid: used to specify and store info about an fgout grid, with</dt><dd><p>methods to read and write info to fgout_grids.data</p>
</dd>
</dl>
</li>
<li><dl class="simple">
<dt>function make_fgout_fcn_xy: Takes an FGoutFrame object and produces an</dt><dd><p>interpolating function that can be evaluated for any (x,y).</p>
</dd>
</dl>
</li>
<li><dl class="simple">
<dt>function make_fgout_fcn_xyt: Takes 2 FGoutFrame objects and produces an</dt><dd><p>interpolating function that can be evaluated for any (x,y,t)
at intermediate times.</p>
</dd>
</dl>
</li>
<li><dl class="simple">
<dt>function write_netcdf: Write a specified set of qoi’s from a list of</dt><dd><p>fgout frames, as a single netCDF file</p>
</dd>
</dl>
</li>
<li><dl class="simple">
<dt>function read_netcdf: Read a netCDF file and return a list of fgout frames,</dt><dd><p>assuming the file contains all the qoi’s needed to reconstruct q.</p>
</dd>
</dl>
</li>
<li><dl class="simple">
<dt>function read_netcdf_arrays: Read a netCDF file and extract the</dt><dd><p>requested quantities of interest as numpy arrays.</p>
</dd>
</dl>
</li>
<li><dl class="simple">
<dt>print_netcdf_info: Print info about the contents of a netCDF file containing</dt><dd><p>some fgout frames.</p>
</dd>
</dl>
</li>
</ul>
<dl class="py class">
<dt class="sig sig-object py" id="clawpack.geoclaw.fgout_tools.FGoutFrame">
<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">clawpack.geoclaw.fgout_tools.</span></span><span class="sig-name descname"><span class="pre">FGoutFrame</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">fgout_grid</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">frameno</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#clawpack.geoclaw.fgout_tools.FGoutFrame" title="Permalink to this definition">¶</a></dt>
<dd><p>Class to hold a single frame of fgout data at one output time.
Several attributes are defined as properties that can be evaluated
and stored only when needed by the user.</p>
<dl class="py property">
<dt class="sig sig-object py" id="clawpack.geoclaw.fgout_tools.FGoutFrame.B">
<em class="property"><span class="pre">property</span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">B</span></span><a class="headerlink" href="#clawpack.geoclaw.fgout_tools.FGoutFrame.B" title="Permalink to this definition">¶</a></dt>
<dd><p>topography</p>
</dd></dl>
<dl class="py property">
<dt class="sig sig-object py" id="clawpack.geoclaw.fgout_tools.FGoutFrame.bdif">
<em class="property"><span class="pre">property</span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">bdif</span></span><a class="headerlink" href="#clawpack.geoclaw.fgout_tools.FGoutFrame.bdif" title="Permalink to this definition">¶</a></dt>
<dd><p>dclaw variable</p>
</dd></dl>
<dl class="py property">
<dt class="sig sig-object py" id="clawpack.geoclaw.fgout_tools.FGoutFrame.eta">
<em class="property"><span class="pre">property</span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">eta</span></span><a class="headerlink" href="#clawpack.geoclaw.fgout_tools.FGoutFrame.eta" title="Permalink to this definition">¶</a></dt>
<dd><p>surface eta = h+B</p>
</dd></dl>
<dl class="py property">
<dt class="sig sig-object py" id="clawpack.geoclaw.fgout_tools.FGoutFrame.h">
<em class="property"><span class="pre">property</span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">h</span></span><a class="headerlink" href="#clawpack.geoclaw.fgout_tools.FGoutFrame.h" title="Permalink to this definition">¶</a></dt>
<dd><p>depth</p>
</dd></dl>
<dl class="py property">
<dt class="sig sig-object py" id="clawpack.geoclaw.fgout_tools.FGoutFrame.hchi">
<em class="property"><span class="pre">property</span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">hchi</span></span><a class="headerlink" href="#clawpack.geoclaw.fgout_tools.FGoutFrame.hchi" title="Permalink to this definition">¶</a></dt>
<dd><p>dclaw variable</p>
</dd></dl>
<dl class="py property">
<dt class="sig sig-object py" id="clawpack.geoclaw.fgout_tools.FGoutFrame.hm">
<em class="property"><span class="pre">property</span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">hm</span></span><a class="headerlink" href="#clawpack.geoclaw.fgout_tools.FGoutFrame.hm" title="Permalink to this definition">¶</a></dt>
<dd><p>dclaw: h * mass fraction</p>
</dd></dl>
<dl class="py property">
<dt class="sig sig-object py" id="clawpack.geoclaw.fgout_tools.FGoutFrame.hss">
<em class="property"><span class="pre">property</span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">hss</span></span><a class="headerlink" href="#clawpack.geoclaw.fgout_tools.FGoutFrame.hss" title="Permalink to this definition">¶</a></dt>
<dd><p>momentum flux h*s**2</p>
</dd></dl>
<dl class="py property">
<dt class="sig sig-object py" id="clawpack.geoclaw.fgout_tools.FGoutFrame.hu">
<em class="property"><span class="pre">property</span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">hu</span></span><a class="headerlink" href="#clawpack.geoclaw.fgout_tools.FGoutFrame.hu" title="Permalink to this definition">¶</a></dt>
<dd><p>momentum h*u</p>
</dd></dl>
<dl class="py property">
<dt class="sig sig-object py" id="clawpack.geoclaw.fgout_tools.FGoutFrame.huc">
<em class="property"><span class="pre">property</span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">huc</span></span><a class="headerlink" href="#clawpack.geoclaw.fgout_tools.FGoutFrame.huc" title="Permalink to this definition">¶</a></dt>
<dd><p>huc - Boussinesq correction to hu</p>
</dd></dl>
<dl class="py property">
<dt class="sig sig-object py" id="clawpack.geoclaw.fgout_tools.FGoutFrame.hv">
<em class="property"><span class="pre">property</span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">hv</span></span><a class="headerlink" href="#clawpack.geoclaw.fgout_tools.FGoutFrame.hv" title="Permalink to this definition">¶</a></dt>
<dd><p>momentum h*v</p>
</dd></dl>
<dl class="py property">
<dt class="sig sig-object py" id="clawpack.geoclaw.fgout_tools.FGoutFrame.hvc">
<em class="property"><span class="pre">property</span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">hvc</span></span><a class="headerlink" href="#clawpack.geoclaw.fgout_tools.FGoutFrame.hvc" title="Permalink to this definition">¶</a></dt>
<dd><p>hvc - Boussinesq correction to hv</p>
</dd></dl>
<dl class="py property">
<dt class="sig sig-object py" id="clawpack.geoclaw.fgout_tools.FGoutFrame.pb">
<em class="property"><span class="pre">property</span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">pb</span></span><a class="headerlink" href="#clawpack.geoclaw.fgout_tools.FGoutFrame.pb" title="Permalink to this definition">¶</a></dt>
<dd><p>dclaw variable</p>
</dd></dl>
<dl class="py property">
<dt class="sig sig-object py" id="clawpack.geoclaw.fgout_tools.FGoutFrame.s">
<em class="property"><span class="pre">property</span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">s</span></span><a class="headerlink" href="#clawpack.geoclaw.fgout_tools.FGoutFrame.s" title="Permalink to this definition">¶</a></dt>
<dd><p>speed s = sqrt(u**2 + v**2)</p>
</dd></dl>
<dl class="py property">
<dt class="sig sig-object py" id="clawpack.geoclaw.fgout_tools.FGoutFrame.u">
<em class="property"><span class="pre">property</span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">u</span></span><a class="headerlink" href="#clawpack.geoclaw.fgout_tools.FGoutFrame.u" title="Permalink to this definition">¶</a></dt>
<dd><p>speed u, computed as hu/h or set to 0 if h<self.drytol</p>
</dd></dl>
<dl class="py property">
<dt class="sig sig-object py" id="clawpack.geoclaw.fgout_tools.FGoutFrame.v">
<em class="property"><span class="pre">property</span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">v</span></span><a class="headerlink" href="#clawpack.geoclaw.fgout_tools.FGoutFrame.v" title="Permalink to this definition">¶</a></dt>
<dd><p>speed v, computed as hv/h or set to 0 if h<self.drytol</p>
</dd></dl>
</dd></dl>
<dl class="py class">
<dt class="sig sig-object py" id="clawpack.geoclaw.fgout_tools.FGoutGrid">
<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">clawpack.geoclaw.fgout_tools.</span></span><span class="sig-name descname"><span class="pre">FGoutGrid</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">fgno</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">outdir</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">'.'</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">output_format</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">qmap</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">'geoclaw'</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#clawpack.geoclaw.fgout_tools.FGoutGrid" title="Permalink to this definition">¶</a></dt>
<dd><p>New class introduced in 5.9.0 to keep store information both about the
fgout input data and the output generated by a GeoClaw run.</p>
<dl class="py property">
<dt class="sig sig-object py" id="clawpack.geoclaw.fgout_tools.FGoutGrid.X">
<em class="property"><span class="pre">property</span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">X</span></span><a class="headerlink" href="#clawpack.geoclaw.fgout_tools.FGoutGrid.X" title="Permalink to this definition">¶</a></dt>
<dd><p>2D array X of longitudes (cell centers)</p>
</dd></dl>
<dl class="py property">
<dt class="sig sig-object py" id="clawpack.geoclaw.fgout_tools.FGoutGrid.Y">
<em class="property"><span class="pre">property</span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">Y</span></span><a class="headerlink" href="#clawpack.geoclaw.fgout_tools.FGoutGrid.Y" title="Permalink to this definition">¶</a></dt>
<dd><p>2D array Y of latitudes (cell centers)</p>
</dd></dl>
<dl class="py property">
<dt class="sig sig-object py" id="clawpack.geoclaw.fgout_tools.FGoutGrid.extent_centers">
<em class="property"><span class="pre">property</span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">extent_centers</span></span><a class="headerlink" href="#clawpack.geoclaw.fgout_tools.FGoutGrid.extent_centers" title="Permalink to this definition">¶</a></dt>
<dd><p>Extent of cell centers [xmin,xmax,ymin,ymax]</p>
</dd></dl>
<dl class="py property">
<dt class="sig sig-object py" id="clawpack.geoclaw.fgout_tools.FGoutGrid.extent_edges">
<em class="property"><span class="pre">property</span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">extent_edges</span></span><a class="headerlink" href="#clawpack.geoclaw.fgout_tools.FGoutGrid.extent_edges" title="Permalink to this definition">¶</a></dt>
<dd><p>Extent of cell edges [xmin,xmax,ymin,ymax]</p>
</dd></dl>
<dl class="py method">
<dt class="sig sig-object py" id="clawpack.geoclaw.fgout_tools.FGoutGrid.read_fgout_grids_data">
<span class="sig-name descname"><span class="pre">read_fgout_grids_data</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">fgno</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">data_file</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">'fgout_grids.data'</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#clawpack.geoclaw.fgout_tools.FGoutGrid.read_fgout_grids_data" title="Permalink to this definition">¶</a></dt>
<dd><p>Read input info for fgout grid number fgno from the data file
fgout_grids.data, which should have been created by setrun.py.
This file now contains info about all fgout grids.</p>
</dd></dl>
<dl class="py method">
<dt class="sig sig-object py" id="clawpack.geoclaw.fgout_tools.FGoutGrid.read_fgout_grids_data_pre511">
<span class="sig-name descname"><span class="pre">read_fgout_grids_data_pre511</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">fgno</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">data_file</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">'fgout_grids.data'</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#clawpack.geoclaw.fgout_tools.FGoutGrid.read_fgout_grids_data_pre511" title="Permalink to this definition">¶</a></dt>
<dd><p>For backward compatibility, this reads fgout_grids.data files
in the format used prior to v5.11.</p>
<dl class="simple">
<dt>In this case, the following values are used, as set in __init__():</dt><dd><p>self.output_style = 1
self.qmap = ‘qmap’
self.q_out_vars = [1,2,3,4] # h,hu,hv,eta</p>
</dd>
</dl>
<p>Read input info for fgout grid number fgno from the data file
fgout_grids.data, which should have been created by setrun.py.
This file now contains info about all fgout grids.</p>
</dd></dl>
<dl class="py method">
<dt class="sig sig-object py" id="clawpack.geoclaw.fgout_tools.FGoutGrid.read_frame">
<span class="sig-name descname"><span class="pre">read_frame</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">frameno</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#clawpack.geoclaw.fgout_tools.FGoutGrid.read_frame" title="Permalink to this definition">¶</a></dt>
<dd><p>Read a single frame of fgout data.</p>
</dd></dl>
<dl class="py method">
<dt class="sig sig-object py" id="clawpack.geoclaw.fgout_tools.FGoutGrid.set_plotdata">
<span class="sig-name descname"><span class="pre">set_plotdata</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#clawpack.geoclaw.fgout_tools.FGoutGrid.set_plotdata" title="Permalink to this definition">¶</a></dt>
<dd><p>Create a plotdata, assuming attributes fgno, outdir, output_format
have all been set.</p>
</dd></dl>
<dl class="py method">
<dt class="sig sig-object py" id="clawpack.geoclaw.fgout_tools.FGoutGrid.write_to_fgout_data">
<span class="sig-name descname"><span class="pre">write_to_fgout_data</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">fid</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#clawpack.geoclaw.fgout_tools.FGoutGrid.write_to_fgout_data" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert fgout data specified in setrun.py to file <cite>fgout_grids.data</cite>
read in by GeoClaw fortran code.</p>
</dd></dl>
<dl class="py property">
<dt class="sig sig-object py" id="clawpack.geoclaw.fgout_tools.FGoutGrid.x">
<em class="property"><span class="pre">property</span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">x</span></span><a class="headerlink" href="#clawpack.geoclaw.fgout_tools.FGoutGrid.x" title="Permalink to this definition">¶</a></dt>
<dd><p>1D array x of longitudes (cell centers)</p>
</dd></dl>
<dl class="py property">
<dt class="sig sig-object py" id="clawpack.geoclaw.fgout_tools.FGoutGrid.y">
<em class="property"><span class="pre">property</span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">y</span></span><a class="headerlink" href="#clawpack.geoclaw.fgout_tools.FGoutGrid.y" title="Permalink to this definition">¶</a></dt>
<dd><p>1D array y of latitudes (cell centers)</p>
</dd></dl>
</dd></dl>
<dl class="py function">
<dt class="sig sig-object py" id="clawpack.geoclaw.fgout_tools.get_as_array">
<span class="sig-prename descclassname"><span class="pre">clawpack.geoclaw.fgout_tools.</span></span><span class="sig-name descname"><span class="pre">get_as_array</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">var</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">rootgrp</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">verbose</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#clawpack.geoclaw.fgout_tools.get_as_array" title="Permalink to this definition">¶</a></dt>
<dd><p>Utility function to retrieve variable from netCDF file and convert to
numpy array.</p>
</dd></dl>
<dl class="py function">
<dt class="sig sig-object py" id="clawpack.geoclaw.fgout_tools.make_fgout_fcn_xy">
<span class="sig-prename descclassname"><span class="pre">clawpack.geoclaw.fgout_tools.</span></span><span class="sig-name descname"><span class="pre">make_fgout_fcn_xy</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">fgout</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">qoi</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">method</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">'nearest'</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">bounds_error</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">fill_value</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">nan</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#clawpack.geoclaw.fgout_tools.make_fgout_fcn_xy" title="Permalink to this definition">¶</a></dt>
<dd><p>Create a function that can be called at (x,y) and return the qoi
interpolated in space from the fgout array.</p>
<p>qoi should be a string (e.g. ‘h’, ‘u’ or ‘v’) corresponding to
an attribute of fgout.</p>
<p>The function returned takes arguments x,y that can be floats or
(equal length) 1D arrays of values that lie within the spatial
extent of fgout.</p>
<p>bounds_error and fill_value determine the behavior if (x,y) is not in
the bounds of the data, as in scipy.interpolate.RegularGridInterpolator.</p>
</dd></dl>
<dl class="py function">
<dt class="sig sig-object py" id="clawpack.geoclaw.fgout_tools.make_fgout_fcn_xyt">
<span class="sig-prename descclassname"><span class="pre">clawpack.geoclaw.fgout_tools.</span></span><span class="sig-name descname"><span class="pre">make_fgout_fcn_xyt</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">fgout1</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">fgout2</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">qoi</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">method_xy</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">'nearest'</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">method_t</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">'linear'</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">bounds_error</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">fill_value</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">nan</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#clawpack.geoclaw.fgout_tools.make_fgout_fcn_xyt" title="Permalink to this definition">¶</a></dt>
<dd><p>Create a function that can be called at (x,y,t) and return the qoi
interpolated in space and time between the two frames fgout1 and fgout2.</p>
<p>qoi should be a string (e.g. ‘h’, ‘u’ or ‘v’) corresponding to
an attribute of fgout.</p>
<p>method_xy is the method used in creating the spatial interpolator,
and is passed to make_fgout_fcn_xy.</p>
<p>method_t is the method used for interpolation in time, currently only
‘linear’ is supported, which linearly interpolates.</p>
<p>bounds_error and fill_value determine the behavior if (x,y,t) is not in
the bounds of the data.</p>
<p>The function returned takes arguments x,y (floats or equal-length 1D arrays)
of values that lie within the spatial extent of fgout1, fgout2
(which are assumed to cover the same uniform grid at different times)
and t should be a float that lies between fgout1.t and fgout2.t.</p>
</dd></dl>
<dl class="py function">
<dt class="sig sig-object py" id="clawpack.geoclaw.fgout_tools.print_netcdf_info">
<span class="sig-prename descclassname"><span class="pre">clawpack.geoclaw.fgout_tools.</span></span><span class="sig-name descname"><span class="pre">print_netcdf_info</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">fname_nc</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#clawpack.geoclaw.fgout_tools.print_netcdf_info" title="Permalink to this definition">¶</a></dt>
<dd><p>Print out info about the contents of a netCDF file contining fgout frames,
written using write_netcdf.</p>
</dd></dl>
<dl class="py function">
<dt class="sig sig-object py" id="clawpack.geoclaw.fgout_tools.read_netcdf">
<span class="sig-prename descclassname"><span class="pre">clawpack.geoclaw.fgout_tools.</span></span><span class="sig-name descname"><span class="pre">read_netcdf</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">fname_nc</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">fgout_grid</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">verbose</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#clawpack.geoclaw.fgout_tools.read_netcdf" title="Permalink to this definition">¶</a></dt>
<dd><p>Read a netCDF file and return a list of FGoutFrame instances.
This will only be possible if the netCDF file contains at least
the qoi’s ‘h’,’hu’,’hv’,’eta’ required to reconstruct the q array
as output by GeoClaw.</p>
</dd></dl>
<dl class="py function">
<dt class="sig sig-object py" id="clawpack.geoclaw.fgout_tools.read_netcdf_arrays">
<span class="sig-prename descclassname"><span class="pre">clawpack.geoclaw.fgout_tools.</span></span><span class="sig-name descname"><span class="pre">read_netcdf_arrays</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">fname_nc</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">qois</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">verbose</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#clawpack.geoclaw.fgout_tools.read_netcdf_arrays" title="Permalink to this definition">¶</a></dt>
<dd><p>Read a netCDF file and extract the quantities of interest denoted by
strings in the list qois, which can include:</p>
<blockquote>
<div><p>‘h’, ‘eta’, ‘hu’, ‘hv’, ‘u’, ‘v’, ‘s’, ‘hss’, ‘B’.</p>
</div></blockquote>
<p>qois can also include the time-independent ‘B0’ and/or ‘Bfinal’</p>
<p>Returns</p>
<blockquote>
<div><p>x, y, t, qoi_arrays</p>
</div></blockquote>
<p>where x,y define the longitude, latitudes, t is the times of the frames,
and qoi_arrays is a dictionary indexed by the strings from qois.</p>
<p>Each dict element is an array with shape (len(t), len(x), len(y))
for time-dependent qoi’s, or (len(x), len(y)) for B0 or Bfinal,
or None if that qoi was not found in the netCDF file.</p>
</dd></dl>
<dl class="py function">
<dt class="sig sig-object py" id="clawpack.geoclaw.fgout_tools.write_netcdf">
<span class="sig-prename descclassname"><span class="pre">clawpack.geoclaw.fgout_tools.</span></span><span class="sig-name descname"><span class="pre">write_netcdf</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">fgout_frames</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">fname_nc</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">'fgout_frames.nc'</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">qois</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">['h',</span> <span class="pre">'hu',</span> <span class="pre">'hv',</span> <span class="pre">'eta']</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">datatype</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">'f4'</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">include_B0</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">include_Bfinal</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">description</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">''</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">verbose</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#clawpack.geoclaw.fgout_tools.write_netcdf" title="Permalink to this definition">¶</a></dt>
<dd><p>Write a list of fgout frames (at different times on the same rectangular
grid) to a single netCDF file, with some metadata and the topography,
if desired.</p>
<p>fgout_frames should be a list of FGoutFrame objects, all of the same size
and at increasing times.</p>
<p>fname_nc is the name of the file to write.</p>
<dl>
<dt>qois is a list of strings, the quantities of interest to include in file.</dt><dd><p>This could include any of:</p>
<blockquote>
<div><p>‘h’, ‘eta’, ‘hu’, ‘hv’, ‘u’, ‘v’, ‘s’, ‘hss’, ‘B’.</p>
</div></blockquote>
<p>All other quantities can be computed from h, hu, hv, eta,
the original fgout variables from GeoClaw, but for some applications
you might only want to save ‘h’ and ‘s’, for example.</p>
</dd>
<dt>datatype should be ‘f4’ [default] or ‘f8’, specifying bytes per qoi value.</dt><dd><p>‘f8’ has full precision of the original data, but the file will be
twice as large and may not be needed for downstream applications.</p>
</dd>
</dl>
<p>Note that the topography B = eta - h, so it is not necessary to store all
three of these. Also, B is often the same for all frames, so rather than
storing B at each frame as a qoi, two other options are also provided
(and then storing eta or h for all frames allows calculating the other):</p>
<p>include_Bfinal: If True, include the topography B array from the final frame
as the Bfinal array.</p>
<p>include_B0: If True, include the topography B array from the first frame
as the B0 array. This is only useful if, e.g., the first frame is initial
topography before co-seismic deformation, and at later times the topography
is always equal to Bfinal.</p>
<p><cite>description</cite> is a string that will be added as metadata.
A metadata field <cite>history</cite> will also be added, which includes the
time the file was created and the path to the directory where it was made.</p>
</dd></dl>
</section>
</section>
<div class="clearer"></div>
</div>
</div>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<p><a href="http://clawpack.org/">
<img class="logo" src= "_static/clawlogo.jpg" alt="Logo"/>
</a>
<h2>Version 5.11.x</h2>
</p>
<div>
<h3><a href="contents.html">Table of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">fgout_tools module for working with fgout grids</a><ul>
<li><a class="reference internal" href="#module-clawpack.geoclaw.fgout_tools">Documentation auto-generated from the module docstrings</a><ul>
<li><a class="reference internal" href="#clawpack.geoclaw.fgout_tools.FGoutFrame"><code class="docutils literal notranslate"><span class="pre">FGoutFrame</span></code></a><ul>
<li><a class="reference internal" href="#clawpack.geoclaw.fgout_tools.FGoutFrame.B"><code class="docutils literal notranslate"><span class="pre">FGoutFrame.B</span></code></a></li>
<li><a class="reference internal" href="#clawpack.geoclaw.fgout_tools.FGoutFrame.bdif"><code class="docutils literal notranslate"><span class="pre">FGoutFrame.bdif</span></code></a></li>
<li><a class="reference internal" href="#clawpack.geoclaw.fgout_tools.FGoutFrame.eta"><code class="docutils literal notranslate"><span class="pre">FGoutFrame.eta</span></code></a></li>
<li><a class="reference internal" href="#clawpack.geoclaw.fgout_tools.FGoutFrame.h"><code class="docutils literal notranslate"><span class="pre">FGoutFrame.h</span></code></a></li>
<li><a class="reference internal" href="#clawpack.geoclaw.fgout_tools.FGoutFrame.hchi"><code class="docutils literal notranslate"><span class="pre">FGoutFrame.hchi</span></code></a></li>
<li><a class="reference internal" href="#clawpack.geoclaw.fgout_tools.FGoutFrame.hm"><code class="docutils literal notranslate"><span class="pre">FGoutFrame.hm</span></code></a></li>
<li><a class="reference internal" href="#clawpack.geoclaw.fgout_tools.FGoutFrame.hss"><code class="docutils literal notranslate"><span class="pre">FGoutFrame.hss</span></code></a></li>
<li><a class="reference internal" href="#clawpack.geoclaw.fgout_tools.FGoutFrame.hu"><code class="docutils literal notranslate"><span class="pre">FGoutFrame.hu</span></code></a></li>
<li><a class="reference internal" href="#clawpack.geoclaw.fgout_tools.FGoutFrame.huc"><code class="docutils literal notranslate"><span class="pre">FGoutFrame.huc</span></code></a></li>
<li><a class="reference internal" href="#clawpack.geoclaw.fgout_tools.FGoutFrame.hv"><code class="docutils literal notranslate"><span class="pre">FGoutFrame.hv</span></code></a></li>
<li><a class="reference internal" href="#clawpack.geoclaw.fgout_tools.FGoutFrame.hvc"><code class="docutils literal notranslate"><span class="pre">FGoutFrame.hvc</span></code></a></li>
<li><a class="reference internal" href="#clawpack.geoclaw.fgout_tools.FGoutFrame.pb"><code class="docutils literal notranslate"><span class="pre">FGoutFrame.pb</span></code></a></li>
<li><a class="reference internal" href="#clawpack.geoclaw.fgout_tools.FGoutFrame.s"><code class="docutils literal notranslate"><span class="pre">FGoutFrame.s</span></code></a></li>
<li><a class="reference internal" href="#clawpack.geoclaw.fgout_tools.FGoutFrame.u"><code class="docutils literal notranslate"><span class="pre">FGoutFrame.u</span></code></a></li>
<li><a class="reference internal" href="#clawpack.geoclaw.fgout_tools.FGoutFrame.v"><code class="docutils literal notranslate"><span class="pre">FGoutFrame.v</span></code></a></li>
</ul>
</li>
<li><a class="reference internal" href="#clawpack.geoclaw.fgout_tools.FGoutGrid"><code class="docutils literal notranslate"><span class="pre">FGoutGrid</span></code></a><ul>
<li><a class="reference internal" href="#clawpack.geoclaw.fgout_tools.FGoutGrid.X"><code class="docutils literal notranslate"><span class="pre">FGoutGrid.X</span></code></a></li>
<li><a class="reference internal" href="#clawpack.geoclaw.fgout_tools.FGoutGrid.Y"><code class="docutils literal notranslate"><span class="pre">FGoutGrid.Y</span></code></a></li>
<li><a class="reference internal" href="#clawpack.geoclaw.fgout_tools.FGoutGrid.extent_centers"><code class="docutils literal notranslate"><span class="pre">FGoutGrid.extent_centers</span></code></a></li>
<li><a class="reference internal" href="#clawpack.geoclaw.fgout_tools.FGoutGrid.extent_edges"><code class="docutils literal notranslate"><span class="pre">FGoutGrid.extent_edges</span></code></a></li>
<li><a class="reference internal" href="#clawpack.geoclaw.fgout_tools.FGoutGrid.read_fgout_grids_data"><code class="docutils literal notranslate"><span class="pre">FGoutGrid.read_fgout_grids_data()</span></code></a></li>
<li><a class="reference internal" href="#clawpack.geoclaw.fgout_tools.FGoutGrid.read_fgout_grids_data_pre511"><code class="docutils literal notranslate"><span class="pre">FGoutGrid.read_fgout_grids_data_pre511()</span></code></a></li>
<li><a class="reference internal" href="#clawpack.geoclaw.fgout_tools.FGoutGrid.read_frame"><code class="docutils literal notranslate"><span class="pre">FGoutGrid.read_frame()</span></code></a></li>
<li><a class="reference internal" href="#clawpack.geoclaw.fgout_tools.FGoutGrid.set_plotdata"><code class="docutils literal notranslate"><span class="pre">FGoutGrid.set_plotdata()</span></code></a></li>
<li><a class="reference internal" href="#clawpack.geoclaw.fgout_tools.FGoutGrid.write_to_fgout_data"><code class="docutils literal notranslate"><span class="pre">FGoutGrid.write_to_fgout_data()</span></code></a></li>
<li><a class="reference internal" href="#clawpack.geoclaw.fgout_tools.FGoutGrid.x"><code class="docutils literal notranslate"><span class="pre">FGoutGrid.x</span></code></a></li>
<li><a class="reference internal" href="#clawpack.geoclaw.fgout_tools.FGoutGrid.y"><code class="docutils literal notranslate"><span class="pre">FGoutGrid.y</span></code></a></li>
</ul>
</li>
<li><a class="reference internal" href="#clawpack.geoclaw.fgout_tools.get_as_array"><code class="docutils literal notranslate"><span class="pre">get_as_array()</span></code></a></li>
<li><a class="reference internal" href="#clawpack.geoclaw.fgout_tools.make_fgout_fcn_xy"><code class="docutils literal notranslate"><span class="pre">make_fgout_fcn_xy()</span></code></a></li>
<li><a class="reference internal" href="#clawpack.geoclaw.fgout_tools.make_fgout_fcn_xyt"><code class="docutils literal notranslate"><span class="pre">make_fgout_fcn_xyt()</span></code></a></li>
<li><a class="reference internal" href="#clawpack.geoclaw.fgout_tools.print_netcdf_info"><code class="docutils literal notranslate"><span class="pre">print_netcdf_info()</span></code></a></li>
<li><a class="reference internal" href="#clawpack.geoclaw.fgout_tools.read_netcdf"><code class="docutils literal notranslate"><span class="pre">read_netcdf()</span></code></a></li>
<li><a class="reference internal" href="#clawpack.geoclaw.fgout_tools.read_netcdf_arrays"><code class="docutils literal notranslate"><span class="pre">read_netcdf_arrays()</span></code></a></li>
<li><a class="reference internal" href="#clawpack.geoclaw.fgout_tools.write_netcdf"><code class="docutils literal notranslate"><span class="pre">write_netcdf()</span></code></a></li>
</ul>
</li>
</ul>
</li>
</ul>
</div><h3>Related Topics</h3>
<ul>
<li><a href="contents.html">Documentation overview</a><ul>
</ul></li>
</ul>
<div class="widget navlinks">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="_sources/fgout_tools_module.rst.txt"
rel="nofollow"
target="_blank">Source .rst</a></li>
<li><a href="https://github.com/clawpack/doc/blob/dev/doc/fgout_tools_module.rst"
rel="nofollow"
target="_blank">Source on GitHub</a></li>
<li><a href="https://github.com/clawpack/doc/commits/dev/doc/fgout_tools_module.rst"
rel="nofollow"
target="_blank">History</a></li>
<li><a href="https://github.com/clawpack/doc/edit/dev/doc/fgout_tools_module.rst"
rel="nofollow"
target="_blank">Suggest Edits</a></li>
<li><a href="https://github.com/clawpack/doc/issues/new/choose"
rel="nofollow"
target="_blank">Raise an Issue</a></li>
</ul>
</div>
<div id="searchbox" style="display: none" role="search">
<h3 id="searchlabel">Quick search</h3>
<div class="searchformwrapper">
<form class="search" action="search.html" method="get">
<input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
<input type="submit" value="Go" />
</form>
</div>
</div>
<script>document.getElementById('searchbox').style.display = "block"</script>
<h4>Latest Version</h4>
<ul>
<li><a href="./dev/fgout_tools_module.html">dev</a></li>
<li><a href="fgout_tools_module.html">v5.11.x</a></li>
</ul>
<h4>Older Versions</h4>
<ul>
<li><a href="./v5.10.x/fgout_tools_module.html">v5.10.x</a></li>
<li><a href="./v5.7.x/index.html">v5.7.x</a></li>
<li><a href="./v5.8.x/index.html">v5.8.x</a></li>
<li><a href="./v5.9.x/fgout_tools_module.html">v5.9.x</a></li>
</ul>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer">
© Copyright CC-BY 2024, The Clawpack Development Team.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a>.
</div>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-44811544-1', 'auto');
ga('send', 'pageview');
</script>
</body>
</html>