⚠️ Before you begin ⚠️¶
Make sure you have downloaded the FES2014 tide model following the guide 'How to Download the Tide Model'
Apply Tide Correction Script¶
Example 1: Apply Tide Correction to a session and provide tide model location¶
1.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
2.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"
3.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"
4.Get the location of the tide_model
- This parameter is used after the
-M
- Example:
-M "C:\development\doodleverse\coastseg\CoastSeg\tide_model"
5.Select a Beach Elevation
- This is the elevation of the beach in meters relative to MSL(Mean Sea Level) for the ROI you have selected
- Example:
-E 3.2
6.Select a Beach Slope
- This is the slope of the beach in meters for the ROI you have selected
- Example:
-S 2.1
7.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 |
|
8.Run the command
- It takes a few minutes to predict the tides
Parameters:¶
1.-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
2.-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.
3.-E (or -e) [REFERENCE_ELEVATION]
- Description: Set the reference elevation value. This is a float number.
- Example:
-E 3
4.-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
5.-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"
6.-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"
7.-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"`
8.-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 in a different location then CoastSeg/tide_model then 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