Skip to content

Setting up tidal models for DE Africa Coastlines

Robbi Bishop-Taylor edited this page Jun 4, 2022 · 3 revisions

This repository has been updated to model tides using functions and tools from the pyTMD Python package. To set up this for the first time, follow the instructions below.

  1. Register with AVISO+, and select FES2014 / FES2012 (Oceanic Tides Heights) from the PRODUCT SELECTION section:

image

  1. Once your registration is complete, login to MY AVISO+.
  2. Once logged in, select My products in the left-hand menu:

image

  1. FES2014 / FES2012 (Oceanic Tides Heights) should appear under Your current subscriptions. Right click on Ftp, and copy the FTP address.

image

  1. Using an FTP client like FileZilla, log in to the FTP using your AVISO+ username and password:

image

  1. Navigate to /auxiliary/tide_model/fes2014_elevations_and_load/, and download the following files:
  • fes2014a_loadtide/load_tide.tar.xz
  • fes2014b_elevations/ocean_tide.tar.xz (or fes2014b_elevations_extrapolated/ocean_tide_extrapolated.tar.xz; this extrapolated version includes additional coverage of the coastal zone, which can be useful for coastal applications)
  1. Create a new folder (i.e. tide_models/fes2014/) to store the model files in a location that will be accessible to the DEA Coastlines code. Extract load_tide.tar.xz and ocean_tide.tar.xz into this folder (e.g. tar -xf load_tide.tar.xz). You should end up with the following directory structure containing the extracted NetCDF files:
tide_models/fes2014/load_tide/
    |- 2n2.nc
    |- ...
    |- t2.nc
tide_models/fes2014/ocean_tide/
    |- 2n2.nc
    |- ...
    |- t2.nc

Note: If you downloaded ocean_tide_extrapolated.tar.xz, you will need to rename the extracted ocean_tide_extrapolated folder to ocean_tide.

Modelling tides

If the pyTMD Python package is not installed on your system, this can be installed using:

pip install pytmd

Tides from FES2014 can now be modelled using the model_tides function in this repository:

import pandas as pd
from coastlines.raster import model_tides

lons=[155, 160] 
lats=[-35, -36] 
example_times = pd.date_range("2022-01-01", "2022-01-04", freq="1D")

model_tides(
        x=lons,
        y=lats,
        time=example_times.values,
        directory='tide_models'
)

In the DE Africa Coastlines code, this function is used in the raster module as part of the annual water index composite generation process.

Depending on where you created the tide_models directory, you may need to update the directory parameter of the model_tide_points function to point to the location of the FES2014 model files.