SatelliteShorelines / SDS_Benchmark

Benchmarking of satellite-derived shoreline mapping techniques
GNU General Public License v3.0
16 stars 10 forks source link

Discussion about the bencharking exercise #3

Open kvos opened 1 year ago

kvos commented 1 year ago

Post to discuss various things about the benchmarking project.

dbuscombe-usgs commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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

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 commented 1 year ago

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

kvos commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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

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 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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