FileNotFoundError
I am trying to follow Plot Tide Forecasts.ipynb notebook for obtaining earth and ocean tides times series at a certain inland point at the Canary Islands, and for a determined period range. Nevertheless, it is being a bit hard to understand how the program works and the inputs it requieres.
I have downloaded the EOT20 model data, since I think could be the most updated model within the area, and have linked it to the dir path in the widget box of the notebook -adding also the spatial coordinates of the desired point.
After executting the next cell for getting model parameters and creating plot with tidal displacements, aFileNotFoundError: is shown, not being able the program to find the model files.
I dont know if I am doing the right thing. I miss some documentation on how the ocean tide models are configured and how are used the functions and classes of the program.
Any help on this is welcome. Thanks by advance.
Cell In[6], line 7
1 get_ipython().run_line_magic('matplotlib', 'widget')
3 # get model parameters
4 model = pyTMD.io.model(TMDwidgets.directory.value,
5 format=TMDwidgets.atlas.value,
6 compressed=TMDwidgets.compress.value
----> 7 ).elevation(TMDwidgets.model.value)
9 # convert from calendar date to days relative to Jan 1, 1992 (48622 MJD)
10 YMD = TMDwidgets.datepick.value
File ~\miniconda3\envs\pytmd\Lib\site-packages\pyTMD\io\model.py:628, in model.elevation(self, m)
617 self.model_directory = self.directory.joinpath(
618 'EOT20','ocean_tides')
619 model_files = ['2N2_ocean_eot20.nc','J1_ocean_eot20.nc',
620 'K1_ocean_eot20.nc','K2_ocean_eot20.nc',
621 'M2_ocean_eot20.nc','M4_ocean_eot20.nc',
(...)
626 'SA_ocean_eot20.nc','SSA_ocean_eot20.nc',
627 'T2_ocean_eot20.nc']
--> 628 self.model_file = self.pathfinder(model_files)
629 self.constituents = ['2n2','j1','k1','k2','m2','m4',
630 'mf','mm','n2','o1','p1','q1','s1','s2','sa',
631 'ssa','t2']
632 self.scale = 1.0/100.0
File ~\miniconda3\envs\pytmd\Lib\site-packages\pyTMD\io\model.py:1231, in model.pathfinder(self, model_file)
1229 # check that (all) output files exist
1230 if self.verify and not valid:
-> 1231 raise FileNotFoundError(output_file)
1232 # return the complete output path
1233 return output_file
FileNotFoundError: [WindowsPath('C:/Users/MiguelGJ/Downloads/borrar/EOT20/ocean_tides/EOT20/ocean_tides/2N2_ocean_eot20.nc'), WindowsPath('C:/Users/MiguelGJ/Downloads/borrar/EOT20/ocean_tides/EOT20/ocean_tides/J1_ocean_eot20.nc'), WindowsPath('C:/Users/MiguelGJ/Downloads/borrar/EOT20/ocean_tides/EOT20/ocean_tides/K1_ocean_eot20.nc'), WindowsPath('C:/Users/MiguelGJ/Downloads/borrar/EOT20/ocean_tides/EOT20/ocean_tides/K2_ocean_eot20.nc'), WindowsPath('C:/Users/MiguelGJ/Downloads/borrar/EOT20/ocean_tides/EOT20/ocean_tides/M2_ocean_eot20.nc'), WindowsPath('C:/Users/MiguelGJ/Downloads/borrar/EOT20/ocean_tides/EOT20/ocean_tides/M4_ocean_eot20.nc'), WindowsPath('C:/Users/MiguelGJ/Downloads/borrar/EOT20/ocean_tides/EOT20/ocean_tides/MF_ocean_eot20.nc'), WindowsPath('C:/Users/MiguelGJ/Downloads/borrar/EOT20/ocean_tides/EOT20/ocean_tides/MM_ocean_eot20.nc'), WindowsPath('C:/Users/MiguelGJ/Downloads/borrar/EOT20/ocean_tides/EOT20/ocean_tides/N2_ocean_eot20.nc'), WindowsPath('C:/Users/MiguelGJ/Downloads/borrar/EOT20/ocean_tides/EOT20/ocean_tides/O1_ocean_eot20.nc'), WindowsPath('C:/Users/MiguelGJ/Downloads/borrar/EOT20/ocean_tides/EOT20/ocean_tides/P1_ocean_eot20.nc'), WindowsPath('C:/Users/MiguelGJ/Downloads/borrar/EOT20/ocean_tides/EOT20/ocean_tides/Q1_ocean_eot20.nc'), WindowsPath('C:/Users/MiguelGJ/Downloads/borrar/EOT20/ocean_tides/EOT20/ocean_tides/S1_ocean_eot20.nc'), WindowsPath('C:/Users/MiguelGJ/Downloads/borrar/EOT20/ocean_tides/EOT20/ocean_tides/S2_ocean_eot20.nc'), WindowsPath('C:/Users/MiguelGJ/Downloads/borrar/EOT20/ocean_tides/EOT20/ocean_tides/SA_ocean_eot20.nc'), WindowsPath('C:/Users/MiguelGJ/Downloads/borrar/EOT20/ocean_tides/EOT20/ocean_tides/SSA_ocean_eot20.nc'), WindowsPath('C:/Users/MiguelGJ/Downloads/borrar/EOT20/ocean_tides/EOT20/ocean_tides/T2_ocean_eot20.nc')]```
Hi @MiguelonGonzalez,
Good question. This option points to a base directory so that multiple tide models can be run with the same selection. Should work if you make the directory C:/Users/MiguelGJ/Downloads/borrar/
-ts