eo-tides 0.0.18__py3-none-any.whl → 0.0.19__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.
- eo_tides/model.py +63 -0
- {eo_tides-0.0.18.dist-info → eo_tides-0.0.19.dist-info}/METADATA +1 -1
- eo_tides-0.0.19.dist-info/RECORD +10 -0
- eo_tides-0.0.18.dist-info/RECORD +0 -10
- {eo_tides-0.0.18.dist-info → eo_tides-0.0.19.dist-info}/LICENSE +0 -0
- {eo_tides-0.0.18.dist-info → eo_tides-0.0.19.dist-info}/WHEEL +0 -0
- {eo_tides-0.0.18.dist-info → eo_tides-0.0.19.dist-info}/top_level.txt +0 -0
eo_tides/model.py
CHANGED
@@ -9,11 +9,73 @@ import odc.geo.xr
|
|
9
9
|
import pandas as pd
|
10
10
|
import pyproj
|
11
11
|
import pyTMD
|
12
|
+
from pyTMD.io.model import load_database, model
|
12
13
|
from tqdm import tqdm
|
13
14
|
|
14
15
|
from eo_tides.utils import idw
|
15
16
|
|
16
17
|
|
18
|
+
def available_models(directory=None, show_supported=True):
|
19
|
+
"""
|
20
|
+
Prints a list of all tide models available for tide
|
21
|
+
modelling using `eo-tides`.
|
22
|
+
|
23
|
+
This function scans the specified tide model directory
|
24
|
+
for tide models supported by the `pyTMD` package, and
|
25
|
+
prints a list of models that are available in the
|
26
|
+
directory as well as the full list of supported models.
|
27
|
+
|
28
|
+
For instructions on setting up tide models, see:
|
29
|
+
<https://geoscienceaustralia.github.io/eo-tides/setup/>
|
30
|
+
|
31
|
+
Parameters
|
32
|
+
----------
|
33
|
+
directory : str
|
34
|
+
Path to the directory containing tide model files.
|
35
|
+
|
36
|
+
Returns
|
37
|
+
-------
|
38
|
+
available_m : list
|
39
|
+
A list of all available tide models within
|
40
|
+
`directory`.
|
41
|
+
"""
|
42
|
+
# TODO: Pull directory code into re-usable function
|
43
|
+
|
44
|
+
# Set tide modelling files directory. If no custom path is provided,
|
45
|
+
# first try global environmental var, then "/var/share/tide_models"
|
46
|
+
if directory is None:
|
47
|
+
if "EO_TIDES_TIDE_MODELS" in os.environ:
|
48
|
+
directory = os.environ["EO_TIDES_TIDE_MODELS"]
|
49
|
+
else:
|
50
|
+
directory = "/var/share/tide_models"
|
51
|
+
|
52
|
+
# Verify path exists
|
53
|
+
directory = pathlib.Path(directory).expanduser()
|
54
|
+
if not directory.exists():
|
55
|
+
raise FileNotFoundError("Invalid tide directory")
|
56
|
+
|
57
|
+
# Get full list of supported models from the database
|
58
|
+
supported_models = load_database()["elevation"].keys()
|
59
|
+
|
60
|
+
# Print list of supported models, marking available and
|
61
|
+
# unavailable models and appending available to list
|
62
|
+
print(f"Tide models available in `{directory}`:")
|
63
|
+
available_m = []
|
64
|
+
for m in supported_models:
|
65
|
+
try:
|
66
|
+
model(directory=directory).elevation(m=m)
|
67
|
+
# Mark available models with a green tick
|
68
|
+
print(f" ✅ {m}")
|
69
|
+
available_m.append(m)
|
70
|
+
except:
|
71
|
+
if show_supported:
|
72
|
+
# Mark unavailable models with a red cross
|
73
|
+
print(f" ❌ {m}")
|
74
|
+
|
75
|
+
# Return list of available models
|
76
|
+
return available_m
|
77
|
+
|
78
|
+
|
17
79
|
def _model_tides(
|
18
80
|
model,
|
19
81
|
x,
|
@@ -411,6 +473,7 @@ def model_tides(
|
|
411
473
|
|
412
474
|
This function is parallelised to improve performance, and
|
413
475
|
supports all tidal models supported by `pyTMD`, including:
|
476
|
+
|
414
477
|
- Empirical Ocean Tide model (`EOT20`)
|
415
478
|
- Finite Element Solution tide models (`FES2022`, `FES2014`, `FES2012`)
|
416
479
|
- TOPEX/POSEIDON global tide models (`TPXO10`, `TPXO9`, `TPXO8`)
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: eo-tides
|
3
|
-
Version: 0.0.
|
3
|
+
Version: 0.0.19
|
4
4
|
Summary: Tide modelling tools for large-scale satellite earth observation analysis
|
5
5
|
Author-email: Robbi Bishop-Taylor <Robbi.BishopTaylor@ga.gov.au>
|
6
6
|
Project-URL: Homepage, https://GeoscienceAustralia.github.io/eo-tides/
|
@@ -0,0 +1,10 @@
|
|
1
|
+
eo_tides/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
2
|
+
eo_tides/model.py,sha256=yPUioASD8_Ikm5PDdtK4DzxbzAYLeBw7HZ9v4Ol6MJk,45393
|
3
|
+
eo_tides/stats.py,sha256=Lzo46pWUhox3ZUnMLtyLzqZ9FrCNG6nJ6iS5IpqEsy8,158
|
4
|
+
eo_tides/utils.py,sha256=l9VXJawQzaRBYaFMsP8VBeaN5VA3rFDdzcvF7Rk04Vc,5620
|
5
|
+
eo_tides/validation.py,sha256=kpYGHOeK-YP11c3tHt9l5_8IvOHF1SAJP79PXA7i-Vs,11434
|
6
|
+
eo_tides-0.0.19.dist-info/LICENSE,sha256=NYULqbFuDRV6CysPbkR2WZk863YwwHeftBtnsb4cWf8,1077
|
7
|
+
eo_tides-0.0.19.dist-info/METADATA,sha256=e1Wl1lCXvOvCp0U6smxXzU2nUEs0QtxSUGoYkmxfBV4,5335
|
8
|
+
eo_tides-0.0.19.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
|
9
|
+
eo_tides-0.0.19.dist-info/top_level.txt,sha256=lXZDUUM1DlLdKWHRn8zdmtW8Rx-eQOIWVvt0b8VGiyQ,9
|
10
|
+
eo_tides-0.0.19.dist-info/RECORD,,
|
eo_tides-0.0.18.dist-info/RECORD
DELETED
@@ -1,10 +0,0 @@
|
|
1
|
-
eo_tides/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
2
|
-
eo_tides/model.py,sha256=5teDNCgtqRyp0vJHhXMdPtZYdaKzXcAo-a9Cum46Jgg,43305
|
3
|
-
eo_tides/stats.py,sha256=Lzo46pWUhox3ZUnMLtyLzqZ9FrCNG6nJ6iS5IpqEsy8,158
|
4
|
-
eo_tides/utils.py,sha256=l9VXJawQzaRBYaFMsP8VBeaN5VA3rFDdzcvF7Rk04Vc,5620
|
5
|
-
eo_tides/validation.py,sha256=kpYGHOeK-YP11c3tHt9l5_8IvOHF1SAJP79PXA7i-Vs,11434
|
6
|
-
eo_tides-0.0.18.dist-info/LICENSE,sha256=NYULqbFuDRV6CysPbkR2WZk863YwwHeftBtnsb4cWf8,1077
|
7
|
-
eo_tides-0.0.18.dist-info/METADATA,sha256=WLxfpg2EhN7Ly9GbNhLLFJVa2LiuO3NHckIcmjY2pqE,5335
|
8
|
-
eo_tides-0.0.18.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
|
9
|
-
eo_tides-0.0.18.dist-info/top_level.txt,sha256=lXZDUUM1DlLdKWHRn8zdmtW8Rx-eQOIWVvt0b8VGiyQ,9
|
10
|
-
eo_tides-0.0.18.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|