LinkedEarth / Pyleoclim_util

Python Package for the Analysis of Paleoclimate Data. Documentation at
https://pyleoclim-util.readthedocs.io
GNU General Public License v3.0
87 stars 33 forks source link

Global coherence #573

Closed alexkjames closed 3 months ago

alexkjames commented 3 months ago

Adds global coherence functionality to pyleoclim. Includes a .plot and .signif_test method.

Built on top of wavelet_coherence.

alexkjames commented 3 months ago

Nice work! A few minor changes to take it to 11.

1. On the code side, since `Series.global_coherence()` is built on top of wavelet_coherence(), I recommend having an optional parameter called `coh`, which would `None` by default, but would allow you to pass a coherence object from which the average would be taken.

2. The gcoh.plot() command should have a label on the right-hand side that says "coherence" (or "global coherence") by default, which could be controlled by a parameter called `ylabel_rhs` (similarly, need a `ylabel_lhs = PSD` by default)

3. On the docstring side, I recommend that the docstring for  `Series.global_coherence()` does something with `gcoh` (e.g. plot it). Otherwise, it's a very frustrating docstring to read because it ends in a blind corner.

The latest commits should address these:

  1. Added this
  2. There is an exposed argument for this, I updated the default and added an exposed argument for the left hand side label, as well as the x axis.
  3. Added this