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

Issue with FES 2022 Tidal Model #545

Open
Coastalsurfer opened this issue Oct 27, 2024 · 6 comments
Open

Issue with FES 2022 Tidal Model #545

Coastalsurfer opened this issue Oct 27, 2024 · 6 comments

Comments

@Coastalsurfer
Copy link

Coastalsurfer commented Oct 27, 2024

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','tide_model','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
Copy link
Owner

kvos commented Oct 28, 2024

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

@Coastalsurfer
Copy link
Author

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/tide_model/fes2022b_/load_tide/2n2_fes2022.nc'
Eps2:'C:/Users/mrdde/CoastSat/Tides/fes2022b/tide_model/fes2022b_/load_tide/eps2_fes2022.nc'
J1:''C:/Users/mrdde/CoastSat/Tides/fes2022b/tide_model/fes2022b_/load_tide/j1_fes2022.nc'
K1:''C:/Users/mrdde/CoastSat/Tides/fes2022b/tide_model/fes2022b_/load_tide/k1_fes2022.nc'
K2:''C:/Users/mrdde/CoastSat/Tides/fes2022b/tide_model/fes2022b_/load_tide/k2_fes2022.nc'

@kvos
Copy link
Owner

kvos commented Oct 28, 2024

try removing the apostrophe from the path ' and "

@Coastalsurfer
Copy link
Author

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
Copy link
Owner

kvos commented Nov 1, 2024

that version should be correct.

@kvos
Copy link
Owner

kvos commented Nov 1, 2024

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

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

2 participants