Skip to main content

Tool for downloading and processing data for TUFLOW FV modelling

Project description

TFV Get Tools

⚠️ Beta Package - This is a beta release. Features may change and improvements are ongoing. Please report any issues to support@tuflow.com.

Tools to assist with downloading and processing meteorological and ocean data to use with TUFLOW FV

License: MIT Project Status: Active

Overview

TFV Get Tools is a Python package that simplifies the process of downloading and processing meteorological and ocean data for use with TUFLOW FV models. The tool supports extraction of tidal data, atmospheric conditions, ocean physics, and wave data from various authoritative sources.

Supported Data Sources

Atmospheric Data:

Ocean Data:

Wave Data:

Tidal Data:

  • FES2014 (AVISO+ Finite Element Solution 2014)
  • FES2022 (AVISO+ Finite Element Solution 2022)

Installation

Conda/Mamba (Recommended)

# Create a new environment, if required. 
conda create -n tfv python=3.9
conda activate tfv

# Install the package
conda install -c conda-forge tfv-get-tools

Pip

pip install tfv-get-tools

Quick Start

Command Line Interface

The package provides command-line tools for downloading and processing data:

Ocean Data Example:

# Download HYCOM data for January 2011 in southeast Queensland
GetOcean A 2011-01-01 2011-02-01 153 156 -29 -24

# Download with custom options (top 20m, 3-hourly data, custom prefix)
GetOcean A -p raw_data -pf SEQ_HYCOM -ts 3 -z 0 20 2011-01-01 2011-02-01 153 156 -29 -24

# Merge downloaded files
GetOcean B -i raw_data -o output -rp 28350 -tz 8 -ltz AWST -n merged_hycom.nc

Atmospheric Data Example:

# Download ERA5 atmospheric data
GetAtmos A 2011-01-01 2011-02-01 152 154 -28 -26

# Merge with reprojection and timezone conversion
GetAtmos B -i raw_data -o output -rp 7856 -tz 10 -ltz AEST

Tidal Data Example:

# Extract tidal data using a boundary nodestring shapefile
GetTide output/tide_data.nc 2011-01-01 2012-01-01 boundaries/nodestring.shp path/to/fes2022/

Python API

Ocean Data:

from tfv_get_tools import DownloadOcean, MergeOcean

# Download HYCOM data
result = DownloadOcean(
    start_date='2011-01-01',
    end_date='2011-02-01',
    xlims=(153, 156),
    ylims=(-29, -24),
    out_path='./raw_data',
    source='HYCOM',
    time_interval=24
)

# Merge downloaded files
MergeOcean(
    in_path='./raw_data',
    out_path='./output',
    source='HYCOM',
    reproject=28350,
    local_tz=(8, 'AWST')
)

Atmospheric Data:

from tfv_get_tools import DownloadAtmos, MergeAtmos

# Download BARRA2 data
result = DownloadAtmos(
    start_date='2020-01-01',
    end_date='2020-02-01',
    xlims=(152.72, 153.78),
    ylims=(-27.49, -25.39),
    out_path='./raw_data',
    source='BARRA2',
    model='C2'
)

# Merge with reprojection to GDA2020 MGA56
MergeAtmos(
    in_path='./raw_data',
    out_path='./output',
    source='BARRA2',
    model='C2',
    reproject=7856,
    local_tz=(10.0, 'AEST')
)

Tidal Data:

from pathlib import Path
from tfv_get_tools.tide import ExtractTide

# Basic tidal extraction
ExtractTide(
    start_date='2011-01-01',
    end_date='2012-01-01',
    filename='tide_data.nc',
    out_path='./output',
    freq='15min',
    shapefile='boundaries/nodestring.shv'
)

# Advanced usage with constituent caching
from tfv_get_tools.tide import load_nodestring_shapefile, process_nodestring_gdf, get_constituents

# Load and process boundary shapefile
gdf = load_nodestring_shapefile('boundaries/nodestring.shp', process_ids=[1])
coordinates = process_nodestring_gdf(gdf, spacing=5000)

# Extract constituents once (slow first time, fast afterwards)
constituents = get_constituents(
    coordinates,
    source='FES2022',
    save_cons='boundary_constituents.pkl'
)

# Use cached constituents for faster extraction
ExtractTide(
    start_date='2011-01-01',
    end_date='2012-01-01',
    filename='tide_data.nc',
    out_path='./output',
    freq='15min',
    constituents='boundary_constituents.pkl'
)

Requirements

Data Credits and Acknowledgements

This package utilises data from multiple authoritative sources. Please ensure appropriate attribution when using this data:

Atmospheric Data

Ocean Data

Wave Data

Tidal Data

  • FES Tidal Models: Tidal data provided by AVISO+ and the FES development team. FES2014 and FES2022 are products of Noveltis, Legos, and CLS, with support from CNES.
  • PyTMD: This package utilises the PyTMD Python package for tidal analysis and prediction, developed by Tyler Sutterley.

Support

For questions, bug reports, or feature requests:

Contributing

Contributions are welcome! Please follow these steps:

  1. Fork the repository
  2. Create a feature branch from main
  3. Make your changes with appropriate tests
  4. Submit a pull request
  5. Email support@tuflow.com to notify the development team

Please ensure your code follows the project's coding standards and includes appropriate documentation.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Authors

Developed by BMT, 2025

Project Status

Active - This project is actively maintained and in use. For update requests or feature suggestions, please email support@tuflow.com.


Last updated: July 2025

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tfv_get_tools-0.2.1.tar.gz (95.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tfv_get_tools-0.2.1-py3-none-any.whl (104.4 kB view details)

Uploaded Python 3

File details

Details for the file tfv_get_tools-0.2.1.tar.gz.

File metadata

  • Download URL: tfv_get_tools-0.2.1.tar.gz
  • Upload date:
  • Size: 95.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for tfv_get_tools-0.2.1.tar.gz
Algorithm Hash digest
SHA256 418db54f1deeb3e589291afd5a13335de273a8f945a2f12cbef4b1d87fc9d3ab
MD5 40aeabd116655fff3649cda45a99c277
BLAKE2b-256 25c66972e6cdcec1270a93aa42de912d4525319092cbd381b9365808e9f4fb90

See more details on using hashes here.

File details

Details for the file tfv_get_tools-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: tfv_get_tools-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 104.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for tfv_get_tools-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1052fbb5b7f83e5efa7ed0a815826f2f1165ad8e122d3d82e7844a1974c64986
MD5 e39c0d68517efb54fb426481d8b7e38a
BLAKE2b-256 8b12e96c5cec862f040a3f899037ed884eafa1bf5de60f348ce74d68980a899e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page