tfv-get-tools 0.2.3__tar.gz → 0.2.5__tar.gz

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.
Files changed (75) hide show
  1. {tfv_get_tools-0.2.3/src/tfv_get_tools.egg-info → tfv_get_tools-0.2.5}/PKG-INFO +57 -43
  2. {tfv_get_tools-0.2.3 → tfv_get_tools-0.2.5}/README.md +54 -40
  3. {tfv_get_tools-0.2.3 → tfv_get_tools-0.2.5}/pyproject.toml +2 -4
  4. {tfv_get_tools-0.2.3 → tfv_get_tools-0.2.5}/src/tfv_get_tools/_standard_attrs.py +2 -2
  5. {tfv_get_tools-0.2.3 → tfv_get_tools-0.2.5}/src/tfv_get_tools/cli/_cli_base.py +15 -3
  6. {tfv_get_tools-0.2.3 → tfv_get_tools-0.2.5}/src/tfv_get_tools/cli/atmos_cli.py +13 -13
  7. {tfv_get_tools-0.2.3 → tfv_get_tools-0.2.5}/src/tfv_get_tools/cli/ocean_cli.py +7 -11
  8. {tfv_get_tools-0.2.3 → tfv_get_tools-0.2.5}/src/tfv_get_tools/cli/tide_cli.py +8 -3
  9. {tfv_get_tools-0.2.3 → tfv_get_tools-0.2.5}/src/tfv_get_tools/fvc/_atmos.py +17 -4
  10. {tfv_get_tools-0.2.3 → tfv_get_tools-0.2.5}/src/tfv_get_tools/providers/atmos/barra2.py +1 -1
  11. {tfv_get_tools-0.2.3 → tfv_get_tools-0.2.5}/src/tfv_get_tools/providers/atmos/cfsr.py +1 -1
  12. {tfv_get_tools-0.2.3 → tfv_get_tools-0.2.5}/src/tfv_get_tools/providers/ocean/hycom.py +25 -2
  13. {tfv_get_tools-0.2.3 → tfv_get_tools-0.2.5}/src/tfv_get_tools/providers/wave/era5.py +1 -1
  14. {tfv_get_tools-0.2.3 → tfv_get_tools-0.2.5}/src/tfv_get_tools/tide/_tidal_base.py +194 -42
  15. {tfv_get_tools-0.2.3 → tfv_get_tools-0.2.5}/src/tfv_get_tools/utilities/horizontal_padding.py +14 -3
  16. {tfv_get_tools-0.2.3 → tfv_get_tools-0.2.5/src/tfv_get_tools.egg-info}/PKG-INFO +57 -43
  17. {tfv_get_tools-0.2.3 → tfv_get_tools-0.2.5}/src/tfv_get_tools.egg-info/requires.txt +1 -1
  18. {tfv_get_tools-0.2.3 → tfv_get_tools-0.2.5}/tests/test_cli_get_atmos.py +2 -0
  19. {tfv_get_tools-0.2.3 → tfv_get_tools-0.2.5}/tests/test_tide_extraction.py +29 -14
  20. {tfv_get_tools-0.2.3 → tfv_get_tools-0.2.5}/LICENSE +0 -0
  21. {tfv_get_tools-0.2.3 → tfv_get_tools-0.2.5}/setup.cfg +0 -0
  22. {tfv_get_tools-0.2.3 → tfv_get_tools-0.2.5}/src/tfv_get_tools/__init__.py +0 -0
  23. {tfv_get_tools-0.2.3 → tfv_get_tools-0.2.5}/src/tfv_get_tools/atmos.py +0 -0
  24. {tfv_get_tools-0.2.3 → tfv_get_tools-0.2.5}/src/tfv_get_tools/cli/wave_cli.py +0 -0
  25. {tfv_get_tools-0.2.3 → tfv_get_tools-0.2.5}/src/tfv_get_tools/fvc/__init__.py +0 -0
  26. {tfv_get_tools-0.2.3 → tfv_get_tools-0.2.5}/src/tfv_get_tools/fvc/_fvc.py +0 -0
  27. {tfv_get_tools-0.2.3 → tfv_get_tools-0.2.5}/src/tfv_get_tools/fvc/_ocean.py +0 -0
  28. {tfv_get_tools-0.2.3 → tfv_get_tools-0.2.5}/src/tfv_get_tools/fvc/_tide.py +0 -0
  29. {tfv_get_tools-0.2.3 → tfv_get_tools-0.2.5}/src/tfv_get_tools/ocean.py +0 -0
  30. {tfv_get_tools-0.2.3 → tfv_get_tools-0.2.5}/src/tfv_get_tools/providers/__init__.py +0 -0
  31. {tfv_get_tools-0.2.3 → tfv_get_tools-0.2.5}/src/tfv_get_tools/providers/_custom_conversions.py +0 -0
  32. {tfv_get_tools-0.2.3 → tfv_get_tools-0.2.5}/src/tfv_get_tools/providers/_downloader.py +0 -0
  33. {tfv_get_tools-0.2.3 → tfv_get_tools-0.2.5}/src/tfv_get_tools/providers/_merger.py +0 -0
  34. {tfv_get_tools-0.2.3 → tfv_get_tools-0.2.5}/src/tfv_get_tools/providers/_utilities.py +0 -0
  35. {tfv_get_tools-0.2.3 → tfv_get_tools-0.2.5}/src/tfv_get_tools/providers/atmos/cfgs/barra2_c2.yaml +0 -0
  36. {tfv_get_tools-0.2.3 → tfv_get_tools-0.2.5}/src/tfv_get_tools/providers/atmos/cfgs/barra2_r2.yaml +0 -0
  37. {tfv_get_tools-0.2.3 → tfv_get_tools-0.2.5}/src/tfv_get_tools/providers/atmos/cfgs/barra2_re2.yaml +0 -0
  38. {tfv_get_tools-0.2.3 → tfv_get_tools-0.2.5}/src/tfv_get_tools/providers/atmos/cfgs/cfsr.yaml +0 -0
  39. {tfv_get_tools-0.2.3 → tfv_get_tools-0.2.5}/src/tfv_get_tools/providers/atmos/cfgs/era5.yaml +0 -0
  40. {tfv_get_tools-0.2.3 → tfv_get_tools-0.2.5}/src/tfv_get_tools/providers/atmos/cfgs/era5_gcp.yaml +0 -0
  41. {tfv_get_tools-0.2.3 → tfv_get_tools-0.2.5}/src/tfv_get_tools/providers/atmos/era5.py +0 -0
  42. {tfv_get_tools-0.2.3 → tfv_get_tools-0.2.5}/src/tfv_get_tools/providers/atmos/era5_gcp.py +0 -0
  43. {tfv_get_tools-0.2.3 → tfv_get_tools-0.2.5}/src/tfv_get_tools/providers/ocean/cfgs/copernicus_blk.yaml +0 -0
  44. {tfv_get_tools-0.2.3 → tfv_get_tools-0.2.5}/src/tfv_get_tools/providers/ocean/cfgs/copernicus_glo.yaml +0 -0
  45. {tfv_get_tools-0.2.3 → tfv_get_tools-0.2.5}/src/tfv_get_tools/providers/ocean/cfgs/copernicus_nws.yaml +0 -0
  46. {tfv_get_tools-0.2.3 → tfv_get_tools-0.2.5}/src/tfv_get_tools/providers/ocean/cfgs/hycom.yaml +0 -0
  47. {tfv_get_tools-0.2.3 → tfv_get_tools-0.2.5}/src/tfv_get_tools/providers/ocean/copernicus_ocean.py +0 -0
  48. {tfv_get_tools-0.2.3 → tfv_get_tools-0.2.5}/src/tfv_get_tools/providers/wave/cawcr.py +0 -0
  49. {tfv_get_tools-0.2.3 → tfv_get_tools-0.2.5}/src/tfv_get_tools/providers/wave/cfgs/cawcr_aus_10m.yaml +0 -0
  50. {tfv_get_tools-0.2.3 → tfv_get_tools-0.2.5}/src/tfv_get_tools/providers/wave/cfgs/cawcr_aus_4m.yaml +0 -0
  51. {tfv_get_tools-0.2.3 → tfv_get_tools-0.2.5}/src/tfv_get_tools/providers/wave/cfgs/cawcr_glob_24m.yaml +0 -0
  52. {tfv_get_tools-0.2.3 → tfv_get_tools-0.2.5}/src/tfv_get_tools/providers/wave/cfgs/cawcr_pac_10m.yaml +0 -0
  53. {tfv_get_tools-0.2.3 → tfv_get_tools-0.2.5}/src/tfv_get_tools/providers/wave/cfgs/cawcr_pac_4m.yaml +0 -0
  54. {tfv_get_tools-0.2.3 → tfv_get_tools-0.2.5}/src/tfv_get_tools/providers/wave/cfgs/copernicus_glo.yaml +0 -0
  55. {tfv_get_tools-0.2.3 → tfv_get_tools-0.2.5}/src/tfv_get_tools/providers/wave/cfgs/copernicus_nws.yaml +0 -0
  56. {tfv_get_tools-0.2.3 → tfv_get_tools-0.2.5}/src/tfv_get_tools/providers/wave/cfgs/era5.yaml +0 -0
  57. {tfv_get_tools-0.2.3 → tfv_get_tools-0.2.5}/src/tfv_get_tools/providers/wave/cfgs/era5_gcp.yaml +0 -0
  58. {tfv_get_tools-0.2.3 → tfv_get_tools-0.2.5}/src/tfv_get_tools/providers/wave/copernicus_wave.py +0 -0
  59. {tfv_get_tools-0.2.3 → tfv_get_tools-0.2.5}/src/tfv_get_tools/providers/wave/era5_gcp.py +0 -0
  60. {tfv_get_tools-0.2.3 → tfv_get_tools-0.2.5}/src/tfv_get_tools/tide/__init__.py +0 -0
  61. {tfv_get_tools-0.2.3 → tfv_get_tools-0.2.5}/src/tfv_get_tools/tide/_nodestring.py +0 -0
  62. {tfv_get_tools-0.2.3 → tfv_get_tools-0.2.5}/src/tfv_get_tools/utilities/_tfv_bc.py +0 -0
  63. {tfv_get_tools-0.2.3 → tfv_get_tools-0.2.5}/src/tfv_get_tools/utilities/land_masking.py +0 -0
  64. {tfv_get_tools-0.2.3 → tfv_get_tools-0.2.5}/src/tfv_get_tools/utilities/parsers.py +0 -0
  65. {tfv_get_tools-0.2.3 → tfv_get_tools-0.2.5}/src/tfv_get_tools/utilities/warnings.py +0 -0
  66. {tfv_get_tools-0.2.3 → tfv_get_tools-0.2.5}/src/tfv_get_tools/wave.py +0 -0
  67. {tfv_get_tools-0.2.3 → tfv_get_tools-0.2.5}/src/tfv_get_tools.egg-info/SOURCES.txt +0 -0
  68. {tfv_get_tools-0.2.3 → tfv_get_tools-0.2.5}/src/tfv_get_tools.egg-info/dependency_links.txt +0 -0
  69. {tfv_get_tools-0.2.3 → tfv_get_tools-0.2.5}/src/tfv_get_tools.egg-info/entry_points.txt +0 -0
  70. {tfv_get_tools-0.2.3 → tfv_get_tools-0.2.5}/src/tfv_get_tools.egg-info/top_level.txt +0 -0
  71. {tfv_get_tools-0.2.3 → tfv_get_tools-0.2.5}/tests/test_all_downloaders.py +0 -0
  72. {tfv_get_tools-0.2.3 → tfv_get_tools-0.2.5}/tests/test_downloader.py +0 -0
  73. {tfv_get_tools-0.2.3 → tfv_get_tools-0.2.5}/tests/test_era5_merger.py +0 -0
  74. {tfv_get_tools-0.2.3 → tfv_get_tools-0.2.5}/tests/test_frontend_python_api.py +0 -0
  75. {tfv_get_tools-0.2.3 → tfv_get_tools-0.2.5}/tests/test_mergers.py +0 -0
@@ -1,8 +1,8 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: tfv_get_tools
3
- Version: 0.2.3
3
+ Version: 0.2.5
4
4
  Summary: Tool for downloading and processing data for TUFLOW FV modelling
5
- Author-email: Alex Waterhouse <alex.waterhouse@apac.bmt.org>, Mitchell Smith <mitchell.smith@apac.bmt.org>, TUFLOW Support <support@tuflow.com>
5
+ Author-email: TUFLOW Support <support@tuflow.com>
6
6
  License: MIT
7
7
  Project-URL: Homepage, https://gitlab.com/tuflow-user-group/tuflow-fv/data-pre-processing/tfv-get-tools
8
8
  Project-URL: Repository, https://gitlab.com/tuflow-user-group/tuflow-fv/data-pre-processing/tfv-get-tools
@@ -28,7 +28,7 @@ Requires-Dist: siphon>=0.9
28
28
  Requires-Dist: cdsapi>=0.7.0
29
29
  Requires-Dist: copernicusmarine>=1.2.3
30
30
  Requires-Dist: bottleneck>=1.3.5
31
- Requires-Dist: pyTMD>=2.1.5
31
+ Requires-Dist: pyTMD<3,>=2.1.7
32
32
  Requires-Dist: shapely>=2.0.6
33
33
  Requires-Dist: geopandas>=1.0.1
34
34
  Provides-Extra: dev
@@ -104,29 +104,30 @@ The package provides command-line tools for downloading and processing data:
104
104
 
105
105
  **Ocean Data Example:**
106
106
  ```bash
107
- # Download HYCOM data for January 2011 in southeast Queensland
108
- GetOcean A 2011-01-01 2011-02-01 153 156 -29 -24
107
+ # Download HYCOM data for January 2011 on the east coast of Australia
108
+ GetOcean A 2011-01-01 2011-02-01 153 154 -29 -28
109
109
 
110
- # Download with custom options (top 20m, 3-hourly data, custom prefix)
111
- GetOcean A -p raw_data -pf SEQ_HYCOM -ts 3 -z 0 20 2011-01-01 2011-02-01 153 156 -29 -24
110
+ # Download with options (output directory path (-p), custom filename prefix (-pf) 3-hourly data (-ts), top 20 m (-z))
111
+ GetOcean A -p raw_data -pf studysite -ts 3 -z 0 20 2011-01-01 2011-02-01 153 154 -29 -28
112
112
 
113
- # Merge downloaded files
114
- GetOcean B -i raw_data -o output -rp 28350 -tz 8 -ltz AWST -n merged_hycom.nc
113
+ # Merge downloaded files with options (input directory (-i), output directory (-o), timezone conversion (-tz), timezone attribute metadata (-ltz) and custom filename (-f))
114
+ GetOcean B -i raw_data -o output -tz 10 -ltz AEST -f merged_hycom.nc
115
115
  ```
116
116
 
117
117
  **Atmospheric Data Example:**
118
118
  ```bash
119
- # Download ERA5 atmospheric data
120
- GetAtmos A 2011-01-01 2011-02-01 152 154 -28 -26
119
+ # Download ERA5 atmospheric data with options (output directory path (-p))
120
+ GetAtmos A -p raw_data 2010-03-01 2010-04-01 153 154 -29 -28
121
121
 
122
- # Merge with reprojection and timezone conversion
123
- GetAtmos B -i raw_data -o output -rp 7856 -tz 10 -ltz AEST
122
+ # Merge downloaded files with options (input directory (-i), output directory (-o), reprojected to EPSG:28356 (-rp), timezone conversion (-tz) and timezone attribute metadata (-ltz))
123
+ GetAtmos B -i raw_data -o output -rp 28356 -tz 10 -ltz AEST
124
124
  ```
125
125
 
126
126
  **Tidal Data Example:**
127
127
  ```bash
128
- # Extract tidal data using a boundary nodestring shapefile
129
- GetTide output/tide_data.nc 2011-01-01 2012-01-01 boundaries/nodestring.shp path/to/fes2022/
128
+ # Extract tidal data from FES2022 extrapolated ocean tide using a boundary nodestring shapefile
129
+ GetTide output/tide_data.nc 2010-03-01 2010-04-01 nodestrings/2d_ns_Open_Boundary_001_L.shp -s FES2022_extrapolated fes2022b/ocean_tide_extrapolated
130
+ # Get Tide supports multiple FES tide models and each requires a specific directory structure. Refer to the wiki: (https://fvwiki.tuflow.com/TUFLOW_FV_Get_Tide_draft#Mandatory_FES_Folder_Structure)
130
131
  ```
131
132
 
132
133
  ### Python API
@@ -139,20 +140,20 @@ from tfv_get_tools import DownloadOcean, MergeOcean
139
140
  result = DownloadOcean(
140
141
  start_date='2011-01-01',
141
142
  end_date='2011-02-01',
142
- xlims=(153, 156),
143
- ylims=(-29, -24),
143
+ xlims=(153, 154),
144
+ ylims=(-29, -28),
144
145
  out_path='./raw_data',
145
146
  source='HYCOM',
146
147
  time_interval=24
147
148
  )
148
149
 
149
- # Merge downloaded files
150
+ # Merge downloaded files and shift time +10h with timezone attribute set to 'AEST'
150
151
  MergeOcean(
151
152
  in_path='./raw_data',
152
153
  out_path='./output',
153
- source='HYCOM',
154
- reproject=28350,
155
- local_tz=(8, 'AWST')
154
+ source='HYCOM',
155
+ local_tz=(10, 'AEST'),
156
+ fname= 'HYCOM_20110101_20110201_AEST.nc',
156
157
  )
157
158
  ```
158
159
 
@@ -162,21 +163,22 @@ from tfv_get_tools import DownloadAtmos, MergeAtmos
162
163
 
163
164
  # Download BARRA2 data
164
165
  result = DownloadAtmos(
165
- start_date='2020-01-01',
166
- end_date='2020-02-01',
167
- xlims=(152.72, 153.78),
168
- ylims=(-27.49, -25.39),
166
+ start_date='2022-12-01',
167
+ end_date='2023-01-01',
168
+ xlims=(153, 154),
169
+ ylims=(-29, -28),
169
170
  out_path='./raw_data',
170
171
  source='BARRA2',
171
172
  model='C2'
172
173
  )
173
174
 
174
- # Merge with reprojection to GDA2020 MGA56
175
+ # Merge downloaded files, reproject to GDA2020 MGA56, and shift time +10h with timezone attribute set to 'AEST'
175
176
  MergeAtmos(
176
177
  in_path='./raw_data',
177
178
  out_path='./output',
179
+ fname= 'BARRA2_C2_20221201_20230101_EPSG7856_AEST.nc',
178
180
  source='BARRA2',
179
- model='C2',
181
+ model='C2',
180
182
  reproject=7856,
181
183
  local_tz=(10.0, 'AEST')
182
184
  )
@@ -187,38 +189,50 @@ MergeAtmos(
187
189
  from pathlib import Path
188
190
  from tfv_get_tools.tide import ExtractTide
189
191
 
192
+ # User input
193
+ t_start = '2023-01-01'
194
+ t_end = '2023-02-01'
195
+ fes_dir = './fes2022b/ocean_tide_extrapolated' # Get Tide supports multiple FES tide models and each requires a specific directory structure. Refer to the wiki: (https://fvwiki.tuflow.com/TUFLOW_FV_Get_Tide_draft#Mandatory_FES_Folder_Structure)
196
+ output_dir = './output'
197
+ shp_file = './2d_ns_Open_Boundary_001_L.shp'
198
+ output_name = 'GOC_FES2022_extrapolated_20230101_20230125.nc'
199
+ model = 'FES2022_extrapolated'
200
+
190
201
  # Basic tidal extraction
191
202
  ExtractTide(
192
- start_date='2011-01-01',
193
- end_date='2012-01-01',
194
- filename='tide_data.nc',
195
- out_path='./output',
203
+ time_start=t_start,
204
+ time_end=t_end,
205
+ model_dir=fes_dir,
206
+ source=model,
207
+ fname=output_name,
208
+ out_path=output_dir,
196
209
  freq='15min',
197
- shapefile='boundaries/nodestring.shv'
210
+ shapefile=shp_file,
198
211
  )
199
212
 
200
213
  # Advanced usage with constituent caching
201
214
  from tfv_get_tools.tide import load_nodestring_shapefile, process_nodestring_gdf, get_constituents
202
215
 
203
216
  # Load and process boundary shapefile
204
- gdf = load_nodestring_shapefile('boundaries/nodestring.shp', process_ids=[1])
205
- coordinates = process_nodestring_gdf(gdf, spacing=5000)
217
+ gdf = load_nodestring_shapefile(shp_file)
218
+ coordinates = process_nodestring_gdf(gdf, spacing=2500)
206
219
 
207
220
  # Extract constituents once (slow first time, fast afterwards)
208
221
  constituents = get_constituents(
209
222
  coordinates,
210
- source='FES2022',
211
- save_cons='boundary_constituents.pkl'
223
+ model_dir=fes_dir,
224
+ source=model,
225
+ save_cons='boundary_constituents.pkl',
212
226
  )
213
227
 
214
228
  # Use cached constituents for faster extraction
215
229
  ExtractTide(
216
- start_date='2011-01-01',
217
- end_date='2012-01-01',
218
- filename='tide_data.nc',
219
- out_path='./output',
230
+ time_start=t_start,
231
+ time_end=t_end,
232
+ fname=output_name,
233
+ out_path=output_dir,
220
234
  freq='15min',
221
- constituents='boundary_constituents.pkl'
235
+ constituents='boundary_constituents.pkl',
222
236
  )
223
237
  ```
224
238
 
@@ -276,7 +290,7 @@ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file
276
290
 
277
291
  ## Authors
278
292
 
279
- Developed by [TUFLOW](https://www.tuflow.com/), 2025
293
+ Developed by [TUFLOW](https://www.tuflow.com/), 2026
280
294
 
281
295
  ## Project Status
282
296
 
@@ -284,4 +298,4 @@ Developed by [TUFLOW](https://www.tuflow.com/), 2025
284
298
 
285
299
  ---
286
300
 
287
- *Last updated: July 2025*
301
+ *Last updated: January 2026*
@@ -58,29 +58,30 @@ The package provides command-line tools for downloading and processing data:
58
58
 
59
59
  **Ocean Data Example:**
60
60
  ```bash
61
- # Download HYCOM data for January 2011 in southeast Queensland
62
- GetOcean A 2011-01-01 2011-02-01 153 156 -29 -24
61
+ # Download HYCOM data for January 2011 on the east coast of Australia
62
+ GetOcean A 2011-01-01 2011-02-01 153 154 -29 -28
63
63
 
64
- # Download with custom options (top 20m, 3-hourly data, custom prefix)
65
- GetOcean A -p raw_data -pf SEQ_HYCOM -ts 3 -z 0 20 2011-01-01 2011-02-01 153 156 -29 -24
64
+ # Download with options (output directory path (-p), custom filename prefix (-pf) 3-hourly data (-ts), top 20 m (-z))
65
+ GetOcean A -p raw_data -pf studysite -ts 3 -z 0 20 2011-01-01 2011-02-01 153 154 -29 -28
66
66
 
67
- # Merge downloaded files
68
- GetOcean B -i raw_data -o output -rp 28350 -tz 8 -ltz AWST -n merged_hycom.nc
67
+ # Merge downloaded files with options (input directory (-i), output directory (-o), timezone conversion (-tz), timezone attribute metadata (-ltz) and custom filename (-f))
68
+ GetOcean B -i raw_data -o output -tz 10 -ltz AEST -f merged_hycom.nc
69
69
  ```
70
70
 
71
71
  **Atmospheric Data Example:**
72
72
  ```bash
73
- # Download ERA5 atmospheric data
74
- GetAtmos A 2011-01-01 2011-02-01 152 154 -28 -26
73
+ # Download ERA5 atmospheric data with options (output directory path (-p))
74
+ GetAtmos A -p raw_data 2010-03-01 2010-04-01 153 154 -29 -28
75
75
 
76
- # Merge with reprojection and timezone conversion
77
- GetAtmos B -i raw_data -o output -rp 7856 -tz 10 -ltz AEST
76
+ # Merge downloaded files with options (input directory (-i), output directory (-o), reprojected to EPSG:28356 (-rp), timezone conversion (-tz) and timezone attribute metadata (-ltz))
77
+ GetAtmos B -i raw_data -o output -rp 28356 -tz 10 -ltz AEST
78
78
  ```
79
79
 
80
80
  **Tidal Data Example:**
81
81
  ```bash
82
- # Extract tidal data using a boundary nodestring shapefile
83
- GetTide output/tide_data.nc 2011-01-01 2012-01-01 boundaries/nodestring.shp path/to/fes2022/
82
+ # Extract tidal data from FES2022 extrapolated ocean tide using a boundary nodestring shapefile
83
+ GetTide output/tide_data.nc 2010-03-01 2010-04-01 nodestrings/2d_ns_Open_Boundary_001_L.shp -s FES2022_extrapolated fes2022b/ocean_tide_extrapolated
84
+ # Get Tide supports multiple FES tide models and each requires a specific directory structure. Refer to the wiki: (https://fvwiki.tuflow.com/TUFLOW_FV_Get_Tide_draft#Mandatory_FES_Folder_Structure)
84
85
  ```
85
86
 
86
87
  ### Python API
@@ -93,20 +94,20 @@ from tfv_get_tools import DownloadOcean, MergeOcean
93
94
  result = DownloadOcean(
94
95
  start_date='2011-01-01',
95
96
  end_date='2011-02-01',
96
- xlims=(153, 156),
97
- ylims=(-29, -24),
97
+ xlims=(153, 154),
98
+ ylims=(-29, -28),
98
99
  out_path='./raw_data',
99
100
  source='HYCOM',
100
101
  time_interval=24
101
102
  )
102
103
 
103
- # Merge downloaded files
104
+ # Merge downloaded files and shift time +10h with timezone attribute set to 'AEST'
104
105
  MergeOcean(
105
106
  in_path='./raw_data',
106
107
  out_path='./output',
107
- source='HYCOM',
108
- reproject=28350,
109
- local_tz=(8, 'AWST')
108
+ source='HYCOM',
109
+ local_tz=(10, 'AEST'),
110
+ fname= 'HYCOM_20110101_20110201_AEST.nc',
110
111
  )
111
112
  ```
112
113
 
@@ -116,21 +117,22 @@ from tfv_get_tools import DownloadAtmos, MergeAtmos
116
117
 
117
118
  # Download BARRA2 data
118
119
  result = DownloadAtmos(
119
- start_date='2020-01-01',
120
- end_date='2020-02-01',
121
- xlims=(152.72, 153.78),
122
- ylims=(-27.49, -25.39),
120
+ start_date='2022-12-01',
121
+ end_date='2023-01-01',
122
+ xlims=(153, 154),
123
+ ylims=(-29, -28),
123
124
  out_path='./raw_data',
124
125
  source='BARRA2',
125
126
  model='C2'
126
127
  )
127
128
 
128
- # Merge with reprojection to GDA2020 MGA56
129
+ # Merge downloaded files, reproject to GDA2020 MGA56, and shift time +10h with timezone attribute set to 'AEST'
129
130
  MergeAtmos(
130
131
  in_path='./raw_data',
131
132
  out_path='./output',
133
+ fname= 'BARRA2_C2_20221201_20230101_EPSG7856_AEST.nc',
132
134
  source='BARRA2',
133
- model='C2',
135
+ model='C2',
134
136
  reproject=7856,
135
137
  local_tz=(10.0, 'AEST')
136
138
  )
@@ -141,38 +143,50 @@ MergeAtmos(
141
143
  from pathlib import Path
142
144
  from tfv_get_tools.tide import ExtractTide
143
145
 
146
+ # User input
147
+ t_start = '2023-01-01'
148
+ t_end = '2023-02-01'
149
+ fes_dir = './fes2022b/ocean_tide_extrapolated' # Get Tide supports multiple FES tide models and each requires a specific directory structure. Refer to the wiki: (https://fvwiki.tuflow.com/TUFLOW_FV_Get_Tide_draft#Mandatory_FES_Folder_Structure)
150
+ output_dir = './output'
151
+ shp_file = './2d_ns_Open_Boundary_001_L.shp'
152
+ output_name = 'GOC_FES2022_extrapolated_20230101_20230125.nc'
153
+ model = 'FES2022_extrapolated'
154
+
144
155
  # Basic tidal extraction
145
156
  ExtractTide(
146
- start_date='2011-01-01',
147
- end_date='2012-01-01',
148
- filename='tide_data.nc',
149
- out_path='./output',
157
+ time_start=t_start,
158
+ time_end=t_end,
159
+ model_dir=fes_dir,
160
+ source=model,
161
+ fname=output_name,
162
+ out_path=output_dir,
150
163
  freq='15min',
151
- shapefile='boundaries/nodestring.shv'
164
+ shapefile=shp_file,
152
165
  )
153
166
 
154
167
  # Advanced usage with constituent caching
155
168
  from tfv_get_tools.tide import load_nodestring_shapefile, process_nodestring_gdf, get_constituents
156
169
 
157
170
  # Load and process boundary shapefile
158
- gdf = load_nodestring_shapefile('boundaries/nodestring.shp', process_ids=[1])
159
- coordinates = process_nodestring_gdf(gdf, spacing=5000)
171
+ gdf = load_nodestring_shapefile(shp_file)
172
+ coordinates = process_nodestring_gdf(gdf, spacing=2500)
160
173
 
161
174
  # Extract constituents once (slow first time, fast afterwards)
162
175
  constituents = get_constituents(
163
176
  coordinates,
164
- source='FES2022',
165
- save_cons='boundary_constituents.pkl'
177
+ model_dir=fes_dir,
178
+ source=model,
179
+ save_cons='boundary_constituents.pkl',
166
180
  )
167
181
 
168
182
  # Use cached constituents for faster extraction
169
183
  ExtractTide(
170
- start_date='2011-01-01',
171
- end_date='2012-01-01',
172
- filename='tide_data.nc',
173
- out_path='./output',
184
+ time_start=t_start,
185
+ time_end=t_end,
186
+ fname=output_name,
187
+ out_path=output_dir,
174
188
  freq='15min',
175
- constituents='boundary_constituents.pkl'
189
+ constituents='boundary_constituents.pkl',
176
190
  )
177
191
  ```
178
192
 
@@ -230,7 +244,7 @@ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file
230
244
 
231
245
  ## Authors
232
246
 
233
- Developed by [TUFLOW](https://www.tuflow.com/), 2025
247
+ Developed by [TUFLOW](https://www.tuflow.com/), 2026
234
248
 
235
249
  ## Project Status
236
250
 
@@ -238,4 +252,4 @@ Developed by [TUFLOW](https://www.tuflow.com/), 2025
238
252
 
239
253
  ---
240
254
 
241
- *Last updated: July 2025*
255
+ *Last updated: January 2026*
@@ -1,10 +1,8 @@
1
1
  [project]
2
2
  name = "tfv_get_tools"
3
- version = "0.2.3"
3
+ version = "0.2.5"
4
4
  description = "Tool for downloading and processing data for TUFLOW FV modelling"
5
5
  authors = [
6
- { name = "Alex Waterhouse", email = "alex.waterhouse@apac.bmt.org" },
7
- { name = "Mitchell Smith", email = "mitchell.smith@apac.bmt.org" },
8
6
  { name = "TUFLOW Support", email = "support@tuflow.com" },
9
7
  ]
10
8
  license = { text = "MIT" }
@@ -31,7 +29,7 @@ dependencies = [
31
29
  "cdsapi>=0.7.0",
32
30
  "copernicusmarine>=1.2.3",
33
31
  "bottleneck>=1.3.5",
34
- "pyTMD>=2.1.5",
32
+ "pyTMD>=2.1.7,<3",
35
33
  "shapely >= 2.0.6",
36
34
  "geopandas >= 1.0.1",
37
35
  ]
@@ -61,12 +61,12 @@ STDVARS = {
61
61
  "water_temp": {
62
62
  "long_name": "sea_water_temperature",
63
63
  "standard_name": "sea_water_temperature",
64
- "units": "K"
64
+ "units": "degC"
65
65
  },
66
66
  "salinity": {
67
67
  "long_name": "sea_water_salinity",
68
68
  "standard_name": "sea_water_practical_salinity",
69
- "units": "1e-3"
69
+ "units": "psu"
70
70
  },
71
71
  # Wave parameters
72
72
  "hs": {
@@ -17,7 +17,7 @@ class CLIBase(ABC):
17
17
  self.parser = argparse.ArgumentParser(
18
18
  prog=prog_name,
19
19
  description=description,
20
- epilog="See '<command> --help' to read about a specific sub-command.",
20
+ epilog="See '<command> --help' to read about a specific sub-command",
21
21
  )
22
22
  self.subparsers = self.parser.add_subparsers(
23
23
  dest="command", help="Sub-commands"
@@ -53,7 +53,15 @@ class CLIBase(ABC):
53
53
  default=".",
54
54
  type=self.dir_path,
55
55
  help="Output directory, needs to exist first",
56
+ )
57
+ parser.add_argument(
58
+ "-pf",
59
+ "--prefix",
60
+ type=str,
61
+ default=None,
62
+ help="Filename prefix"
56
63
  )
64
+
57
65
  self.add_source_arguments(parser)
58
66
  parser.set_defaults(func=self.run_download)
59
67
 
@@ -137,15 +145,19 @@ class CLIBase(ABC):
137
145
 
138
146
  def check_bbox(args):
139
147
  """
140
- Unfortunate edge case hackfix for programmer style floats like "-28." isntead of "-28.0".
148
+ Unfortunate edge case hackfix for programmer style floats like "-28." instead of "-28.0".
141
149
  Fixes negative numbers with trailing dots in the final 4 arguments (bbox).
142
150
  Only modifies if all 4 final args are numeric-like!!
143
151
  Otherwise spits fire
144
- """
152
+ """
145
153
  # Early exit if only 1 or 2 args are provided - or --help / -h
146
154
  if len(args) == 1 or len(args) == 2 or (len(args) >= 2 and (('-h' in args) or ('--help' in args))):
147
155
  return args
148
156
 
157
+ # Skip argument manipulation if we're on the Merger or the INFO
158
+ if args[1] in ['B', 'info']:
159
+ return args
160
+
149
161
  if (len(args) < 4):
150
162
  raise ValueError("Must supply at minimum 6 arguments - time_start time_end xmin xmax ymin ymax")
151
163
 
@@ -42,8 +42,8 @@ def print_atmos_info():
42
42
 
43
43
  3. BoM's "BARRA2"
44
44
  - "R2" - An 11-km grid reanalysis covering Australia
45
- - "C2" - An 4-km grid reanalysis covering Australia, with only wind and pressure fields downloaded.
46
- - "RE2" - (Testing Only) An experimental ensembles 22-km grid covering Australia.
45
+ - "C2" - An 4-km grid reanalysis covering Australia, with only wind and pressure fields downloaded
46
+ - "RE2" - (Testing Only) An experimental ensembles 22-km grid covering Australia
47
47
 
48
48
  Example Usage:
49
49
  ---------
@@ -53,10 +53,10 @@ def print_atmos_info():
53
53
  Merge ERA5 Reanalysis Data - all defaults, merge all data in the raw folder
54
54
  `GetAtmos B`
55
55
 
56
- Download BARRA2 C2 Dataset
56
+ Download BARRA2 R2 Dataset
57
57
  `GetAtmos A -s BARRA2 -m R2 2011-01-01 2012-01-01 150 153 -30 -25`
58
58
 
59
- Merge BARRA2 C2 Dataset with reprojection and local time
59
+ Merge BARRA2 R2 Dataset with reprojection and local time
60
60
  `GetAtmos B -s BARRA2 -m R2 -tz 10 -ltz AEST -rp 7856`
61
61
 
62
62
  For more specific help, please use:
@@ -114,25 +114,19 @@ class GetAtmos(CLIBase):
114
114
  """
115
115
  super().add_source_arguments(parser)
116
116
 
117
- parser.add_argument(
118
- '--info',
119
- action="store_true",
120
- help="Display the full program help"
121
- )
122
-
123
117
  parser.add_argument(
124
118
  "-s",
125
119
  "--source",
126
120
  type=str,
127
121
  default="ERA5",
128
- help='Atmos data source. Default = "ERA5". Optionally others see wiki.',
122
+ help='Atmos data source. Default = "ERA5". Specified CFSR and BARRA2',
129
123
  )
130
124
  parser.add_argument(
131
125
  "-m",
132
126
  "--model",
133
127
  type=str,
134
128
  default="default",
135
- help='Model from source. Default is "default". Optionally others see wiki.',
129
+ help='Model from source. Default is "default". Refer to GetAtmos --info',
136
130
  )
137
131
  parser.add_argument(
138
132
  "--test",
@@ -155,8 +149,10 @@ class GetAtmos(CLIBase):
155
149
  xlims,
156
150
  ylims,
157
151
  source=args.source,
152
+ model=args.model,
158
153
  out_path=args.path,
159
154
  TEST_MODE=args.test,
155
+ prefix=args.prefix,
160
156
  )
161
157
 
162
158
  def run_merge(self, args):
@@ -189,4 +185,8 @@ class GetAtmos(CLIBase):
189
185
  local_tz=tz,
190
186
  wrapto360=args.wrapto360,
191
187
  pad_dry=args.pad_dry,
192
- )
188
+ )
189
+
190
+ # For debugging
191
+ if __name__ == "__main__":
192
+ entry()
@@ -38,7 +38,8 @@ def print_ocean_info():
38
38
  1. (Default) "HYCOM" - Global Ocean Forecasting System
39
39
  - "default" - Global ocean analysis and forecast system
40
40
 
41
- 2. Other sources available - see documentation
41
+ 2. "Copernicus" - Copernicus Marine Service
42
+ - "default" - Global ocean analysis and forecast system
42
43
 
43
44
  Example Usage:
44
45
  ---------
@@ -89,7 +90,7 @@ class GetOcean(CLIBase):
89
90
  "--timestep",
90
91
  default=24,
91
92
  type=int,
92
- help="Download timestep interval in hours, only relevant for HYCOM. Must be a multiple of 3 (highest resolution available). Default is 24 (daily). All sources other than HYCOM are downloaded in the best available time resolution.",
93
+ help="Download timestep interval in hours, only relevant for HYCOM. Must be a multiple of 3 (highest resolution available). Default is 24 (daily). All sources other than HYCOM are downloaded in the best available time resolution",
93
94
  )
94
95
 
95
96
  dparser.add_argument(
@@ -98,7 +99,7 @@ class GetOcean(CLIBase):
98
99
  nargs=2,
99
100
  type=float,
100
101
  default=None,
101
- help='Minimum and maximum depth "zmin zmax". Defaults to the maximum for source.',
102
+ help='Minimum and maximum depth "zmin zmax". Defaults to the maximum for source',
102
103
  )
103
104
 
104
105
  self.add_info_parser()
@@ -127,25 +128,19 @@ class GetOcean(CLIBase):
127
128
  """
128
129
  super().add_source_arguments(parser)
129
130
 
130
- parser.add_argument(
131
- '--info',
132
- action="store_true",
133
- help="Display the full program help"
134
- )
135
-
136
131
  parser.add_argument(
137
132
  "-s",
138
133
  "--source",
139
134
  type=str,
140
135
  default="HYCOM",
141
- help='Ocean data source. Default = "HYCOM". Optionally others see wiki.',
136
+ help='Ocean data source. Default = "HYCOM". Specified = Copernicus',
142
137
  )
143
138
  parser.add_argument(
144
139
  "-m",
145
140
  "--model",
146
141
  type=str,
147
142
  default="default",
148
- help='Model from source. Default is "default". Optionally others see wiki.',
143
+ help='Model from source. Default is "default". Refer to GetOcean info',
149
144
  )
150
145
 
151
146
  def run_download(self, args):
@@ -169,6 +164,7 @@ class GetOcean(CLIBase):
169
164
  time_interval=args.timestep,
170
165
  source=args.source,
171
166
  out_path=args.path,
167
+ prefix=args.prefix,
172
168
  )
173
169
 
174
170
  def run_merge(self, args):
@@ -70,15 +70,17 @@ def entry():
70
70
  )
71
71
 
72
72
  parser.add_argument(
73
+ "-s",
73
74
  "--source",
74
75
  type=str,
75
76
  default=None,
76
- help="Tidal model source name. This will attempt to be automatically detected from model_dir, but it can be overriden if there are issues."
77
+ help="Tidal model source name. This will attempt to be automatically detected from model_dir, but it can be overriden if there are issues"
77
78
  )
78
79
  parser.add_argument(
79
80
  "-fvc",
80
81
  "--write_fvc",
81
82
  action="store_true",
83
+ default=True, # <-- makes it True unless overridden
82
84
  help="Write a TUFLOW FV '.fvc' file to accompany extracted tide dataset",
83
85
  )
84
86
 
@@ -104,9 +106,9 @@ def entry():
104
106
 
105
107
 
106
108
  ExtractTide(
109
+ args.time_start,
110
+ args.time_end,
107
111
  args.out,
108
- args.tstart,
109
- args.tend,
110
112
  model_dir,
111
113
  shapefile=args.nodestring,
112
114
  freq=args.freq,
@@ -116,3 +118,6 @@ def entry():
116
118
  write_fvc=args.write_fvc,
117
119
  )
118
120
 
121
+ # For debugging
122
+ if __name__ == "__main__":
123
+ entry()