kvos / CoastSat

Global shoreline mapping tool from satellite imagery
http://coastsat.space
GNU General Public License v3.0
696 stars 252 forks source link

Issue with FES 2022 Tidal Model #545

Open Coastalsurfer opened 3 weeks ago

Coastalsurfer commented 3 weeks ago

I have been running through the code in spyder section by section and am getting stuck on this error for the Tidal section.

import pyfes

enter the location of where you downloaded the FES2022 data

filepath = os.path.join('Tides','fes2022b','tidemodel','fes2022b') config = os.path.join(filepath, 'fes2022.yaml') handlers = pyfes.load_config(config) ocean_tide = handlers['tide'] load_tide = handlers['radial'] Traceback (most recent call last):

Cell In[2], line 5 handlers = pyfes.load_config(config)

File ~\anaconda3\envs\coastsat\lib\site-packages\pyfes\config.py:519 in load models[key] = _load_model(user_settings[key], tidal_type=key)

File ~\anaconda3\envs\coastsat\lib\site-packages\pyfes\config.py:487 in _load_model return Cartesian(**settings['cartesian']).load()

File :11 in init

File ~\anaconda3\envs\coastsat\lib\site-packages\pyfes\config.py:232 in __post_init__ raise err from None

File ~\anaconda3\envs\coastsat\lib\site-packages\pyfes\config.py:230 in __post_init__ list(map(core.constituents.parse, self.paths))

ValueError: invalid tidal constituent: 2

kvos commented 3 weeks ago

did you download the netcdf files and edited the fes2022.yaml file?

Coastalsurfer commented 3 weeks ago

Yes, i downloaded the data and edited the YAML file it looks like this.

radial: cartesian: amplitude: amplitude latitude: lat longitude: lon paths: 2N2:'C:/Users/mrdde/CoastSat/Tides/fes2022b/tidemodel/fes2022b/load_tide/2n2_fes2022.nc' Eps2:'C:/Users/mrdde/CoastSat/Tides/fes2022b/tidemodel/fes2022b/load_tide/eps2_fes2022.nc' J1:''C:/Users/mrdde/CoastSat/Tides/fes2022b/tidemodel/fes2022b/load_tide/j1_fes2022.nc' K1:''C:/Users/mrdde/CoastSat/Tides/fes2022b/tidemodel/fes2022b/load_tide/k1_fes2022.nc' K2:''C:/Users/mrdde/CoastSat/Tides/fes2022b/tidemodel/fes2022b/load_tide/k2_fes2022.nc'

kvos commented 3 weeks ago

try removing the apostrophe from the path ' and "

Coastalsurfer commented 3 weeks ago

I removed the quote and am still getting the same error. Originally I was having issues with the pyfes package with it not recognizing the load.config command but updated pyfes and seemed to fix that problem. My current pyfes version says 2024.6.0

kvos commented 3 weeks ago

that version should be correct.

kvos commented 3 weeks ago

I'm pretty sure it's something with the filename, as it's looking for a tidal constituent that doesn't exist, pls check all 34 files to make sure they're correct paths and names and the files exist