SatelliteShorelines / CoastSeg

An interactive toolbox for downloading satellite imagery, applying image segmentation models, mapping shoreline positions and more. The mapping extension for CoastSat and Zoo.
https://satelliteshorelines.github.io/CoastSeg/
GNU General Public License v3.0
46 stars 9 forks source link

Feature Request: Automatic Tide Correction Button #172

Closed 2320sharon closed 1 year ago

2320sharon commented 1 year ago

Automatic Tide Correction Button

Description: Background: Users need a way to automatically correct the tides. The current method requires users to visit the FES website, download the FES 2014 model manually, and then create tides for a time series manually. This process can take hours to complete.

Proposed Solution: A button should be introduced such that, when pressed after extracting shorelines, the tides will automatically be computed for each transect's seaward point for each time a shoreline intersected with the transect. The program will verify if the FES 2014 model has been downloaded. If it hasn't been downloaded or clipped properly, an error will be raised. Upon pressing the button, two CSV files will be generated: tide_predictions.csv and tidally_corrected_time_series.csv. The time series for each individual transect saved to a CSV will also be corrected, generating a new CSV file named tidally_corrected_<original_file_name>.csv.

Alternative Solutions: Feel free to suggest alternative solutions. Should this correction be done automatically when shorelines are extracted? If so, what should be the course of action if the user hasn't downloaded the tide model?

Related Issues

134

124

Benefits:

  1. Simplifies the process of tide correction.
  2. Facilitates the downloading of the tide model.
  3. Enhances the accuracy of the tide correction over the method Coastsat uses by computing a tide prediction for each transect's seaward point instead of just the centroid of the image.

Drawbacks:

  1. The model is extensive, occupying 14.6 GB.
  2. Tide predictions are time-consuming, averaging about 2-3 minutes to compute a time series spanning 5-6 years.
  3. Necessitates the user to execute a script/separate application to download the FES 2014 model.

Questions:

  1. Would it be beneficial to introduce a new notebook that the user can execute to download the model?

Checklist:

dbuscombe-usgs commented 1 year ago

Great. The cherry on the top of V1!!

Should this correction be done automatically when shorelines are extracted? If so, what should be the course of action if the user hasn't downloaded the tide model?

No, it should not be done automatically. In the end, users will always want 3 files:

  1. raw_time_series.csv
  2. tidally_corrected_time_series.csv
  3. tide_predictions.csv

as well as the per-transect files

The model is extensive, occupying 14.6 GB. Tide predictions are time-consuming, averaging about 2-3 minutes to compute a time series spanning 5-6 years. Necessitates the user to execute a script/separate application to download the FES 2014 model.

It is what it is. As long as this info is clearly communicated, nobody will mind. It greatly simplifies the process of acquiring tidal estimates and applying corrections, so the drawbacks are minor IMO

Would it be beneficial to introduce a new notebook that the user can execute to download the model?

I think users should be comfortable running the scripts in https://github.com/Doodleverse/CoastSeg/tree/main/scripts

As for the link to the slope database, please note that slopes are not yet available for all transects, but the majority. So users still should input a known beach slope if they can, and use the slope database as a fall-back. If no slope is inputted or available, no tidal correction can happen and a warning should appear (I think you have already done that)

2320sharon commented 1 year ago

This feature has been added in coastsat-package 0.1.16. There is a new button that says correct tides. I've also added custom error messages if the tide_model is missing or not clipped correctly. This button will compute the tides for each ROI selected in the select multiple box and correct the tides.

The beach slope and reference elevation are saved in the transect settings. The time series for tidally corrected time series are saved for both each transect ID and for all the transects. pip install coastseg==0.0.75dev8