WaLSAtools¶
WaLSAtools is designed for ease of use and accessibility. Its interactive interface guides you through the analysis process, providing clear instructions and helpful information at each step. This section demonstrates how to use WaLSAtools and highlights its key features.
Before diving into the interactive demonstration, we recommend familiarizing yourself with the various analysis methods available in WaLSAtools. You can find detailed descriptions of these methods in the Introduction section. Additionally, this page provides several Worked Examples of different analysis techniques applied to synthetic datasets (see the left menu). To learn more about its capabilities and how to apply it to your research, we encourage you to explore the WaLSAtools documentation, the associated Nature Reviews Methods Primers article, and the provided examples. If you use WaLSAtools in your work, please remember to cite it appropriately (see Citation).
The "Under the Hood" section provides details on the individual routines used for wave analysis within the WaLSAtools package, for those interested in exploring the underlying code. However, we strongly encourage all users to perform their analyses by running WaLSAtools directly, as this ensures the correct execution of the analysis workflow and provides a more user-friendly experience.
Interactive Demonstration
WaLSAtools provides an interactive interface that simplifies wave analysis. To launch the interface, simply run the WaLSAtools
command in IDL:
IDL> WaLSAtools
The interface will guide you through the following steps:
- Select a category of analysis: Choose from single time series analysis or cross-correlation analysis.
- Choose the data type: Specify the type of data you are working with (e.g., 1D signal, 3D datacube).
- Pick a specific analysis method: Select the method most suitable for your data and research question.
The interface will then provide information on the selected method, including its calling sequence, input parameters, and expected outputs.
Here's an example of the execution of WaLSAtools in IDL (in terminal)
% Compiled module: WALSATOOLS.
__ __ _ _____
\ \ / / | | / ____| /\
\ \ /\ / / ▄▄▄▄▄ | | | (___ / \
\ \/ \/ / ▀▀▀▀██ | | \___ \ / /\ \
\ /\ / ▄██▀▀██ | |____ ____) | / ____ \
\/ \/ ▀██▄▄██ |______| |_____/ /_/ \_\
© WaLSA Team (www.WaLSA.team)
-----------------------------------------------------------------------------------
WaLSAtools v1.0
Documentation: www.WaLSA.tools
GitHub repository: www.github.com/WaLSAteam/WaLSAtools
-----------------------------------------------------------------------------------
Performing various wave analysis techniques on
(a) Single time series (1D signal or [x,y,t] cube)
Methods:
(1) 1D analysis with: FFT (Fast Fourier Transform), Wavelet,
Lomb-Scargle, or HHT (Hilbert-Huang Transform)
(2) 3D analysis: k-ω (with optional Fourier filtering) or B-ω diagrams
(b) Two time series (cross correlations between two signals)
With: FFT (Fast Fourier Transform), Wavelet,
Lomb-Scargle, or HHT (Hilbert-Huang Transform)
----------------------------------------------------------------------------
-- Category -- (enter the option a or b):
------------------------------------------------
--- Single time-series analysis: (1) 1D, (2) 3D
------------------------------------------------
-- Method (enter the option 1 or 2):
----------------------------------------------------------------------
--- 1D analysis with: (1) FFT, (2) Wavelet, (3) Lomb-Scargle, (4) HHT
----------------------------------------------------------------------
--- Type of analysis (enter the option 1-4):
---------------------------
---- 1D analysis with FFT:
---------------------------
+ CALLING SEQUENCE:
walsatools, /fft, signal=signal, time=time, power=p, frequencies=f, significance=signif
+ INPUTS:
signal: 1D time series, or [x,y,t] datacube
time: observing times in seconds (1D array)
+ OPTIONAL KEYWORDS:
padding: oversampling factor: zero padding (default: 1)
apod: extent of apodization edges (of a Tukey window); default 0.1
nodetrendapod: if set, neither detrending nor apodization is performed!
pxdetrend: subtract linear trend with time per pixel. options: 1=simple, 2=advanced; default: 2
polyfit: the degree of polynomial fit to the data to detrend it
if set, instead of linear fit this polynomial fit is performed
meantemporal: if set, only a very simple temporal detrending is performed by
subtracting the mean signal from the signal
i.e., the fitting procedure (linear or higher polynomial degrees) is omitted
meandetrend: if set, subtract linear trend with time for the image means (i.e., spatial detrending)
recon: optional keyword that will Fourier reconstruct the input timeseries
note: this does not preserve the amplitudes and is only useful when attempting
to examine frequencies that are far away from the -untrustworthy- low frequencies
siglevel: significance level (default: 0.05 = 5% significance = 95% confidence)
nperm: number of random permutations for the significance test (default: 1000)
nosignificance: if set, no significance level is calculated
mode: 0 = log(power) (default), 1 = linear power, 2 = sqrt(power) = amplitude
nodominantfreq: if set, dominant frequency and dominant power are not calculated
(to, e.g., save computational time for large datasets)
+ OUTPUTS:
power: 1D (or 3D; same dimension as input data) array of power
2D (or 4D) array for wavelet spectrum
(in DN^2/mHz, i.e., normalised to frequency resolution)
frequencies: 1D array of frequencies (in mHz)
significance: significance array (same size and units as power)
dominantfreq: dominant frequency, i.e., frequency corresponding to the maximum power (in mHz)
same spatial size as input data (i.e., 1D or 2D)
if there are multiple peaks with the same power, the lowest dominant frequency is returned!
dominantpower: power (in DN^2/mHz) corresponding to the dominant frequency
same spatial size as input data (i.e., 1D or 2D)
rangefreq: frequency range over which the dominant frequency is computed. default: full frequency range
averagedpower: spatially averaged power spectrum (of multiple 1D power spectra)
amplitude: 1D array of oscillation amplitude (or a 3D array if the input is a 3D cube)
-----------------------------------------------------------------------------------------
* CITATION:
Please cite the following article if you use WaLSAtools: 1D analysis with FFT
-- Jess et al. 2021, LRSP, in preparation
(see www.WaLSA.tools/citation)
-----------------------------------------------------------------------------------------
-------------------------------
---- 1D analysis with Wavelet:
-------------------------------
+ CALLING SEQUENCE:
walsatools, /wavelet, signal=signal, time=time, power=p, frequencies=f, significance=signif
+ INPUTS:
signal: 1D time series, or [x,y,t] datacube
time: observing times in seconds (1D array)
+ OPTIONAL KEYWORDS:
padding: oversampling factor: zero padding (default: 1)
apod: extent of apodization edges (of a Tukey window); default 0.1
nodetrendapod: if set, neither detrending nor apodization is performed!
pxdetrend: subtract linear trend with time per pixel. options: 1=simple, 2=advanced; default: 2
polyfit: the degree of polynomial fit to the data to detrend it
if set, instead of linear fit this polynomial fit is performed
meantemporal: if set, only a very simple temporal detrending is performed by
subtracting the mean signal from the signal
i.e., the fitting procedure (linear or higher polynomial degrees) is omitted
meandetrend: if set, subtract linear trend with time for the image means (i.e., spatial detrending)
recon: optional keyword that will Fourier reconstruct the input timeseries
note: this does not preserve the amplitudes and is only useful when attempting
to examine frequencies that are far away from the -untrustworthy- low frequencies
siglevel: significance level (default: 0.05 = 5% significance = 95% confidence)
nperm: number of random permutations for the significance test (default: 1000)
nosignificance: if set, no significance level is calculated
mode: 0 = log(power) (default), 1 = linear power, 2 = sqrt(power) = amplitude
mother: wavelet function (also depends on param). default: Morlet
other available functions: Paul and DOG are available
param: optional mother wavelet parameter
(default: 6 (for Morlet), 4 (for Paul), 2 (for DOG; i.e., Mexican-hat)
dj: spacing between discrete scales. default: 0.025
global: returns global wavelet spectrum (integrated over frequency domain)
oglobal: global wavelet spectrum excluding regions influenced by CoI
cglobal: global wavelet spectrum excluding regions influenced by (1) CoI and (2) insignificant power
colornoise: if set, noise background is based on Auchère+2017, ApJ, 838, 166
nodominantfreq: if set, dominant frequency and dominant power are not calculated
(to, e.g., save computational time for large datasets)
+ OUTPUTS:
power: 1D (or 3D; same dimension as input data) array of power
2D (or 4D) array for wavelet spectrum
(in DN^2/mHz, i.e., normalised to frequency resolution)
frequencies: 1D array of frequencies (in mHz)
significance: significance array (same size and units as power)
coi: cone-of-influence cube (when global, oglobal, or cglobal are not set)
dominantfreq: dominant frequency, i.e., frequency corresponding to the maximum power (in mHz)
same spatial size as input data (i.e., 1D or 2D)
if there are multiple peaks with the same power, the lowest dominant frequency is returned!
dominantpower: power (in DN^2/mHz) corresponding to the dominant frequency
same spatial size as input data (i.e., 1D or 2D)
rangefreq: frequency range over which the dominant frequency is computed. default: full frequency range
averagedpower: spatially averaged power spectrum (of multiple 1D power spectra)
amplitude: 1D array of oscillation amplitude (or a 3D array if the input is a 3D cube)
note: only for global (traditional, oglobal, or cglobal) wavelet
-----------------------------------------------------------------------------------------
* CITATION:
Please cite the following article if you use WaLSAtools: 1D analysis with Wavelet
-- Jess et al. 2021, LRSP, in preparation
(see www.WaLSA.tools/citation)
-----------------------------------------------------------------------------------------
------------------------------------
---- 1D analysis with Lomb-Scargle:
------------------------------------
+ CALLING SEQUENCE:
walsatools, /lomb, signal=signal, time=time, power=p, frequencies=f, significance=signif
+ INPUTS:
signal: 1D time series, or [x,y,t] datacube
time: observing times in seconds (1D array)
+ OPTIONAL KEYWORDS:
padding: oversampling factor: zero padding (default: 1)
apod: extent of apodization edges (of a Tukey window); default 0.1
nodetrendapod: if set, neither detrending nor apodization is performed!
pxdetrend: subtract linear trend with time per pixel. options: 1=simple, 2=advanced; default: 2
polyfit: the degree of polynomial fit to the data to detrend it
if set, instead of linear fit this polynomial fit is performed
meantemporal: if set, only a very simple temporal detrending is performed by
subtracting the mean signal from the signal
i.e., the fitting procedure (linear or higher polynomial degrees) is omitted
meandetrend: if set, subtract linear trend with time for the image means (i.e., spatial detrending)
recon: optional keyword that will Fourier reconstruct the input timeseries
note: this does not preserve the amplitudes and is only useful when attempting
to examine frequencies that are far away from the -untrustworthy- low frequencies
siglevel: significance level (default: 0.05 = 5% significance = 95% confidence)
nperm: number of random permutations for the significance test (default: 1000)
nosignificance: if set, no significance level is calculated
mode: 0 = log(power) (default), 1 = linear power, 2 = sqrt(power) = amplitude
nodominantfreq: if set, dominant frequency and dominant power are not calculated
(to, e.g., save computational time for large datasets)
+ OUTPUTS:
power: 1D (or 3D; same dimension as input data) array of power
2D (or 4D) array for wavelet spectrum
(in DN^2/mHz, i.e., normalised to frequency resolution)
frequencies: 1D array of frequencies (in mHz)
significance: significance array (same size and units as power)
dominantfreq: dominant frequency, i.e., frequency corresponding to the maximum power (in mHz)
same spatial size as input data (i.e., 1D or 2D)
if there are multiple peaks with the same power, the lowest dominant frequency is returned!
dominantpower: power (in DN^2/mHz) corresponding to the dominant frequency
same spatial size as input data (i.e., 1D or 2D)
rangefreq: frequency range over which the dominant frequency is computed. default: full frequency range
averagedpower: spatially averaged power spectrum (of multiple 1D power spectra)
amplitude: 1D array of oscillation amplitude (or a 3D array if the input is a 3D cube)
-----------------------------------------------------------------------------------------
* CITATION:
Please cite the following article if you use WaLSAtools: 1D analysis with Lomb-Scargle
-- Jess et al. 2021, LRSP, in preparation
(see www.WaLSA.tools/citation)
-----------------------------------------------------------------------------------------
---------------------------
---- 1D analysis with HHT:
---------------------------
+ CALLING SEQUENCE:
walsatools, /hht, signal=signal, time=time, power=p, frequencies=f, significance=signif
+ INPUTS:
signal: 1D time series, or [x,y,t] datacube
time: observing times in seconds (1D array)
+ OPTIONAL KEYWORDS:
padding: oversampling factor: zero padding (default: 1)
apod: extent of apodization edges (of a Tukey window); default 0.1
nodetrendapod: if set, neither detrending nor apodization is performed!
pxdetrend: subtract linear trend with time per pixel. options: 1=simple, 2=advanced; default: 2
polyfit: the degree of polynomial fit to the data to detrend it
if set, instead of linear fit this polynomial fit is performed
meantemporal: if set, only a very simple temporal detrending is performed by
subtracting the mean signal from the signal
i.e., the fitting procedure (linear or higher polynomial degrees) is omitted
meandetrend: if set, subtract linear trend with time for the image means (i.e., spatial detrending)
recon: optional keyword that will Fourier reconstruct the input timeseries
note: this does not preserve the amplitudes and is only useful when attempting
to examine frequencies that are far away from the -untrustworthy- low frequencies
siglevel: significance level (default: 0.05 = 5% significance = 95% confidence)
nperm: number of random permutations for the significance test (default: 1000)
nosignificance: if set, no significance level is calculated
mode: 0 = log(power) (default), 1 = linear power, 2 = sqrt(power) = amplitude
stdlimit: standard deviation to be achieved before accepting an IMF (default: 0.2)
nfilter: Hanning window width for two dimensional spectrum smoothing (default: 3)
(an odd integer equal to or larger than 3; 0: to avoid the windowing)
emd: if set, intrinsic mode functions (IMFs) and their associated frequencies
(i.e., instantaneous frequencies) can be outputted
nodominantfreq: if set, dominant frequency and dominant power are not calculated
(to, e.g., save computational time for large datasets)
+ OUTPUTS:
power: 1D (or 3D; same dimension as input data) array of power
2D (or 4D) array for wavelet spectrum
(in DN^2/mHz, i.e., normalised to frequency resolution)
frequencies: 1D array of frequencies (in mHz)
significance: significance array (same size and units as power)
imf: intrinsic mode functions (IMFs) from EMD analysis, if emd is set
instantfreq: instantaneous frequencies of each component time series, if emd is set
dominantfreq: dominant frequency, i.e., frequency corresponding to the maximum power (in mHz)
same spatial size as input data (i.e., 1D or 2D)
if there are multiple peaks with the same power, the lowest dominant frequency is returned!
dominantpower: power (in DN^2/mHz) corresponding to the dominant frequency
same spatial size as input data (i.e., 1D or 2D)
rangefreq: frequency range over which the dominant frequency is computed. default: full frequency range
averagedpower: spatially averaged power spectrum (of multiple 1D power spectra)
amplitude: 1D array of oscillation amplitude (or a 3D array if the input is a 3D cube)
-----------------------------------------------------------------------------------------
* CITATION:
Please cite the following article if you use WaLSAtools: 1D analysis with HHT
-- Jess et al. 2021, LRSP, in preparation
(see www.WaLSA.tools/citation)
-----------------------------------------------------------------------------------------
-----------------------------------
--- 3D analysis: (1) k-ω, (2) B-ω
-----------------------------------
--- Type of analysis (enter the option 1 or 2):
-----------------------
---- 3D analysis: k-ω
-----------------------
+ CALLING SEQUENCE:
walsatools, /komega, signal=signal, time=time, arcsecpx=arcsecpx, power=p, frequencies=f, wavenumber=k
+ INPUTS:
signal: [x,y,t] datacube
[!] note: at present the input datacube needs to have identical x and y dimensions.
if not supplied like this the datacube will be cropped accordingly.
cadence: delta time between successive frames (in seconds)
time: observing times in seconds (1D array). It is ignored if cadence is provided
arcsecpx: pixel size (spatial sampling) in arcsec; a float number
+ OPTIONAL KEYWORDS:
filtering: if set, filtering is proceeded
f1: lower frequency to filter - given in mHz
f2: upper frequency to filter - given in mHz
k1: lower wavenumber to filter - given in mHz
k2: upper wavenumber to filter - given in arcsec^-1
spatial_torus: if equal to zero, the annulus used for spatial filtering will not have a Gaussian-shaped profile
temporal_torus: if equal to zero, the temporal filter will not have a Gaussian-shaped profile
no_spatial: if set, no spatial filtering is performed
no_temporal: if set, no temporal filtering is performed
silent: if set, the k-ω diagram is not plotted
clt: colour table number (IDL ctload)
koclt: custom colour tables for k-ω diagram (currently available: 1 and 2)
threemin: if set, a horizontal line marks the three-minute periodicity
fivemin: if set, a horizontal line marks the five-minute periodicity
xlog: if set, x-axis (wavenumber) is plotted in logarithmic scale
ylog: if set, y-axis (frequency) is plotted in logarithmic scale
xrange: x-axis (wavenumber) range
yrange: y-axis (frequency) range
nox2: if set, 2nd x-axis (spatial size, in arcsec) is not plotted
(spatial size (i.e., wavelength) = (2*!pi)/wavenumber)
noy2: if set, 2nd y-axis (period, in sec) is not plotted
(p = 1000/frequency)
smooth: if set, power is smoothed
mode: 0 = log(power) (default), 1 = linear power, 2 = sqrt(power) = amplitude
epsfilename: if provided (as a string), an eps file of the k-ω diagram is made
+ OUTPUTS:
power: 2D array of power in log10 scale
(in DN^2/mHz, i.e., normalised to frequency resolution)
frequencies: 1D array of frequencies (in mHz)
wavenumber: 1D array of wavenumber (in arcsec^-1)
filtered_cube: 3D array of filtered datacube (if filtering is set)
-----------------------------------------------------------------------------------------
* CITATION:
Please cite the following articles if you use WaLSAtools: k-ω analysis
-- Jess et al. 2021, LRSP, in preparation
-- Jess et al. 2017, ApJ, 842, 59
(see www.WaLSA.tools/citation)
-----------------------------------------------------------------------------------------
-----------------------
---- 3D analysis: B-ω
-----------------------
+ CALLING SEQUENCE:
walsatools, /bomega, signal=signal, time=time, bmap=bmap, power=p, frequencies=f, barray=b
+ INPUTS:
signal: [x,y,t] datacube
time: observing times in seconds (1D array)
bmap: a map of magnetic fields (in G), same [x,y] size as in datacube
+ OPTIONAL KEYWORDS:
binsize: size of magnetic-field bins, over which power spectra are averaged
(default: 50 G)
silent: if set, the B-ω diagram is not plotted
clt: colour table number (IDL ctload)
koclt: custom colour tables for k-ω diagram (currently available: 1 and 2)
threemin: if set, a horizontal line marks the three-minute periodicity
fivemin: if set, a horizontal line marks the five-minute periodicity
xlog: if set, x-axis (wavenumber) is plotted in logarithmic scale
ylog: if set, y-axis (frequency) is plotted in logarithmic scale
xrange: x-axis (wavenumber) range
yrange: y-axis (frequency) range
noy2: if set, 2nd y-axis (period, in sec) is not plotted
(p = 1000/frequency)
smooth: if set, power is smoothed
normalizedbins if set, power at each bin is normalised to its maximum value
(this facilitates visibility of relatively small power)
xtickinterval x-asis (i.e., magnetic fields) tick intervals in G (default: 400 G)
mode: 0 = log(power) (default), 1 = linear power, 2 = sqrt(power) = amplitude
epsfilename: if provided (as a string), an eps file of the k-ω diagram is made
+ OUTPUTS:
power: 2D array of power
(in DN^2/mHz, i.e., normalised to frequency resolution)
frequencies: 1D array of frequencies (y-axis) in mHz
barray: 1D array of magnetic fields (x-axis) in G
-----------------------------------------------------------------------------------------
* CITATION:
Please cite the following articles if you use WaLSAtools: B-ω analysis
-- Jess et al. 2021, LRSP, in preparation
-- Stangalini et al. 2021, A&A, in press
(see www.WaLSA.tools/citation)
-----------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------
--- Two time-series analysis with: (1) FFT, (2) Wavelet, (3) Lomb-Scargle, (4) HHT
-----------------------------------------------------------------------------------
--- Type of analysis (enter the option 1-4):
------------------------------------
---- cross-power analysis with FFT:
------------------------------------
+ CALLING SEQUENCE:
walsatools, /fft, data1=data1, data2=data2, time=time, $
cospectrum=cospec, phase_angle=ph, coherence=coh, frequencies=f, significance=signif
+ INPUTS:
data1: first (1D) time series
data2: second (1D) time series, co-aligned with data1
time: observing times in seconds (1D array)
+ OPTIONAL KEYWORDS:
padding: oversampling factor: zero padding (default: 1)
apod: extent of apodization edges (of a Tukey window); default 0.1
nodetrendapod: if set, neither detrending nor apodization is performed!
pxdetrend: subtract linear trend with time per pixel. options: 1=simple, 2=advanced; default: 2
polyfit: the degree of polynomial fit to the data to detrend it
if set, instead of linear fit this polynomial fit is performed
meantemporal: if set, only a very simple temporal detrending is performed by
subtracting the mean signal from the signal
i.e., the fitting procedure (linear or higher polynomial degrees) is omitted
meandetrend: if set, subtract linear trend with time for the image means (i.e., spatial detrending)
recon: optional keyword that will Fourier reconstruct the input timeseries
note: this does not preserve the amplitudes and is only useful when attempting
to examine frequencies that are far away from the -untrustworthy- low frequencies
n_segments: number of euqal segments (to which both datasets are broken prior to the analyses; default: 1)
Each of these segments is considered an independent realisation of the underlying process.
The cross spectrum for each segement are averaged together to provide phase and coherence
estimates at each frequency.
siglevel: significance level (default: 0.05 = 5% significance = 95% confidence)
nperm: number of random permutations for the significance test (default: 50)
note: the default value is set for quick tests. Choose a large number
(e.g., 2000 or larger) for a better statistical result
nosignificance: if set, no significance level is calculated
+ OUTPUTS:
cospectrum: absolute values of the cross power (1D array)
coherence: coherence (1D array)
phase_angle: phase angles in degrees (1D array)
frequency: 1D array of frequencies (in mHz)
signif_cross: significance levels for the cospectrum (1D array)
signif_coh: significance levels for the coherence (1D array)
-----------------------------------------------------------------------------------------
* CITATION:
Please cite the following article if you use WaLSAtools: cross-correlation analysis with FFT
-- Jess et al. 2021, LRSP, in preparation
(see www.WaLSA.tools/citation)
-----------------------------------------------------------------------------------------
----------------------------------------
---- cross-power analysis with Wavelet:
----------------------------------------
+ CALLING SEQUENCE:
walsatools, /wavelet, data1=data1, data2=data2, time=time, $
cospectrum=cospec, phase_angle=ph, coherence=coh, frequencies=f, significance=signif
+ INPUTS:
data1: first (1D) time series
data2: second (1D) time series, co-aligned with data1
time: observing times in seconds (1D array)
+ OPTIONAL KEYWORDS:
padding: oversampling factor: zero padding (default: 1)
apod: extent of apodization edges (of a Tukey window); default 0.1
nodetrendapod: if set, neither detrending nor apodization is performed!
pxdetrend: subtract linear trend with time per pixel. options: 1=simple, 2=advanced; default: 2
polyfit: the degree of polynomial fit to the data to detrend it
if set, instead of linear fit this polynomial fit is performed
meantemporal: if set, only a very simple temporal detrending is performed by
subtracting the mean signal from the signal
i.e., the fitting procedure (linear or higher polynomial degrees) is omitted
meandetrend: if set, subtract linear trend with time for the image means (i.e., spatial detrending)
siglevel: significance level (default: 0.05 = 5% significance = 95% confidence)
nperm: number of random permutations for the significance test (default: 50)
note: the default value is set for quick tests. Choose a large number
(e.g., 2000 or larger) for a better statistical result
nosignificance: if set, no significance level is calculated
mother: wavelet function (also depends on param). default: Morlet
other available functions: Paul and DOG are available
param: optional mother wavelet parameter
(default: 6 (for Morlet), 4 (for Paul), 2 (for DOG; i.e., Mexican-hat)
dj: spacing between discrete scales. default: 0.025
colornoise: if set, noise background is based on Auchère+2017, ApJ, 838, 166
plot: if set, wavelet power spectra of the two time series as well as
their wavelet cospectrum (cross-spectrum) and coherence, along with the
significance levels as contours, are plotted
The phase angles between the two time series are also depicted by default
Arrows pointing right mark zero phase (meaning in-phase oscillations),
arrows pointing straight up indicate data2 lags behind data1 by 90 degrees
noarrow: if set, the phase angles are not overplotted as arrows
arrowdensity: number of arrows (illustrating phase angles) in x and y directions (default: [30,18])
arrowsize: size of the arrows (default: 1)
arrowheadsize: size of the arrows head (default: 1)
pownormal: if set, the power is normalised to its maximum value
log: if set, the power spectra and the cospectrum are plotted in log10 scale
removespace: if set, the time-period areas affected by the CoI over the entire time range are not plotted
clt: colour table number (idl ctload)
koclt: custom colour tables (currently available: 1 and 2)
+ OUTPUTS:
cospectrum: absolute values of the cross power
(2D array for wavelet spectrum; 1D for global, oglobal, or cglobal spectrum)
coherence: wavelet coherence (same size as cospectrum)
phase_angle: phase angles in degrees (same size as cospectrum)
frequency: 1D array of frequencies (in mHz)
signif_cross: significance map for the cospectrum (same size as cospectrum)
scale: the scale vector of scale indices, given by the overlap of scale1 and scale2
cospectrum/signif_coh indicates regions above the siglevel
signif_coh: significance map for the coherence (same size as cospectrum)
coherence/signif_coh indicates regions above the siglevel
coi: the vector of the cone-of-influence
coh_global: global coherence averaged over all times
phase_global: global phase averaged over all times
cross_global: global cross wavelet averaged over all times
coh_oglobal: global coherence averaged over all times excluding areas affected by CoI
phase_oglobal: global phase averaged over all times excluding areas affected by CoI
cross_oglobal: global cross wavelet averaged over all times excluding areas affected by CoI
-----------------------------------------------------------------------------------------
* CITATION:
Please cite the following article if you use WaLSAtools: cross-correlation analysis with Wavelet
-- Jess et al. 2021, LRSP, in preparation
(see www.WaLSA.tools/citation)
-----------------------------------------------------------------------------------------
---------------------------------------------
---- cross-power analysis with Lomb-Scargle:
---------------------------------------------
+ CALLING SEQUENCE:
walsatools, /lomb, data1=data1, data2=data2, time=time, $
cospectrum=cospec, phase_angle=ph, coherence=coh, frequencies=f, significance=signif
+ INPUTS:
data1: first (1D) time series
data2: second (1D) time series, co-aligned with data1
time: observing times in seconds (1D array)
+ OPTIONAL KEYWORDS:
padding: oversampling factor: zero padding (default: 1)
apod: extent of apodization edges (of a Tukey window); default 0.1
nodetrendapod: if set, neither detrending nor apodization is performed!
pxdetrend: subtract linear trend with time per pixel. options: 1=simple, 2=advanced; default: 2
polyfit: the degree of polynomial fit to the data to detrend it
if set, instead of linear fit this polynomial fit is performed
meantemporal: if set, only a very simple temporal detrending is performed by
subtracting the mean signal from the signal
i.e., the fitting procedure (linear or higher polynomial degrees) is omitted
meandetrend: if set, subtract linear trend with time for the image means (i.e., spatial detrending)
recon: optional keyword that will Fourier reconstruct the input timeseries
note: this does not preserve the amplitudes and is only useful when attempting
to examine frequencies that are far away from the -untrustworthy- low frequencies
n_segments: number of euqal segments (to which both datasets are broken prior to the analyses; default: 1)
Each of these segments is considered an independent realisation of the underlying process.
The cross spectrum for each segement are averaged together to provide phase and coherence
estimates at each frequency.
siglevel: significance level (default: 0.05 = 5% significance = 95% confidence)
nperm: number of random permutations for the significance test (default: 50)
note: the default value is set for quick tests. Choose a large number
(e.g., 2000 or larger) for a better statistical result
nosignificance: if set, no significance level is calculated
+ OUTPUTS:
cospectrum: absolute values of the cross power (1D array)
coherence: coherence (1D array)
phase_angle: phase angles in degrees (1D array)
frequency: 1D array of frequencies (in mHz)
signif_cross: significance levels for the cospectrum (1D array)
signif_coh: significance levels for the coherence (1D array)
-----------------------------------------------------------------------------------------
* CITATION:
Please cite the following article if you use WaLSAtools: cross-correlation analysis with Lomb-Scargle
-- Jess et al. 2021, LRSP, in preparation
(see www.WaLSA.tools/citation)
-----------------------------------------------------------------------------------------
-------------------------------------
---- cross-powerD analysis with HHT:
-------------------------------------
+ CALLING SEQUENCE:
walsatools, /hht, data1=data1, data2=data2, time=time, $
cospectrum=cospec, phase_angle=ph, coherence=coh, frequencies=f, significance=signif
+ INPUTS:
data1: first (1D) time series
data2: second (1D) time series, co-aligned with data1
time: observing times in seconds (1D array)
+ OPTIONAL KEYWORDS:
padding: oversampling factor: zero padding (default: 1)
apod: extent of apodization edges (of a Tukey window); default 0.1
nodetrendapod: if set, neither detrending nor apodization is performed!
pxdetrend: subtract linear trend with time per pixel. options: 1=simple, 2=advanced; default: 2
polyfit: the degree of polynomial fit to the data to detrend it
if set, instead of linear fit this polynomial fit is performed
meantemporal: if set, only a very simple temporal detrending is performed by
subtracting the mean signal from the signal
i.e., the fitting procedure (linear or higher polynomial degrees) is omitted
meandetrend: if set, subtract linear trend with time for the image means (i.e., spatial detrending)
recon: optional keyword that will Fourier reconstruct the input timeseries
note: this does not preserve the amplitudes and is only useful when attempting
to examine frequencies that are far away from the -untrustworthy- low frequencies
n_segments: number of euqal segments (to which both datasets are broken prior to the analyses; default: 1)
Each of these segments is considered an independent realisation of the underlying process.
The cross spectrum for each segement are averaged together to provide phase and coherence
estimates at each frequency.
stdlimit: standard deviation to be achieved before accepting an IMF
(recommended value between 0.2 and 0.3; perhaps even smaller); default: 0.2
nfilter: Hanning window width for two dimensional smoothing of the Hilbert spectrum. default: 3
(an odd integer, preferably equal to or larger than 3; equal to 0 to avoid the windowing)
siglevel: significance level (default: 0.05 = 5% significance = 95% confidence)
nperm: number of random permutations for the significance test (default: 50)
note: the default value is set for quick tests. Choose a large number
(e.g., 2000 or larger) for a better statistical result
nosignificance: if set, no significance level is calculated
+ OUTPUTS:
cospectrum: absolute values of the cross power (1D array)
coherence: coherence (1D array)
phase_angle: phase angles in degrees (1D array)
frequency: 1D array of frequencies (in mHz)
signif_cross: significance levels for the cospectrum (1D array)
signif_coh: significance levels for the coherence (1D array)
-----------------------------------------------------------------------------------------
* CITATION:
Please cite the following article if you use WaLSAtools: cross-correlation analysis with HHT
-- Jess et al. 2021, LRSP, in preparation
(see www.WaLSA.tools/citation)
-----------------------------------------------------------------------------------------
If the data, time, or cadence, and the type of analysis are not provided, the code enters a guidance mode, providing detailed instructions and prompting you for the necessary information.
Source code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 |
|