tfv-get-tools 0.2.2__py3-none-any.whl → 0.2.4__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.
- tfv_get_tools/cli/_cli_base.py +6 -2
- tfv_get_tools/cli/atmos_cli.py +2 -2
- tfv_get_tools/providers/ocean/hycom.py +11 -5
- tfv_get_tools/providers/wave/era5.py +1 -1
- {tfv_get_tools-0.2.2.dist-info → tfv_get_tools-0.2.4.dist-info}/METADATA +1 -1
- {tfv_get_tools-0.2.2.dist-info → tfv_get_tools-0.2.4.dist-info}/RECORD +10 -10
- {tfv_get_tools-0.2.2.dist-info → tfv_get_tools-0.2.4.dist-info}/WHEEL +0 -0
- {tfv_get_tools-0.2.2.dist-info → tfv_get_tools-0.2.4.dist-info}/entry_points.txt +0 -0
- {tfv_get_tools-0.2.2.dist-info → tfv_get_tools-0.2.4.dist-info}/licenses/LICENSE +0 -0
- {tfv_get_tools-0.2.2.dist-info → tfv_get_tools-0.2.4.dist-info}/top_level.txt +0 -0
tfv_get_tools/cli/_cli_base.py
CHANGED
|
@@ -137,15 +137,19 @@ class CLIBase(ABC):
|
|
|
137
137
|
|
|
138
138
|
def check_bbox(args):
|
|
139
139
|
"""
|
|
140
|
-
Unfortunate edge case hackfix for programmer style floats like "-28."
|
|
140
|
+
Unfortunate edge case hackfix for programmer style floats like "-28." instead of "-28.0".
|
|
141
141
|
Fixes negative numbers with trailing dots in the final 4 arguments (bbox).
|
|
142
142
|
Only modifies if all 4 final args are numeric-like!!
|
|
143
143
|
Otherwise spits fire
|
|
144
|
-
"""
|
|
144
|
+
"""
|
|
145
145
|
# Early exit if only 1 or 2 args are provided - or --help / -h
|
|
146
146
|
if len(args) == 1 or len(args) == 2 or (len(args) >= 2 and (('-h' in args) or ('--help' in args))):
|
|
147
147
|
return args
|
|
148
148
|
|
|
149
|
+
# Skip argument manipulation if we're on the Merger or the INFO
|
|
150
|
+
if args[1] in ['B', 'info']:
|
|
151
|
+
return args
|
|
152
|
+
|
|
149
153
|
if (len(args) < 4):
|
|
150
154
|
raise ValueError("Must supply at minimum 6 arguments - time_start time_end xmin xmax ymin ymax")
|
|
151
155
|
|
tfv_get_tools/cli/atmos_cli.py
CHANGED
|
@@ -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
|
|
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
|
|
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:
|
|
@@ -516,7 +516,7 @@ class MergeHYCOM(BaseMerger):
|
|
|
516
516
|
|
|
517
517
|
if time_vars:
|
|
518
518
|
# Create single rolling object and apply to all variables
|
|
519
|
-
rolling_ds = ds[time_vars].rolling(time=25, center=True).reduce(np.nanmean)
|
|
519
|
+
rolling_ds = ds[time_vars].rolling(time=25, center=True, min_periods=1).reduce(np.nanmean)
|
|
520
520
|
|
|
521
521
|
for var_name in time_vars:
|
|
522
522
|
# Only replace post-cutoff values
|
|
@@ -572,10 +572,10 @@ class MergeHYCOM(BaseMerger):
|
|
|
572
572
|
if all_datasets and self._check_sub_daily_data(all_datasets[0]):
|
|
573
573
|
apply_tidal_filtering = True
|
|
574
574
|
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
575
|
+
print("Concatenating and interpolating xarray dataset")
|
|
576
|
+
if has_post_cutoff_data and apply_tidal_filtering:
|
|
577
|
+
print('... Dataset contains sub-daily data post-2024-08-10 (HYCOM ESPC-D-V02), applying tidal filtering using a simple 25h rolling mean.')
|
|
578
|
+
print('... Warning: Your dataset should be padded at least 1 full day either side before using in TUFLOW FV.')
|
|
579
579
|
|
|
580
580
|
# Merge variables for each start date group
|
|
581
581
|
merged_by_date = []
|
|
@@ -600,7 +600,13 @@ class MergeHYCOM(BaseMerger):
|
|
|
600
600
|
|
|
601
601
|
# Apply tidal filtering to the merged dataset if needed
|
|
602
602
|
if apply_tidal_filtering:
|
|
603
|
+
# Copy the original surface elevation data to a raw variable for later
|
|
604
|
+
raw_surf_el = merged['surf_el'].copy()
|
|
603
605
|
merged = self._apply_tidal_filtering(merged)
|
|
606
|
+
|
|
607
|
+
# Copy original surface elevation
|
|
608
|
+
merged['raw_surf_el'] = raw_surf_el
|
|
609
|
+
merged['raw_surf_el'].attrs['note'] = 'Original HYCOM water-level containing tides after 2024-08-10'
|
|
604
610
|
|
|
605
611
|
# Final cleanup
|
|
606
612
|
merged = merged.rename({'lon': 'longitude', 'lat': 'latitude'})
|
|
@@ -147,7 +147,7 @@ class DownloadERA5Wave(BaseDownloader):
|
|
|
147
147
|
raise ValueError("No NetCDF files found in zip archive")
|
|
148
148
|
|
|
149
149
|
# Combine all datasets
|
|
150
|
-
ds = xr.merge(datasets)
|
|
150
|
+
ds = xr.merge(datasets, compat='override')
|
|
151
151
|
ds.to_netcdf(file_path_out)
|
|
152
152
|
|
|
153
153
|
# Delete the zip file
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: tfv_get_tools
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.4
|
|
4
4
|
Summary: Tool for downloading and processing data for TUFLOW FV modelling
|
|
5
5
|
Author-email: Alex Waterhouse <alex.waterhouse@apac.bmt.org>, Mitchell Smith <mitchell.smith@apac.bmt.org>, TUFLOW Support <support@tuflow.com>
|
|
6
6
|
License: MIT
|
|
@@ -3,8 +3,8 @@ tfv_get_tools/_standard_attrs.py,sha256=mhmheUm49e-G8ePMLGnIHvWHYW3ZHjCXQlokEIBE
|
|
|
3
3
|
tfv_get_tools/atmos.py,sha256=vmga1ZC3cWM8eejt-lluYOaQpp2lNn0M59s61u9B3Zw,5799
|
|
4
4
|
tfv_get_tools/ocean.py,sha256=27EsEP52u-JrT-TOxtH5rqS7ROgEporZ52d0jdbvJH0,6588
|
|
5
5
|
tfv_get_tools/wave.py,sha256=5OKU4BENNR5y0boEH0nHc0ZCgcPx5gcqS9eKr8jAwFY,6779
|
|
6
|
-
tfv_get_tools/cli/_cli_base.py,sha256=
|
|
7
|
-
tfv_get_tools/cli/atmos_cli.py,sha256=
|
|
6
|
+
tfv_get_tools/cli/_cli_base.py,sha256=foc3Jr_PiN3gmouy4NHLCQYJYolupxx2Q-kFbiNgNoE,5996
|
|
7
|
+
tfv_get_tools/cli/atmos_cli.py,sha256=Jvc8JxYTURx3PCOkeqMoWtt5jsIKfpRnlH7FNBNqEs8,6581
|
|
8
8
|
tfv_get_tools/cli/ocean_cli.py,sha256=nyNIQN7qwDvME2Ts9oWUCaOtANrFDaQZAmr48v5k5D0,6912
|
|
9
9
|
tfv_get_tools/cli/tide_cli.py,sha256=ML7l1-HEyxg1xaEVmclN09nY5D4kkSVAgFZ6SiBYJok,3334
|
|
10
10
|
tfv_get_tools/cli/wave_cli.py,sha256=kKMY93SUKcDRbrOWJb3bNJUuMMJ9kTrLRIdc-ATAEtY,6132
|
|
@@ -29,14 +29,14 @@ tfv_get_tools/providers/atmos/cfgs/cfsr.yaml,sha256=8HgskImaZHoW7Xm6rP5RgpFdTK_q
|
|
|
29
29
|
tfv_get_tools/providers/atmos/cfgs/era5.yaml,sha256=_a34TT3CUWNGvtKHFVbNFS2_0YFZKQU1Sqnu3TC9fwg,1654
|
|
30
30
|
tfv_get_tools/providers/atmos/cfgs/era5_gcp.yaml,sha256=CY-y4Uxq3fPFKtqCcsJcL0_j6Vu-hahNqK8HsTGS3Bc,1719
|
|
31
31
|
tfv_get_tools/providers/ocean/copernicus_ocean.py,sha256=hPnxONvQ3YEAI65pG0KMaGImqu2POBYvW7-Q6xhjf3s,17848
|
|
32
|
-
tfv_get_tools/providers/ocean/hycom.py,sha256=
|
|
32
|
+
tfv_get_tools/providers/ocean/hycom.py,sha256=fqIJGDVAwNB6A5k4Tu18mQs5BxwWkaeECOqYknOr5LI,26809
|
|
33
33
|
tfv_get_tools/providers/ocean/cfgs/copernicus_blk.yaml,sha256=XGCj8_rDLNHSq6kQnvgjrahcPGaiLInxqB_9LoMvlAY,1482
|
|
34
34
|
tfv_get_tools/providers/ocean/cfgs/copernicus_glo.yaml,sha256=IMETXv3u783YzxB3fRF_uQ5hYBN28aHAH3iJzXcuDhU,1443
|
|
35
35
|
tfv_get_tools/providers/ocean/cfgs/copernicus_nws.yaml,sha256=rQhSEynvKgypohDhyIqizjZDriETbBiZPBtDp8dFLOY,1346
|
|
36
36
|
tfv_get_tools/providers/ocean/cfgs/hycom.yaml,sha256=GQoEcyLYmF_PRPXeY2IO7jiqFcZad7y8bzPjsBn9PS4,1599
|
|
37
37
|
tfv_get_tools/providers/wave/cawcr.py,sha256=95YZCewImgtldiDj6qJ6lkcIo_QIz2rFTYDB0qwkwVk,6028
|
|
38
38
|
tfv_get_tools/providers/wave/copernicus_wave.py,sha256=FeoJUSDMH_tuo29VoZYSDXalra-lcfm9Mue--fJ-E7U,1031
|
|
39
|
-
tfv_get_tools/providers/wave/era5.py,sha256=
|
|
39
|
+
tfv_get_tools/providers/wave/era5.py,sha256=4e1l_h5aZR-1LlvajDVAqG8jsEk8qdXHSm_NHK8wsA4,9190
|
|
40
40
|
tfv_get_tools/providers/wave/era5_gcp.py,sha256=hLY_4YqQxhQ-P9uPC30Knv_LJ4vFMu1ZJJbGccR4xb8,6165
|
|
41
41
|
tfv_get_tools/providers/wave/cfgs/cawcr_aus_10m.yaml,sha256=PCk6fkYHTD1uMv1oZP_7M4BuFWMxLaUdZmbbrJ4zA4w,936
|
|
42
42
|
tfv_get_tools/providers/wave/cfgs/cawcr_aus_4m.yaml,sha256=LJ-8C8PFzVO4nmIMM4CUfhHsnnb1cTdKeYRr_DLIFKI,935
|
|
@@ -55,9 +55,9 @@ tfv_get_tools/utilities/horizontal_padding.py,sha256=-bqLDzqm17fOZqYrjJPXYwdVYwo
|
|
|
55
55
|
tfv_get_tools/utilities/land_masking.py,sha256=19r9iiMMqxXChGlfmmXPzEM5VyhsnR-nqTsSjaKzP34,2743
|
|
56
56
|
tfv_get_tools/utilities/parsers.py,sha256=V4ZBcpLPtSbkM3k5XoZS_xpauJVEzHUs9woNHznbHI4,1284
|
|
57
57
|
tfv_get_tools/utilities/warnings.py,sha256=GWrj7Jh2gU3b9u2kzSfaqYPk8cL9aeMbkJgspn0a9W8,1146
|
|
58
|
-
tfv_get_tools-0.2.
|
|
59
|
-
tfv_get_tools-0.2.
|
|
60
|
-
tfv_get_tools-0.2.
|
|
61
|
-
tfv_get_tools-0.2.
|
|
62
|
-
tfv_get_tools-0.2.
|
|
63
|
-
tfv_get_tools-0.2.
|
|
58
|
+
tfv_get_tools-0.2.4.dist-info/licenses/LICENSE,sha256=ALmu4D6vRZ-Xxz6IjzUIc_XyZGfVIWCOxIA1qe3tnVY,1059
|
|
59
|
+
tfv_get_tools-0.2.4.dist-info/METADATA,sha256=nOj4d7OVrA2ZmmZO_9bJN9CxiXCKDzEty2q3duaI7cA,10701
|
|
60
|
+
tfv_get_tools-0.2.4.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
61
|
+
tfv_get_tools-0.2.4.dist-info/entry_points.txt,sha256=pTCS55WUArvFH-Z_EsjTpICz9p1rqqVJ10e7aX3S2MA,194
|
|
62
|
+
tfv_get_tools-0.2.4.dist-info/top_level.txt,sha256=K_ewT8V9jhtf59kUDU5YqahUczoInqs7ZFlc4Ho3IjE,14
|
|
63
|
+
tfv_get_tools-0.2.4.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|