Open shiness11 opened 1 year ago
The tau vector is calculated from the first time series, creating slightly different values.
Thanks @khider! @shiness11 this explains the mystery. At some point we will improve the choice of a common tau vector (the time values at which the coherence is evaluated), but since it does not appear to make a material difference in most applications I've seen (including yours), this is not a high priority.
Describe the bug When performing the wavelet coherence analysis on two datasets (a d13C record and eNd record from the same sediment core), the order that the timeseries are placed in the calculation gives slightly different scalograms.
To Reproduce Steps to reproduce the behavior: @CommonClimate has a copy of the notebook I have been working on, along with the relevant datasets. The two lines of code which should give the same result are: 1)
coh = eNd1479_MPT.wavelet_coherence(d13C1479_MPT.flip())
and 2)coh = d13C1479_MPT.wavelet_coherence(eNd1479_MPT.flip())
Screenshots corresponding to lines 1 and 2 are below.Expected behavior Based on conversations with @CommonClimate, the function should be reversible (other than the phase, which would be of opposite sign), so it's not clear why the two scalograms look slightly different.
Screenshots From line 1: From line 2:
Desktop (please complete the following information):