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

Discussion about the bencharking exercise #3

Open
kvos opened this issue Oct 21, 2022 · 14 comments
Open

Discussion about the bencharking exercise #3

kvos opened this issue Oct 21, 2022 · 14 comments

Comments

@kvos
Copy link
Member

kvos commented Oct 21, 2022

Post to discuss various things about the benchmarking project.

@dbuscombe-usgs
Copy link
Member

Team CoastSeg are still working on finalizing the tool so we can ready our submission. We're now at the stage of trying to figure out the tidal correction using fes14, and wrap that into the CoastSeg workflow. Hopefully we can make this process a little more streamlined - the tidal correction is unnecessarily complicated, in my opinion.

Then, we are going to work on the codes needed to identify the shoreline from a Zoo model output.

Quick question: did you say you only want raw and tidally corrected timeseries submitted? i.e. no outlier detection? Or did you say you only wanted cleaned up time-series submitted?

@kvos
Copy link
Member Author

kvos commented Mar 3, 2023

hey @dbuscombe-usgs
For the purpose of the benchmark no need to integrate FES2014, I already extracted the tide time-series at each site and included them in a .csv under /datasets. Just apply tidal correction using the tide levels and beach-face slope provided as this guarantees that there is no bias associated with the data sources.
I already have a draft of the manuscript but happy to see how I can integrate CoastSeg if you are submitting soon, maybe in the discussion as an extra comparison. If you still need a few weeks, it can always fit in a second iteration with more algorithms and more benchmark sites. Submit the best product that you can get in fully automated mode, so outlier detection is ok if it's generalised and automated but no manual discarding of images etc... If you can submit the raw time-series, tidally-corrected to MSL and tidally-corrected to MHWS (I've put those values for each site based on the vertical datum of the tide levels provided). I can also do the tidal correction if you submit raw intersections between transects and waterlines.

@dbuscombe-usgs
Copy link
Member

dbuscombe-usgs commented Mar 3, 2023

Thanks for the offer, but I know how to apply the tide csv. My questions are about how to make it more sane and easier for users to apply tides in CoastSeg, which means better info on how to generate the tide csv files, including the ini files.

No manual outlier-filtering. Got it.

We're not submitting imminently but we'll make a submission eventually when we're ready. Other projects always take priority. We still need to figure out how to complete the coastsat port. The tide stuff is slowing us down. then we need to figure out how to modify your functiosn to integrate my classifiers. So, if you are ready to submit I suppose we missed the boat, and no worries!

@kvos
Copy link
Member Author

kvos commented Mar 3, 2023

yes I agree setting up fes2014 is not straight forward as it involves creating an Aviso+ account, downloading the 8GB of .nc files, changing the paths on the .ini files and installing pyfes which sometimes clashes with coastsat dependencies. I don't really have a better solution as that's the only way I have managed to get it to run with coastsat.

Fes2022 should be coming out soon, at least that's what I've heard from CNES.

Another thing that helps is to only use the gridded points to query the tides as sometimes it does some weird things when interpolating, so what I usually do is to open one .nc file, then find the closest grid point to the coordinates of my beach and then get the tides for that grid point.

I hope this helps

@dbuscombe-usgs
Copy link
Member

Its a disappointing situation. That doesn't help much. As it stands,

  • I don't have access to the AVIOS data. 'ocean tide' and ini files are missing
  • its really unsustainable that everyone has to download tides and make an ini file and then try to work with pyfes to make a csv file. pyfes is completely undocumented and unmaintained.
  • because of this, we're now having to rethink coastseg. the purpose of coastseg - principally - is to make coastsat easier to use and to make it more sustainable for longterm use by the usgs. this tide situation is going to slow up down quite a bit because we'll need to figure out an alternative
  • is fes22 going to be the same user account / doanload situation , or an open data set with a proper API?

On the paper, it is disappointing we will not be involved, but I also understand, and in fact, it may be better in the long run. CoastSeg will need its own paper - we have made many advances, both algorithmically and, probably more important, usability. We will likely want to test it at many more sites, so we get a real feel for how well we can scale it up to entire continents. We just need more time to figure out and refine the workflow; anything we write up now will be out of date before it hits the shelves

@dbuscombe-usgs
Copy link
Member

I assume there is no API that allows you to get modeled tides at a coordinate?

@kvos
Copy link
Member Author

kvos commented Mar 9, 2023

hey @dbuscombe-usgs ,

check the other tide models in this paper https://agupubs.onlinelibrary.wiley.com/doi/full/10.1002/2014RG000450. I chose fes2014 cause it looked accurate in the coastal zone but others are good too, maybe they're more user friendly.

you could store the .nc files in a cloudbucket (maybe ask aviso if it's ok), or even directly create an entry point to a pyfes environment with access to the data with AWS sagemaker for example. don't loose hope there must be a workaround to integrate it!

sorry for the benchmark paper, I've waited quite a bit for everybody to submit their shorelines and I feel it's now time to wrap up the first iteration, I've put the results in here
https://github.com/SatelliteShorelines/SDS_Benchmark/blob/main/3_evaluate_submissions_Landsat_MSL.ipynb

I'm excited to see the algorithmic changes in CoastSeg and how they perform in terms of shoreline accuracy.

@dbuscombe-usgs
Copy link
Member

Cool, and no worries. We're likely switching to the pyTMD multi-model API, which includes a really streamlined way to access FES14, plus it incorporates a lot more models that will be beneficial in polar locations

@robbibt
Copy link
Collaborator

robbibt commented Mar 22, 2023

Hey @dbuscombe-usgs - we've had great success with pyTMD for our DEA/DE Africa Coastlines work: it's a really nice and flexible package, and the author (@tsutterley) is really responsive to bugfixes and feature requests. It's also really easy to install via pip, although you'll still need to download the ~8 gb FES2014 files, same as for pyfes. We've used it in some of the coastal remote sensing Python functions in our dea-tools package here: https://github.com/GeoscienceAustralia/dea-notebooks/blob/develop/Tools/dea_tools/coastal.py#L224-L1065

  • model_tides: A simple wrapper func that supports modelling tide heights for a set of XY points and multiple timesteps
  • tidal_tag: Models a single tide height for each image in a satellite timeseries, using either the centroid of the image or custom XY coords as the tide modelling post
  • pixel_tides: A more advanced tide tagging function designed to model tide heights for every pixel in a satellite timeseries (i.e. essentially creating an (X, Y, time) array of tide heights) - tides are modelled for a low-res grid covering each satellite image, then resampled into the dimensions of each image
  • tidal_stats: Calculates some useful statistics for how the proportion of the tide range observed in a satellite time series compares to the actual astronomical tide range (useful for detecting biases towards different tide conditions)

Demo notebook here: https://docs.dea.ga.gov.au/notebooks/Frequently_used_code/Tidal_modelling.html

The only limitation of pyTMD is that I think it's all based on pure Python code, so it can be significantly slower than pyfes. For FES2014 though we've found that we could clip the input NetCDF files to just e.g. the extent of the continent you're interested in for a huge speedup - e.g. a tidal analysis for Australia that once took ~2 minutes takes only a few seconds on input data clipped to Australia (and those files now only take up ~200 mb vs several gigabytes).

@dbuscombe-usgs
Copy link
Member

Hi @robbibt great advice, thanks!!! We found pyTMD last week and started looking into it. We already decided to go this route, partly because we noticed you guys at DEA were using it. But, I wasn't aware of all the handy functions within the dea-tools package - fantastic! Can't wait to give it a try!

@kvos
Copy link
Member Author

kvos commented Mar 23, 2023

thanks @robbibt for the input! I love the wrapper of the wrapper. so you don't need to download the tidal constituents anymore (8GB of .nc files)?

@robbibt
Copy link
Collaborator

robbibt commented Mar 24, 2023

Hey @kvos, unfortunately it's not that smart yet - you still need an AVISO+ account and have to download the 8gb of .nc files as a first step (https://github.com/GeoscienceAustralia/dea-coastlines/wiki/Setting-up-tidal-models-for-DEA-Coastlines). A function to actually use AVISO+ login details to access, download and clip the tidal files would be fantastic though - we did this manually by downloading them then clipping them to Australia using gdal.

The model_tides wrapper func is there because the existing funcs in pyTMD weren't optimal for a coastal remote sensing case where you want to model tides across time for a set of stationary x/y points (e.g. calculating tide heights for each satellite image in a time series). The model_tide func makes this more efficient by only loading tidal constituents once for each x/y point, then re-using them to model tides for every timestep (in time I'm hoping to contribute this back to pyTMD so it's available there without requiring dea_tools).

@tsutterley
Copy link

Hi all, just a quick note. Be sure to pin pyTMD to <2 when using model_tides. I refactored the model io for version 2 (hopefully for the better). I think I also made the improvements to handle this use case more efficiently.
Let me know if you need anything! Cheers.

@robbibt
Copy link
Collaborator

robbibt commented Mar 25, 2023

Thanks @tsutterley! We have an issue here to update to pyTMD version 2.0 - hoping to get that done soon. 😃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants