Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Automatic Tide Correction Button #172

Closed
5 tasks done
2320sharon opened this issue Aug 15, 2023 · 2 comments
Closed
5 tasks done

Feature Request: Automatic Tide Correction Button #172

2320sharon opened this issue Aug 15, 2023 · 2 comments
Assignees
Labels
enhancement New feature or request V1 Version 1 of Coastseg

Comments

@2320sharon
Copy link
Collaborator

2320sharon commented Aug 15, 2023

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:

  • Create a new branch for the prototype of this feature
  • Create a new error type if the FES 2014 model isn't found
  • Create a new error type if the FES 2014 model isn't clipped properly
  • Catch errors related to the FES 2014 model not being downloaded/clipped
  • Change the on_click handler for the correct tide button to use this new method
@2320sharon 2320sharon added the enhancement New feature or request label Aug 15, 2023
@2320sharon 2320sharon self-assigned this Aug 15, 2023
@dbuscombe-usgs
Copy link
Member

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 2320sharon added the V1 Version 1 of Coastseg label Aug 24, 2023
2320sharon added a commit that referenced this issue Aug 29, 2023
@2320sharon
Copy link
Collaborator Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request V1 Version 1 of Coastseg
Projects
None yet
Development

No branches or pull requests

2 participants