roms-tools 2.2.0__py3-none-any.whl → 2.3.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- roms_tools/__init__.py +1 -0
- roms_tools/analysis/roms_output.py +586 -0
- roms_tools/{setup/download.py → download.py} +3 -0
- roms_tools/{setup/plot.py → plot.py} +34 -28
- roms_tools/setup/boundary_forcing.py +23 -12
- roms_tools/setup/datasets.py +2 -135
- roms_tools/setup/grid.py +54 -15
- roms_tools/setup/initial_conditions.py +105 -149
- roms_tools/setup/nesting.py +4 -4
- roms_tools/setup/river_forcing.py +7 -9
- roms_tools/setup/surface_forcing.py +14 -14
- roms_tools/setup/tides.py +24 -21
- roms_tools/setup/topography.py +1 -1
- roms_tools/setup/utils.py +19 -143
- roms_tools/tests/test_analysis/test_roms_output.py +269 -0
- roms_tools/tests/{test_setup/test_regrid.py → test_regrid.py} +1 -1
- roms_tools/tests/test_setup/test_boundary_forcing.py +1 -1
- roms_tools/tests/test_setup/test_datasets.py +1 -1
- roms_tools/tests/test_setup/test_grid.py +1 -1
- roms_tools/tests/test_setup/test_initial_conditions.py +8 -4
- roms_tools/tests/test_setup/test_river_forcing.py +1 -1
- roms_tools/tests/test_setup/test_surface_forcing.py +1 -1
- roms_tools/tests/test_setup/test_tides.py +1 -1
- roms_tools/tests/test_setup/test_topography.py +1 -1
- roms_tools/tests/test_setup/test_utils.py +56 -1
- roms_tools/utils.py +301 -0
- roms_tools/vertical_coordinate.py +306 -0
- {roms_tools-2.2.0.dist-info → roms_tools-2.3.0.dist-info}/METADATA +1 -1
- {roms_tools-2.2.0.dist-info → roms_tools-2.3.0.dist-info}/RECORD +33 -31
- roms_tools/setup/vertical_coordinate.py +0 -109
- /roms_tools/{setup/regrid.py → regrid.py} +0 -0
- {roms_tools-2.2.0.dist-info → roms_tools-2.3.0.dist-info}/LICENSE +0 -0
- {roms_tools-2.2.0.dist-info → roms_tools-2.3.0.dist-info}/WHEEL +0 -0
- {roms_tools-2.2.0.dist-info → roms_tools-2.3.0.dist-info}/top_level.txt +0 -0
|
@@ -1,38 +1,40 @@
|
|
|
1
1
|
ci/environment.yml,sha256=bwK5Lz4j44gY2ee2Edn3ftXnfvYbRUVvFXVJH7T-oro,198
|
|
2
|
-
roms_tools/__init__.py,sha256=
|
|
3
|
-
roms_tools/
|
|
2
|
+
roms_tools/__init__.py,sha256=lncxTF_gktPQIbxQk_hzEykCvrVOrLWxByRSluUOGbs,915
|
|
3
|
+
roms_tools/download.py,sha256=W6S_DFVJDXat2w9MfyyHyushrswbpUI2hxegSuua1XE,6248
|
|
4
|
+
roms_tools/plot.py,sha256=n0jI2uOzuO1Rv5x1AfP16qinsM19-_k91p2b3qM5FxY,13213
|
|
5
|
+
roms_tools/regrid.py,sha256=OBlW-KnQfXmxSZ5MwNoroxU51sI8-3ZRQhEPX3maj1A,5173
|
|
6
|
+
roms_tools/utils.py,sha256=Tu4opo8I85uI3XpuPoeZmjfnBEoQMkGlIehB8SiStJY,23436
|
|
7
|
+
roms_tools/vertical_coordinate.py,sha256=J36HpZ1ADQM3asUjmBu_tpr6sVFSoF2JQdOnWBtXHo4,9826
|
|
8
|
+
roms_tools/analysis/roms_output.py,sha256=7X_w9_8bg4x9XUL50ktzQIHmByVcCBFa5gFOsnpot50,23110
|
|
4
9
|
roms_tools/setup/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
5
|
-
roms_tools/setup/boundary_forcing.py,sha256=
|
|
6
|
-
roms_tools/setup/datasets.py,sha256
|
|
7
|
-
roms_tools/setup/download.py,sha256=TgDC3TdE_njFGbPYJprAN8J1nYeOWFzavQhUfOGwAYk,5927
|
|
10
|
+
roms_tools/setup/boundary_forcing.py,sha256=aRo9bdWaRI6AMTc2iA1Fj0nOjzhskhtzvHW-pCLFF9Q,43375
|
|
11
|
+
roms_tools/setup/datasets.py,sha256=QpwD5CaRB4gSnvFWLep7oWJTnUZg-7vKiF_Z-79-vn4,81343
|
|
8
12
|
roms_tools/setup/fill.py,sha256=YQes_9uADZ-XZ6dBqXyvG7OAp7UrWhX-p3pR1gD6Od4,11120
|
|
9
|
-
roms_tools/setup/grid.py,sha256=
|
|
10
|
-
roms_tools/setup/initial_conditions.py,sha256=
|
|
13
|
+
roms_tools/setup/grid.py,sha256=OIQl1bGbg5G87oScDPsfMOuGlMKk9J_ppS3DmPhKZCU,52994
|
|
14
|
+
roms_tools/setup/initial_conditions.py,sha256=XdM5Nc3mBgKf_TplGumt60lIfJMb2_O5KZbbQtb5GK4,34396
|
|
11
15
|
roms_tools/setup/mask.py,sha256=IK2SrVnMJwZjE4jNFtzMQhp1c5c8SUO45OIpCIrNSis,3413
|
|
12
|
-
roms_tools/setup/nesting.py,sha256=
|
|
13
|
-
roms_tools/setup/
|
|
14
|
-
roms_tools/setup/
|
|
15
|
-
roms_tools/setup/
|
|
16
|
-
roms_tools/setup/
|
|
17
|
-
roms_tools/setup/
|
|
18
|
-
roms_tools/setup/topography.py,sha256=pKf2EmUc85meKN5aDkN1fY2U3Zn5nn80RDqzaEfpvvw,13475
|
|
19
|
-
roms_tools/setup/utils.py,sha256=1WzeRF8hf-00cnh2M73nsyvMQxDfHqXF2AMI947iyDk,46494
|
|
20
|
-
roms_tools/setup/vertical_coordinate.py,sha256=yw3L_ONELAZfOHwNvcyQaJ0Vqir05FRzFBd601eTLUM,2689
|
|
16
|
+
roms_tools/setup/nesting.py,sha256=UsJNltTdfQC6kWCNDKYMv9ylpQTepfAeH2RskROPg3A,20996
|
|
17
|
+
roms_tools/setup/river_forcing.py,sha256=4OXkpvgWzgGaj-sY9_iScQs9HkmpJwot2-6jXRpm5Fs,27321
|
|
18
|
+
roms_tools/setup/surface_forcing.py,sha256=dw0EuIf6UdXiRIWzJVrqEOwDaX3f5TIIqgF5_gTXKPg,21425
|
|
19
|
+
roms_tools/setup/tides.py,sha256=M_CaXWozVculR_wYBtSuiQyzKIaru15IPnoY3WkLxOM,28344
|
|
20
|
+
roms_tools/setup/topography.py,sha256=8cZczFV4w71jGJ6puuNh2TyaN4_TWjtGV1FT-a1NaBQ,13469
|
|
21
|
+
roms_tools/setup/utils.py,sha256=0qaAhUanOHZzoaacV8ynAn0rA1JV8Gm8eINRrOs7THM,41709
|
|
21
22
|
roms_tools/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
23
|
+
roms_tools/tests/test_regrid.py,sha256=-hFsULcJOJs90UdHrEcZa455vMZfcmXeFEFt8mnCVyo,1885
|
|
22
24
|
roms_tools/tests/test_utils.py,sha256=X16UHYzd8KmUgxBHJqmVP6cIHfOtScCdXPw905bgGMk,7966
|
|
25
|
+
roms_tools/tests/test_analysis/test_roms_output.py,sha256=cnGiD9yA7LqBMKaJkm_P_XQ490dUn_ZjGdyttFTbhBk,9831
|
|
23
26
|
roms_tools/tests/test_setup/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
24
|
-
roms_tools/tests/test_setup/test_boundary_forcing.py,sha256=
|
|
25
|
-
roms_tools/tests/test_setup/test_datasets.py,sha256=
|
|
27
|
+
roms_tools/tests/test_setup/test_boundary_forcing.py,sha256=sW7aZjUKP2eEwZwlzkCmnSR-VyZPDMEihsP0xwLMc4s,14419
|
|
28
|
+
roms_tools/tests/test_setup/test_datasets.py,sha256=EInjmCLFNWJoO8nIQJhDtmFmMFmjcrr5L_5vJYm-qno,16435
|
|
26
29
|
roms_tools/tests/test_setup/test_fill.py,sha256=gDHuM58d3ECQE317ZntChYt4hWCfo4eVhkW13NiZ1V4,3735
|
|
27
|
-
roms_tools/tests/test_setup/test_grid.py,sha256=
|
|
28
|
-
roms_tools/tests/test_setup/test_initial_conditions.py,sha256=
|
|
30
|
+
roms_tools/tests/test_setup/test_grid.py,sha256=9Jw2r_xYafEbI5BauZJgXQD2133mil4yHxj4nwTU9dY,14657
|
|
31
|
+
roms_tools/tests/test_setup/test_initial_conditions.py,sha256=hloWo01wiQEKh3rzhNi2sE0BL1sw40BvTZjoXTIVRjA,11303
|
|
29
32
|
roms_tools/tests/test_setup/test_nesting.py,sha256=_LB_10XgGkQ6DmpHp5rgIWTEN6nR14aZY8B_ADX4cRQ,18525
|
|
30
|
-
roms_tools/tests/test_setup/
|
|
31
|
-
roms_tools/tests/test_setup/
|
|
32
|
-
roms_tools/tests/test_setup/
|
|
33
|
-
roms_tools/tests/test_setup/
|
|
34
|
-
roms_tools/tests/test_setup/
|
|
35
|
-
roms_tools/tests/test_setup/test_utils.py,sha256=lVeeiEEk_nR0zdmAdRHMlkBUNrAZMiZFrHaLQNy_lPE,585
|
|
33
|
+
roms_tools/tests/test_setup/test_river_forcing.py,sha256=9VX7FgN6VFHcZSZwWfKM6fUwIIEiAUorllXWDyZeUI8,12004
|
|
34
|
+
roms_tools/tests/test_setup/test_surface_forcing.py,sha256=jWz0XlCo2Gkk_Xk2zGxFSPfIO34rqtbnMHrw3WMeZis,24994
|
|
35
|
+
roms_tools/tests/test_setup/test_tides.py,sha256=d02gKVhWkgpNu8O5w6VDL4BXtbNVYNZttf8tPbwcWnc,8571
|
|
36
|
+
roms_tools/tests/test_setup/test_topography.py,sha256=EAF-zCHfo6XnXQfBTrSZLuZDVzegWHHlrf9oBmvY0hM,4963
|
|
37
|
+
roms_tools/tests/test_setup/test_utils.py,sha256=7zTmEsCqZ4pQBbECxhC420dT4fMo06ExKyxUL5TMaZ0,2204
|
|
36
38
|
roms_tools/tests/test_setup/test_validation.py,sha256=suAkZkcxum5I7uUI2eIXxutLk6yQPtXOCSKrfSIMbN4,2294
|
|
37
39
|
roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/.zattrs,sha256=tS9VXhST813qsPHqGFwK0IMH6t1iUfxhcNTpsS1p0ns,360
|
|
38
40
|
roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/.zgroup,sha256=I4N0bme0vMJ2Kz8QDwbD-i1fFJq1qOXaXTNSFGSgGVk,24
|
|
@@ -1048,8 +1050,8 @@ roms_tools/tests/test_setup/test_data/tidal_forcing.zarr/v_Im/0.0.0,sha256=60jWZ
|
|
|
1048
1050
|
roms_tools/tests/test_setup/test_data/tidal_forcing.zarr/v_Re/.zarray,sha256=2P8kKjSgdw5-3udU-vGJ3bzhNuRn7fZmWN811qBJn34,357
|
|
1049
1051
|
roms_tools/tests/test_setup/test_data/tidal_forcing.zarr/v_Re/.zattrs,sha256=2z7WUPvCT9VfFs8VCBltFHLWgaGj1jcw3yZ4n0viLRg,197
|
|
1050
1052
|
roms_tools/tests/test_setup/test_data/tidal_forcing.zarr/v_Re/0.0.0,sha256=33Gl8otBmgqVarmAnZuEqTYS2_hVJUJh-iN1HzvaDuo,96
|
|
1051
|
-
roms_tools-2.
|
|
1052
|
-
roms_tools-2.
|
|
1053
|
-
roms_tools-2.
|
|
1054
|
-
roms_tools-2.
|
|
1055
|
-
roms_tools-2.
|
|
1053
|
+
roms_tools-2.3.0.dist-info/LICENSE,sha256=yiff76E4xRioW2bHhlPpyYpstmePQBx2bF8HhgQhSsg,11318
|
|
1054
|
+
roms_tools-2.3.0.dist-info/METADATA,sha256=uBNABK8KhsXCBlJYOBuYL9n4xWtQXboIFSftozCT7y0,4244
|
|
1055
|
+
roms_tools-2.3.0.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
|
1056
|
+
roms_tools-2.3.0.dist-info/top_level.txt,sha256=aAf4T4nYQSkay5iKJ9kmTjlDgd4ETdp9OSlB4sJdt8Y,19
|
|
1057
|
+
roms_tools-2.3.0.dist-info/RECORD,,
|
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
import numpy as np
|
|
2
|
-
import xarray as xr
|
|
3
|
-
from roms_tools.setup.utils import transpose_dimensions
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
def compute_cs(sigma, theta_s, theta_b):
|
|
7
|
-
"""Compute the S-coordinate stretching curves according to Shchepetkin and
|
|
8
|
-
McWilliams (2009).
|
|
9
|
-
|
|
10
|
-
Parameters
|
|
11
|
-
----------
|
|
12
|
-
sigma : np.ndarray or float
|
|
13
|
-
The sigma-coordinate values.
|
|
14
|
-
theta_s : float
|
|
15
|
-
The surface control parameter.
|
|
16
|
-
theta_b : float
|
|
17
|
-
The bottom control parameter.
|
|
18
|
-
|
|
19
|
-
Returns
|
|
20
|
-
-------
|
|
21
|
-
C : np.ndarray or float
|
|
22
|
-
The stretching curve values.
|
|
23
|
-
|
|
24
|
-
Raises
|
|
25
|
-
------
|
|
26
|
-
ValueError
|
|
27
|
-
If theta_s or theta_b are not within the valid range.
|
|
28
|
-
"""
|
|
29
|
-
if not (0 < theta_s <= 10):
|
|
30
|
-
raise ValueError("theta_s must be between 0 and 10.")
|
|
31
|
-
if not (0 < theta_b <= 4):
|
|
32
|
-
raise ValueError("theta_b must be between 0 and 4.")
|
|
33
|
-
|
|
34
|
-
C = (1 - np.cosh(theta_s * sigma)) / (np.cosh(theta_s) - 1)
|
|
35
|
-
C = (np.exp(theta_b * C) - 1) / (1 - np.exp(-theta_b))
|
|
36
|
-
|
|
37
|
-
return C
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
def sigma_stretch(theta_s, theta_b, N, type):
|
|
41
|
-
"""Compute sigma and stretching curves based on the type and parameters.
|
|
42
|
-
|
|
43
|
-
Parameters
|
|
44
|
-
----------
|
|
45
|
-
theta_s : float
|
|
46
|
-
The surface control parameter.
|
|
47
|
-
theta_b : float
|
|
48
|
-
The bottom control parameter.
|
|
49
|
-
N : int
|
|
50
|
-
The number of vertical levels.
|
|
51
|
-
type : str
|
|
52
|
-
The type of sigma ('w' for vertical velocity points, 'r' for rho-points).
|
|
53
|
-
|
|
54
|
-
Returns
|
|
55
|
-
-------
|
|
56
|
-
cs : xr.DataArray
|
|
57
|
-
The stretching curve values.
|
|
58
|
-
sigma : xr.DataArray
|
|
59
|
-
The sigma-coordinate values.
|
|
60
|
-
|
|
61
|
-
Raises
|
|
62
|
-
------
|
|
63
|
-
ValueError
|
|
64
|
-
If the type is not 'w' or 'r'.
|
|
65
|
-
"""
|
|
66
|
-
if type == "w":
|
|
67
|
-
k = xr.DataArray(np.arange(N + 1), dims="s_w")
|
|
68
|
-
sigma = (k - N) / N
|
|
69
|
-
elif type == "r":
|
|
70
|
-
k = xr.DataArray(np.arange(1, N + 1), dims="s_rho")
|
|
71
|
-
sigma = (k - N - 0.5) / N
|
|
72
|
-
else:
|
|
73
|
-
raise ValueError(
|
|
74
|
-
"Type must be either 'w' for vertical velocity points or 'r' for rho-points."
|
|
75
|
-
)
|
|
76
|
-
|
|
77
|
-
cs = compute_cs(sigma, theta_s, theta_b)
|
|
78
|
-
|
|
79
|
-
return cs, sigma
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
def compute_depth(zeta, h, hc, cs, sigma):
|
|
83
|
-
"""Compute the depth at different sigma levels.
|
|
84
|
-
|
|
85
|
-
Parameters
|
|
86
|
-
----------
|
|
87
|
-
zeta : xr.DataArray or scalar
|
|
88
|
-
The sea surface height.
|
|
89
|
-
h : xr.DataArray
|
|
90
|
-
The depth of the sea bottom.
|
|
91
|
-
hc : float
|
|
92
|
-
The critical depth.
|
|
93
|
-
cs : xr.DataArray
|
|
94
|
-
The stretching curve values.
|
|
95
|
-
sigma : xr.DataArray
|
|
96
|
-
The sigma-coordinate values.
|
|
97
|
-
|
|
98
|
-
Returns
|
|
99
|
-
-------
|
|
100
|
-
z : xr.DataArray
|
|
101
|
-
The depth at different sigma levels.
|
|
102
|
-
"""
|
|
103
|
-
|
|
104
|
-
z = (hc * sigma + h * cs) / (hc + h)
|
|
105
|
-
z = zeta + (zeta + h) * z
|
|
106
|
-
|
|
107
|
-
z = -transpose_dimensions(z)
|
|
108
|
-
|
|
109
|
-
return z
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|