kvos / CoastSat.slope

Beach-face slope estimation from satellite-derived shorelines, extension of the CoastSat toolbox.
http://coastsat.wrl.unsw.edu.au/
GNU General Public License v3.0
59 stars 17 forks source link

Running CoastSat on Google Colab - Problem with pyfes: module 'pyfes' has no attribute 'Handler' #35

Open cianfabio opened 10 months ago

cianfabio commented 10 months ago

Hi, I'm trying to run CoastSat on Colab. I managed to get it running until the point where pyfes is needed. I managed to install pyfes but when I run the following line:

# Option 1. if FES2014 global tide model is setup
# point to the folder where you downloaded the .nc files
filepath = r'/content/drive/MyDrive/aviso-fes-main/data/fes2014'
config_ocean = os.path.join(filepath, 'ocean_tide.ini') # change to ocean_tide.ini
config_load =  os.path.join(filepath, 'load_tide.ini')  # change to load_tide.ini
ocean_tide = pyfes.Handler("ocean", "io", config_ocean)
load_tide = pyfes.Handler("radial", "io", config_load)

I get the following error:

AttributeError                            Traceback (most recent call last)
[<ipython-input-14-f2ca7493019e>](https://localhost:8080/#) in <cell line: 7>()
      5 config_ocean = os.path.join(filepath, 'ocean_tide.ini') # change to ocean_tide.ini
      6 config_load =  os.path.join(filepath, 'load_tide.ini')  # change to load_tide.ini
----> 7 ocean_tide = pyfes.Handler("ocean", "io", config_ocean)
      8 load_tide = pyfes.Handler("radial", "io", config_load)
      9 

AttributeError: module 'pyfes' has no attribute 'Handler'

Any idea? Thanks

kvos commented 6 months ago

hi @cianfabio , I'm not sure how I can help here. How did you install pyfes? with https://anaconda.org/fbriol/pyfes?

Phuongtran75 commented 4 months ago

hi @cianfabio , I'm not sure how I can help here. How did you install pyfes? with https://anaconda.org/fbriol/pyfes? Hi @kvos, I installed successful pyfes but I still get error: --------------------------------------------------------------------------- AttributeError Traceback (most recent call last) Cell In[7], line 7 5 config_ocean = os.path.join(filepath, 'ocean_tide.ini') # change to ocean_tide.ini 6 config_load = os.path.join(filepath, 'load_tide.ini') # change to load_tide.ini ----> 7 ocean_tide = pyfes.Handler("ocean", "io", config_ocean) 8 load_tide = pyfes.Handler("radial", "io", config_load) 10 # coordinates of the location (always select a point 1-2km offshore from the beach) 11 # if the model returns NaNs, change the location of your point further offshore.

AttributeError: module 'pyfes' has no attribute 'Handler'.

My pyfes: Loading channels: done

Name Version Build Channel

pyfes 2024.6.0 py310hf888d8c_0 conda-forge pyfes 2024.6.0 py310hf888d8c_1 conda-forge pyfes 2024.6.0 py311h9e06789_0 conda-forge pyfes 2024.6.0 py311h9e06789_1 conda-forge pyfes 2024.6.0 py312hae45661_0 conda-forge pyfes 2024.6.0 py312hae45661_1 conda-forge

Can you give me ideas to solve it?

Changer-er commented 2 months ago

HI @Phuongtran75 , I have solved this question. Through checking the API of FES(https://cnes.github.io/aviso-fes/pyfes.html#confguration-file), the latest version of FES makes use of 'pyfes.config.load(path: str | PathLike) ' to load tide model. And I find the file type of config file changed from ini to yaml.

kvos commented 1 month ago

hi all, there is a problem as the fes package has completely change as you observed. I haven't updated the CoastSat.slope package yet, but I incorporated FES2022 into the main CoastSat toolbox so you should be able to run the slope estimation from there. Check https://github.com/kvos/CoastSat/blob/master/doc/FES2022_setup.md