Overview¶
This guide will walk you through signing up for the necessary account and then choosing between two methods to download and clip the tide model for use in CoastSeg.
Part 1: Signing Up for the FES2014 Model¶
Step 1: Register for an AVISO+ Account
Step 1: Register for an AVISO+ Account¶
- Visit the registration form at AVISO+ Registration.(its free)
- Fill out the form with your details
- Make sure to select FES2014 / FES2012 (Oceanic Tides Heights) in the model selection section.
- Submit the form and wait for a confirmation email.
Step 2: Verify Your AVISO+ Account¶
- Check your email for a confirmation from AVISO+.
- Click the verification link in the email to activate your account.
Step 3: Access Your Subscriptions¶
- Log into your AVISO account.
- Navigate to My products in the left side menu.
- Confirm that FES2014 / FES2012 (Oceanic Tides Heights) is listed under Your current subscriptions.
Part 2: Downloading and Clipping the Tide Model¶
You have two options to download and clip the tide model: using a Jupyter Notebook (Recommended) or using a Script (Alternative). Choose one based on your comfort level and requirements.
Space and Time Requirements¶
- Storage Space: Ensure you have at least 14GB of free space available.
- Time Commitment: The download and setup process for the fes2014 model takes approximately 1-2 hours. This is a one-time requirement.
Option 1: Using the Download_tide_model.ipynb Notebook (Recommended)¶
The easiest way to download and clip the tide model is to use this notebook. Run all the code in the notebook and you're done!
- Prepare: Ensure you have you are in an activated coastseg environment and know your AVISO email and password.
- Open Notebook: Launch
Download_tide_model.ipynb
in Jupyter Notebook.
1 2 |
|
3.Run Code: Execute all cells in the notebook. The code will guide you through the download and clipping process automatically.
4.Check Results: Confirm that the model files are correctly downloaded and clipped in the specified directory.
-
Example Output from Downloading Tide Model Step in Notebook
-
Example Output from Clipping Tide Model Step in Notebook
5.Downloaded Tide Model Contents
Option 2: Using the Script (Alternative)¶
Setup¶
- Create Directory: Navigate to your CoastSeg installation directory and create a new folder named tide_model.
- Script Location: Change directory to the scripts folder within CoastSeg.
1 2 3 |
|
Download & Clip¶
1.Run Download Script: Execute the aviso_fes_tides.py
script with the necessary parameters, including your AVISO credentials and target directory for the tide model.
- ⚠️ Enter your AVISO password when prompted. Note that the password won't display as you type. After you have finished typing, press Enter to proceed.
- Replace
C:\Users\Sample\coastseg
with the actual location of your CoastSeg directory.
Example command:
1 |
|
2.Clip Model to Regions: After downloading, run the clip_and_write_new_nc_files_cmd_line.py
script with the paths to your tide model directory and the regions geojson file.
To make the tide predictions compute faster we will clip the model it to various regions across the planet. After we've clipped the model to each region, when we want to predict the tide at a particular latitude and longitude we first figure out which region the point lies within, then we load the tide model we clipped to that region.
-R or --regions_file
the full path to the regions geojson file. You should find this filetide_regions_map.geojson
in thescripts
-T or --tide_model
the full path to the directory containing the tide model downloaded- Replace
C:\Users\Sample\coastseg
with the actual location of your CoastSeg directory.
1 |
|
3.Validate: Ensure each region directory under tide_model contains clipped tide model files.
- Each region will have the same format as region0 the full list of files is omitted for brevity.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
|
4.Downloaded Tide Model Contents
Running into Problems?¶
- Your account may not be verified yet, which means you can't download the model
- Occasionally the AVISO server goes down. Wait a few hours and try again and see if its working.
Troubleshooting¶
If you are running coastseg on a secure network you may need to make the following modifications to your .condarc
file.
- If you get an error message similar to
CondaValueError: You have chosen a non-default solver backend(libmamba) but it was not recongized
- Solution: comment out the line in the .condarc file
solve:libmamba
- You may also need to modify the
ssl_verify
to either True or False depending on your network security. - Always switch
ssl_verify
to True if you ever set it it to False for debugging purposes.
How to Perform Tide Correction¶
⚠️ You must have run the script to download the FES2014 tide model before attempting to correct tides This script provides utilities for modeling tides and correcting time series data based on tide predictions.
⚠️ Important: Read Before Using Tide Correction Button¶
If the tide model was NOT downloaded to CoastSeg/tide_model
then the tide correction button will NOT work. The tide correction button will try to load the tide model from <CoastSeg location>/tide_model
and an error will occur. Instead follow the instructions in at Option 2: Tide Correction Script
If you downloaded the tide model to a different location follow the instructions at Option 2: Tide Correction Script
to use the script apply_tidal_correction.py
Option 1: Tide Correction Button Method¶
Ever since coastseg 1.1.0 released you can now use the correct tides
button in coastseg to automatically correct the timeseries. This button will automatically find which files need to be tidally corrected and apply the tidal correction for you.
⚠️ Important¶
If the tide model was NOT downloaded to CoastSeg/tide_model
then the tide correction button will NOT work. The tide correction button will try to load the tide model from <CoastSeg location>/tide_model
and an error will occur. Instead follow the instructions in at Option 2: Tide Correction Script
Steps¶
WARNING
You must have downloaded the tide model to the tide_model
folder within coastseg for this button to work correctly.
1.Enter the beach slope
- This is the beach slope in meters for the ROI you have selected.
2.Enter the beach elevation
- This is the beach elevation in meters for the ROI you have selected.
3.Select the ROIs' ids to tidally correct
4.Click compute tides and wait a few minutes.
If you encounter any issues or have any questions please submit an issue at CoastSeg Issues
Option 2: Tide Correction Script¶
⚠️ If the tide model was NOT downloaded to CoastSeg/tide_model
, then you must use the tide correction script.
Example 1: Apply Tide Correction to a session and provide tide model location¶
- Choose a session
- In this example I will be using session
dnz3_extract_shorelines_10_yr
and using ROIID_dnz3_datetime12-22-23__09_10_44
- Example:
C:\development\doodleverse\coastseg\CoastSeg\sessions\dnz3_extract_shorelines_10_yr\ID_dnz3_datetime12-22-23__09_10_44
- Get the location of the config_gdf.geojson file
- This parameter is used after the
-C
- Example:
-C "C:\development\doodleverse\coastseg\CoastSeg\sessions\dnz3_extract_shorelines_10_yr\ID_dnz3_datetime12-22-23__09_10_44\config_gdf.geojson"
- Get the location of the transect_time_series.csv file
- This parameter is used after the
-T
- Example:
-T "C:\development\doodleverse\coastseg\CoastSeg\sessions\dnz3_extract_shorelines_10_yr\ID_dnz3_datetime12-22-23__09_10_44\transect_time_series.csv"
- Get the location of the tide_model
- This parameter is used after the
-M
- Example:
-M "C:\development\doodleverse\coastseg\CoastSeg\tide_model"
- Select a Beach Elevation
- This is the elevation of the beach in meters for the ROI you have selected
- Example:
-E 3.2
- Select a Beach Slope
- This is the slope of the beach in meters for the ROI you have selected
- Example:
-S 2.1
- Assemble the command
- Assemble all commands into a single line. I recommended using notepad to combine all the commands into a single line
1 2 3 4
python apply_tidal_correction.py -E 3.2 -S 2.1 -C "C:\development\doodleverse\coastseg\CoastSeg\sessions\dnz3_extract_shorelines_10_yr\ID_dnz3_datetime12-22-23__09_10_44\config_gdf.geojson" -T "C:\development\doodleverse\coastseg\CoastSeg\sessions\dnz3_extract_shorelines_10_yr\ID_dnz3_datetime12-22-23__09_10_44\transect_time_series.csv" -M "C:\development\doodleverse\coastseg\CoastSeg\tide_model"
- Run the command
- It takes a few minutes to predict the tides
Parameters:¶
-
-C (or -c) [CONFIG_FILE_PATH]
-
Description: Path to the configuration file.
- Example:
-C "path_to_config_file"
-
CONFIG_FILE_PATH
: Path to the configuration file. This is theconfig_gdf.geojson
in the session directory generated when shorelines were extracted -
-T (or -t) [RAW_TIMESERIES_FILE_PATH]
-
Description: Path to the raw timeseries file.
- Example:
-T "path_to_timeseries_file"
-
RAW_TIMESERIES_FILE_PATH
: Path to a csv file containing the time series created by extracting shorelines with coastseg. This timeseries represents the intersection of each transect with the shoreline extracted for a particular date and time. It is not tidally corrected. -
-E (or -e) [REFERENCE_ELEVATION]
-
Description: Set the reference elevation value. This is a float number.
-
Example:
-E 3
-
-S (or -s) [BEACH_SLOPE]
- Description: Set the beach slope value. This is a float number.
- Example:
-S 2
Optional Configuration Options¶
If you didn't install the tide model in the default location you will need to modify the following variables
-
-P (or -p) [TIDE_PREDICTIONS_FILE_NAME]
-
Description: File name for saving a csv file containing the tide predictions for each date time in the timeseries provided.
- By Default this file is named "tidal_predictions.csv"
-
Example:
-P "tidal_predictions.csv"
-
-O (or -o) [TIDALLY_CORRECTED_FILE_NAME]
-
Description: File name for saving the tidally corrected time series csv file.
- By Default this file is named "tidally_corrected_time_series.csv"
-
Example:
-O "tidally_corrected_time_series.csv"
-
-R (or -r) [MODEL_REGIONS_GEOJSON_PATH]
-
Description: Path to the model regions GeoJSON file.
- By default the program looks for
tide_regions_map.geojson
in thescripts
directory - Example:
-R "c:\coastseg\scripts\tide_regions_map.geojson"
-
MODEL_REGIONS_GEOJSON_PATH
: Path to the location of the geojson file containing the regions used to create the clipped tide model in the previous steps. This file is typically located in the scripts directory within coastseg. "c:\coastseg\scripts\tide_regions_map.geojson"` -
-M (or -m) [FES_2014_MODEL_PATH]
- Description: Path to the FES 2014 tide model directory.
- Example:
-M "c:\coastseg\tide_model"
FES_2014_MODEL_PATH
: Path to the FES 2014 tide model, by default attempts to load fromcoastseg\tide_model
if you installed the tide_model from step 3 in a different location modify this variable to have the full location to the directory containing the clipped 2014 fes tide model.
Running the script:¶
Use the parameters as described while executing the script. Here's an example usage: Example 1: Only Required Parameter
1 2 |
|
1 |
|
Example 2: All Available Parameters
1 2 |
|
1 2 |
|
Results¶
The results will be located in the scripts directory where the apply_tidal_correction.py
script is located.
tidal_predictions.csv
: Contains the tide predictions for each datetime in the timeseries csv file given byRAW_TIMESERIES_FILE_PATH
."tidally_corrected_time_series.csv"
: Contains the tidally corrected time series data based on the timeseries csv file given byRAW_TIMESERIES_FILE_PATH
.
Credits¶
Thank you DEA-Coastlines for making a guide on how to use pyTMD and pyTMD for making a easy to use script to download the AVISO FES 2014 Model.
The model_tides
in this code has been modified and the original function was originally written by Robbi Bishop-Taylor for the dea-tools
package https://github.com/GeoscienceAustralia/dea-notebooks/blob/develop/Tools/dea_tools/coastal.py#L466-L473