Recently I developed some code to create spectra from the ‘raw’ displacement data which is output from Datawell Waverider MKII/MKIII buoys. Part of the reason for doing this was to see the effect that filtering the displacement data had on the spectra produced and also to emulate and understand the spectra creation that takes place in Datawell’s W@ves21 software.
It was also to improve my understanding of fourier transforms and the functionality there was available to carry out these transforms in the Python ecosystem. I developed this code using Scipy and Welch’s method. This is a similar approach to what Datawell describe in their Waverider manual. A number of segments are taken, in this case 8 segments of 256 records.
I made use of the IPython Notebook to develop the code, I felt the ability to use inline plots and export as a PDF or upload as a gist and then render using nbviewer was useful. The ability to share the code with text output, plots and a narrative description in Markdown is quite powerful in my opinion, also using a gist allows version control of the ipynb file.
This approach can read in an existing raw file or make use of the displacement DataFrames created by hebtools. This allows spectra to be averaged over longer periods to get an average for a month or any length of time greater than 200 seconds. The monthly plots can show spectral change over the year. It also allows easy inter buoy spectral comparison.
Potential differences between the W@ves21 output may come from the way in which points are binned this could explain some of the sharp peaks seen in the Datawell output which is spread between two points in the output from the Scipy implementation of Welch’s method.
The rendered output can be viewed here