metocean / wavespectra

MIT License
1 stars 1 forks source link

module 'wavespectra' has no attribute 'read_ndbc' #40

Open guin0x opened 2 years ago

guin0x commented 2 years ago

Hi guys,

I just came accross the wavespectra module and it seems very interesting but I'm struggling to use it. I use Windows and I can't install it via pip install nor conda install wavespectra -c conda-forge.

I tried then just downloading the files and having them in the same folder so I could import wavespectra, but when I try to run wavespectra.read_ndbc I get the error from the subject of this issue.

Any ideas?

Thank you.

OttavioM commented 2 years ago

Hello,

It is late to answer you and maybe you already found out what was the problem, however, it means that the wavespectra package does not provide the read_ndbc attribute.

You can find all readable input files in wavespectra/wavespectra/input. This folder contains all the files that can be opened by the package. If you already compiled with the MEM method the NDBC directional wave spectrum, I suggest you only change the name of the variable in the xarray of the NDBC to be readable from the wavespectra class (see for example the netCDF ofWW3).

guin0x commented 2 years ago

Hi Ottavio, Thank you for your reply. No, I didn't solve it before... the package is not working properly here on my PC. I tried installing it with conda install wavespectra -c conda-forge but it didn't work properly.

And if I just download the folder and add to the same folder as my scripts and try to import wavespectra it returns:

image

I'm new to Python so I'm not sure what is going on.

Thanks anyway for your time.

OttavioM commented 2 years ago

Hello guin0x,

I am also not a pro in Python, however, you did not install the packages required for the wavespectra tool, I see that the dask and yaml are not installed.

The staff of metOcean provided a guide to install their tool, however, I will resume in the attached file some passages. I always use Spyder which uses the PYTHONPATH. I am not so familiar with Jupyter, I believe that its uses the JupyterPath, anyway there is a solution that I do not like but it works perfectly.

Did you compile the directional wave spectrum following the NOAA manual? They provide the First Five and you need to compile the direcitonal wave spectrum, Once it is in format of efth(freq,dir,time) then you can save the netCDF and open with xarray and then you can use the wave spectra. There is not the implementation to compile the direcitonal wave spectrum from the NDBC database.

Captura

rafa-guedes commented 2 years ago

There are currently two versions of wavespectra, one maintained by metocean and one maintained by the original developers which is hosted at https://github.com/wavespectra/wavespectra and is the one installed by pip install or conda install and consistent with the documentation. The split occurred 3 years ago and the libraries no longer look the same.

guin0x commented 2 years ago

Hi Rafael,

Thanks for the clarification. I still can't get it to work.. if I try conda install -c conda-forge wavespectra nothing happens... if I try pip install wavespectra I get the following error:

image

I also tried to download the folder 'wavespectra' from https://github.com/wavespectra/wavespectra, which I saw has the 'ndbc' file inside input; but still couldn't make it work... I can import wavespectra now without any errors, but if I try to from wavespectra import read_ndbc or something like this... nothing works..

Any ideas what might be the issue?

Thanks once again.