toto.plugins.wave.wave_spectra¶
- class toto.plugins.wave.wave_spectra.WaveAnalysis(pandas_obj)[source]¶
Bases:
object- ssh_to_wave(sea_level='sea_level', args={'crossing': {'downcrossing': True, 'upcrossing': False}, 'detrend': {'Off': True, 'constante': False, 'linear': False}, 'method': {'spectra': True, 'zero-crossing': False}, 'minimum number of waves per window for zero crossing analysis': 30, 'nfft': 3600, 'overlap': 1800, 'wave period range (min and max) (in s)': [3, 25], 'windows': 3600})[source]¶
This function transform a timeseries of elevation to Hs using: -Spectra method - zero-crossing method
Parameters¶
- sea_levelstr
Name of the column which contains the sea level.
- args: dict
Dictionnary with the folowing keys: units: str
Units of the sea level
- windows: int
windows to process in seconds.
- overlap: int
overlap in seconds
- nfft: int
Length of the signal to calculate the Fourier transform of.
- detrend: str
linear, constante or Off to detrend the timeseries before doing the analysis
- wave period range (min and max) (in s): list
Calulating wave within this Wave period
- method: str
Can be spectra or zero-crossing depending what method to use
- minimum number of waves per window for zero crossing analysis: int
Minimum number of waves per window for zero crossing analysis
- crossing: str
Can be downcrossing or upcrossing. Method to use if not using the spectra method
Examples:¶
>>> df=tf['test1']['dataframe'].WaveAnalysis.ssh_to_wave(sea_level='ssh',args={'method'='spectra',windows:3600,'nfft':3600,'overlap':3600) >>>
- wave_spectra(sea_level='sea_level', args={'detrend': {'Off': True, 'constante': False, 'linear': False}, 'display': {'Off': False, 'On': True}, 'folder out': '/home/docs/checkouts/readthedocs.org/user_builds/totodoc/checkouts/latest/docs', 'nfft': 3600, 'overlap': 1800, 'period (s) min and max for plotting': [10, 1000], 'units': 'm', 'windows': 3600, 'xaxis': {'frequency': False, 'period': True}})[source]¶
This function estimated the 1D wave spectrum (Power Spectral Density) and plot it
Parameters¶
- sea_levelstr
Name of the column which contains the sea level.
- args: dict
Dictionnary with the folowing keys: units: str
Units of the sea level
- windows: int
windows to process in seconds.
- overlap: int
overlap in seconds
- nfft: int
Length of the signal to calculate the Fourier transform of.
- detrend: str
linear, constante or Off to detrend the timeseries before doing the analysis
- period (s) min and max for plotting: list
X axis limit in seconds
- xaxis: str
Can be period or frequency depending what on the type of plot
- display: str
On or Off to display image
- folder out: str
Path to save the output
Examples:¶
>>> df=tf['test1']['dataframe'].WaveAnalysis.wave_spectra(sea_level='ssh',args={'windows:3600,'nfft':3600,'overlap':3600) >>>
- wavelet_analysis(sea_level='sea_level', args={'display': {'Off': False, 'On': True}, 'folder out': '/home/docs/checkouts/readthedocs.org/user_builds/totodoc/checkouts/latest/docs', 'mother wavelet': {'DOG': False, 'Morlet': True, 'Paul': False}, 'number of sub-ocatve per period band': 8, 'units': 'm', 'wave period range (min and max) (in s)': [3, 25]})[source]¶
This function estimates the wavelet power spectrum of a time series, as well as the scaled-averaged wavelet power time series within a specific period band. The code is based on the wavelet toolbox from Torrence and Compo See https://paos.colorado.edu/research/wavelets/software.html
Parameters¶
- sea_levelstr
Name of the column which contains the sea level.
- args: dict
Dictionnary with the folowing keys: units: str
Units of the sea level
- mother wavelet: str
Can be Morlet,`Paul` or DOG
- wave period range (min and max) (in s): list
Calulating wave within this Wave period
- number of sub-ocatve per period band: int
Number of sub-ocatve per period band
- display: str
On or Off to display image
- folder out: str
Path to save the output
Examples:¶
>>> df=tf['test1']['dataframe'].WaveAnalysis.wavelet_analysis(sea_level='ssh',args={}) >>>