tctrack 0.2__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.
- tctrack/__init__.py +5 -0
- tctrack/core/__init__.py +19 -0
- tctrack/core/tracker.py +530 -0
- tctrack/core/trajectory.py +228 -0
- tctrack/tempest_extremes/__init__.py +19 -0
- tctrack/tempest_extremes/tempest_extremes.py +1144 -0
- tctrack/track/__init__.py +11 -0
- tctrack/track/track.py +778 -0
- tctrack/tstorms/__init__.py +15 -0
- tctrack/tstorms/tstorms.py +1075 -0
- tctrack/utils/__init__.py +7 -0
- tctrack/utils/utils.py +29 -0
- tctrack-0.2.dist-info/METADATA +155 -0
- tctrack-0.2.dist-info/RECORD +17 -0
- tctrack-0.2.dist-info/WHEEL +5 -0
- tctrack-0.2.dist-info/licenses/LICENSE +674 -0
- tctrack-0.2.dist-info/top_level.txt +1 -0
tctrack/utils/utils.py
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"""Module providing utility functions for working with netcdf files."""
|
|
2
|
+
|
|
3
|
+
from netCDF4 import Dataset
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
def lat_lon_sizes(filename: str, lat: str = "lat", lon: str = "lon") -> tuple[int, int]:
|
|
7
|
+
"""Get the sizes of the longitude and latitude for a netcdf file.
|
|
8
|
+
|
|
9
|
+
Parameters
|
|
10
|
+
----------
|
|
11
|
+
filename : str
|
|
12
|
+
The path to the netcdf file to read from.
|
|
13
|
+
lat : str, default="lat"
|
|
14
|
+
The netcdf variable name of the latitude.
|
|
15
|
+
lon : str, default="lon"
|
|
16
|
+
The netcdf variable name of the longitude.
|
|
17
|
+
|
|
18
|
+
Returns
|
|
19
|
+
-------
|
|
20
|
+
int
|
|
21
|
+
The size of the latitude dimension.
|
|
22
|
+
int
|
|
23
|
+
The size of the longitude dimension.
|
|
24
|
+
"""
|
|
25
|
+
dataset = Dataset(filename, "r")
|
|
26
|
+
lon_size = len(dataset.dimensions[lon])
|
|
27
|
+
lat_size = len(dataset.dimensions[lat])
|
|
28
|
+
dataset.close()
|
|
29
|
+
return lat_size, lon_size
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: tctrack
|
|
3
|
+
Version: 0.2
|
|
4
|
+
Summary: A Python package for generating tropical cyclone tracks.
|
|
5
|
+
Author-email: Jack Atkinson <jwa34@cam.ac.uk>, Sam Avis <sa2329@cam.ac.uk>
|
|
6
|
+
License-Expression: GPL-3.0-or-later
|
|
7
|
+
Project-URL: Homepage, https://github.com/Cambridge-ICCS/TCTrack
|
|
8
|
+
Project-URL: Repository, https://github.com/Cambridge-ICCS/TCTrack
|
|
9
|
+
Project-URL: Issues, https://github.com/Cambridge-ICCS/TCTrack/issues
|
|
10
|
+
Keywords: meteorology,weather,tropical cyclone,tracking
|
|
11
|
+
Classifier: Development Status :: 4 - Beta
|
|
12
|
+
Classifier: Natural Language :: English
|
|
13
|
+
Classifier: Programming Language :: Python
|
|
14
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
20
|
+
Classifier: Typing :: Typed
|
|
21
|
+
Classifier: Operating System :: Unix
|
|
22
|
+
Classifier: Topic :: Scientific/Engineering
|
|
23
|
+
Classifier: Topic :: Scientific/Engineering :: Atmospheric Science
|
|
24
|
+
Classifier: Intended Audience :: Science/Research
|
|
25
|
+
Requires-Python: >=3.10
|
|
26
|
+
Description-Content-Type: text/markdown
|
|
27
|
+
License-File: LICENSE
|
|
28
|
+
Requires-Dist: h5py>=3.16.0
|
|
29
|
+
Requires-Dist: cf-python>=3.19.0; python_version > "3.10"
|
|
30
|
+
Requires-Dist: cf-python<3.19.0; python_version <= "3.10"
|
|
31
|
+
Requires-Dist: cftime
|
|
32
|
+
Provides-Extra: test
|
|
33
|
+
Requires-Dist: pytest; extra == "test"
|
|
34
|
+
Requires-Dist: pytest-mock; extra == "test"
|
|
35
|
+
Provides-Extra: lint
|
|
36
|
+
Requires-Dist: ruff; extra == "lint"
|
|
37
|
+
Requires-Dist: blackdoc<=0.4.2; extra == "lint"
|
|
38
|
+
Requires-Dist: black<=25.1.0; extra == "lint"
|
|
39
|
+
Requires-Dist: mypy; extra == "lint"
|
|
40
|
+
Requires-Dist: pytest; extra == "lint"
|
|
41
|
+
Provides-Extra: doc
|
|
42
|
+
Requires-Dist: sphinx<8.2.0; extra == "doc"
|
|
43
|
+
Requires-Dist: sphinx_rtd_theme; extra == "doc"
|
|
44
|
+
Requires-Dist: sphinx_autodoc_typehints; extra == "doc"
|
|
45
|
+
Requires-Dist: blackdoc<=0.4.2; extra == "doc"
|
|
46
|
+
Requires-Dist: black<=25.1.0; extra == "doc"
|
|
47
|
+
Provides-Extra: dev
|
|
48
|
+
Requires-Dist: tctrack[doc,lint,test]; extra == "dev"
|
|
49
|
+
Dynamic: license-file
|
|
50
|
+
|
|
51
|
+
<div align="center">
|
|
52
|
+
<img src="https://raw.githubusercontent.com/Cambridge-ICCS/TCTrack/main/docs/images/TCTrack_Logo.svg" alt="TCTrack Logo">
|
|
53
|
+
</div>
|
|
54
|
+
|
|
55
|
+
# TCTrack
|
|
56
|
+
|
|
57
|
+

|
|
58
|
+

|
|
59
|
+
[](https://tctrack.readthedocs.io/en/latest/?badge=latest)
|
|
60
|
+
[](https://github.com/astral-sh/ruff)
|
|
61
|
+
[](https://www.python.org/downloads/)
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
TCTrack is a Python library providing bindings to tracking algorithms for tropical
|
|
65
|
+
cyclones in an accessible manner to generate high-quality and
|
|
66
|
+
[FAIR](https://en.wikipedia.org/wiki/FAIR_data) output data.
|
|
67
|
+
|
|
68
|
+
It can be used for tracking cyclones in simulations and observations, and to compare
|
|
69
|
+
the output of different algorithms for a variety of data sources.
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
## Installation
|
|
73
|
+
|
|
74
|
+
### Dependencies
|
|
75
|
+
The package requires Python 3 (>=3.10).
|
|
76
|
+
|
|
77
|
+
### Package Installation
|
|
78
|
+
We recommend using a Conda virtual environment for TCTrack in order to simplify the
|
|
79
|
+
installation of dependencies (cf-python, esmpy/ESMF, UDUNITS).
|
|
80
|
+
```sh
|
|
81
|
+
conda create -n tctrack-env -c conda-forge cf-python cf-plot udunits2 esmpy
|
|
82
|
+
conda activate tctrack-env
|
|
83
|
+
```
|
|
84
|
+
When finished using TCTrack this can be turned off with `conda deactivate`.
|
|
85
|
+
|
|
86
|
+
TCTrack can then be installed using `pip`:
|
|
87
|
+
```sh
|
|
88
|
+
pip install tctrack
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
See the
|
|
92
|
+
[documentation](https://tctrack.readthedocs.io/en/latest/getting-started/index.html#installation).
|
|
93
|
+
for futher details about installation and dependencies, including how to install the
|
|
94
|
+
individual tracking algorithms.
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
## Using TCTrack
|
|
98
|
+
|
|
99
|
+
Details of how to use TCTrack can be found in the
|
|
100
|
+
[getting-started documentation online](https://tctrack.readthedocs.io/en/latest/getting-started/index.html).
|
|
101
|
+
|
|
102
|
+
New users may wish to follow the [TCTrack tutorial](https://tctrack.readthedocs.io/en/latest/getting-started/tutorial.html)
|
|
103
|
+
using the scripts in the [`tutorial/`](https://github.com/Cambridge-ICCS/TCTrack/tree/main/tutorial)
|
|
104
|
+
directory.
|
|
105
|
+
|
|
106
|
+
For a complete description of the library API see
|
|
107
|
+
[API documentation](https://tctrack.readthedocs.io/en/latest/api/index.html).
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
## Contributing
|
|
111
|
+
|
|
112
|
+
Contributions and collaborations are welcome.
|
|
113
|
+
|
|
114
|
+
For bugs, feature requests, and clear suggestions for improvement please
|
|
115
|
+
[open an issue](https://github.com/Cambridge-ICCS/TCTrack/issues).
|
|
116
|
+
|
|
117
|
+
If you have added something to _TCTrack_ that would be useful to others, or can
|
|
118
|
+
address an [open issue](https://github.com/Cambridge-ICCS/TCTrack/issues), please
|
|
119
|
+
[fork the repository](https://github.com/Cambridge-ICCS/TCTrack/fork) and open a
|
|
120
|
+
pull request.
|
|
121
|
+
|
|
122
|
+
Additional dependencies for deleopment can be installed as follows:
|
|
123
|
+
```sh
|
|
124
|
+
pip install --editable .[dev]
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
Full details for contribution and developers can be found in the
|
|
128
|
+
[online documentation](https://tctrack.readthedocs.io/en/latest/developer/index.html).
|
|
129
|
+
|
|
130
|
+
### Code of Conduct
|
|
131
|
+
|
|
132
|
+
Everyone participating in the _TCTrack_ project, and in particular in the
|
|
133
|
+
issue tracker, pull requests, and social media activity, is expected to treat other
|
|
134
|
+
people with respect and, more generally, to follow the guidelines articulated in the
|
|
135
|
+
[Python Community Code of Conduct](https://www.python.org/psf/codeofconduct/).
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
## License
|
|
139
|
+
|
|
140
|
+
Copyright © ICCS
|
|
141
|
+
|
|
142
|
+
*TCTrack* is distributed under the [GPL 3](https://github.com/Cambridge-ICCS/TCTrack/blob/main/LICENSE).
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
## Acknowledgments
|
|
146
|
+
|
|
147
|
+
This work was funded by a philantropic donation to the
|
|
148
|
+
[University of Cambridge](https://www.cam.ac.uk/) from
|
|
149
|
+
[INIGO Insurance](https://inigoinsurance.com/) as part of the InSPIRe project.
|
|
150
|
+
|
|
151
|
+
<p align="left">
|
|
152
|
+
<img src="https://raw.githubusercontent.com/Cambridge-ICCS/TCTrack/main/docs/images/inigo_inspire.png" width="355">
|
|
153
|
+
</p>
|
|
154
|
+
|
|
155
|
+
The TCTrack logo was designed by [Jack Atkinson](https://jackatkinson.net/) - [@jatkinson1000](https://github.com/jatkinson1000).
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
tctrack/__init__.py,sha256=Ro1bP23lJz_5WGR6fBLltm4aKkqb46ilSmjehiKKzdM,181
|
|
2
|
+
tctrack/core/__init__.py,sha256=z7LnqCoQjDGJEdFW8yNAmMSXHZPYP1FwbKRQa8Wp2zo,355
|
|
3
|
+
tctrack/core/tracker.py,sha256=MyHqEMa497Grxgd4UhR7noOPCWpzf1CzAwY0jqO7_gk,19970
|
|
4
|
+
tctrack/core/trajectory.py,sha256=-kBBM1u_FB9nuhYpFcuWRbkuyi9-eFJmaAh4pjYQhwQ,8262
|
|
5
|
+
tctrack/tempest_extremes/__init__.py,sha256=3moOpnj-oiZt03WvUCcIv_Rykgl0oLHuH_266IF3qH4,356
|
|
6
|
+
tctrack/tempest_extremes/tempest_extremes.py,sha256=GbDhYvDWh_-Z8AJspa_OXm2CM3lNS4jKEoVion3xrq4,42162
|
|
7
|
+
tctrack/track/__init__.py,sha256=s1xJUuMWsmrb4gilSXT4JVGm48ZZuDusXul8WdJUZ8E,172
|
|
8
|
+
tctrack/track/track.py,sha256=Ek1-r1sMMVF2UBFIiUM1iQYwXfmg2vH50O8j7ELFyAM,31646
|
|
9
|
+
tctrack/tstorms/__init__.py,sha256=KCvShuczspOe2GYRJleu5_5ykhdB1kFlqYLgtaMDyzc,312
|
|
10
|
+
tctrack/tstorms/tstorms.py,sha256=GqS-QjlnfyTrow8VaEI4s9xRWECtsMLQ1Fk_-xkzyU0,40436
|
|
11
|
+
tctrack/utils/__init__.py,sha256=npEC0e8w1j7JkJzFF4Nkgn7wlayZMvRg7Xsr0mcZ3bE,137
|
|
12
|
+
tctrack/utils/utils.py,sha256=UgN3QlFt4bpjtohAIfcQfFwhbJlV1_17xS3we65VO0s,834
|
|
13
|
+
tctrack-0.2.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
|
14
|
+
tctrack-0.2.dist-info/METADATA,sha256=kR_tgeNFVsOYLMHFcNgAy4CPgtq9E5Bl7P6F8m_3GTk,6223
|
|
15
|
+
tctrack-0.2.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
|
|
16
|
+
tctrack-0.2.dist-info/top_level.txt,sha256=cgvZBGu65jSlZVJhMKyvs6QTgCTfMTlcXFQJ474XEro,8
|
|
17
|
+
tctrack-0.2.dist-info/RECORD,,
|