climate.hilbert

Provides classes for generating and analyzing complex climate networks.

class pyunicorn.climate.hilbert.HilbertClimateNetwork(data, threshold=None, link_density=None, non_local=False, directed=True, node_weight_type='surface', silence_level=0)[source]

Bases: pyunicorn.climate.climate_network.ClimateNetwork

Encapsulates a Hilbert climate network.

The associated similarity matrix is based on Hilbert coherence between time series.

Hilbert climate networks can be directed and undirected. Optional directionality is based on the average phase difference between time series.

A preliminary study of Hilbert climate networks is presented in [Donges2009c].

__init__(data, threshold=None, link_density=None, non_local=False, directed=True, node_weight_type='surface', silence_level=0)[source]

Initialize an instance of HilbertClimateNetwork.

Note

Either threshold OR link_density have to be given!

Possible choices for node_weight_type:
  • None (constant unit weights)
  • “surface” (cos lat)
  • “irrigation” (cos**2 lat)
Parameters:
  • data (ClimateData) – The climate data used for network construction.
  • threshold (float) – The threshold of similarity measure, above which two nodes are linked in the network.
  • link_density (float) – The networks’s desired link density.
  • non_local (bool) – Determines, whether links between spatially close nodes should be suppressed.
  • directed (bool) – Determines, whether the network is constructed as directed.
  • node_weight_type (str) – The type of geographical node weight to be used.
  • silence_level (int) – The inverse level of verbosity of the object.
__str__()[source]

Return a string representation.

_calculate_hilbert_correlation(anomaly)[source]

Calculate Hilbert coherence and phase matrices.

Output corresponds to modulus and argument of the complex correlation coefficients between all pairs of analytic signals calculated from anomaly data, as described in [Bergner2008].

Parameters:anomaly (2D Numpy array [time, index]) – The anomaly data for network construction.
Return type:tuple of two 2D Numpy matrices [index, index]
Returns:the Hilbert coherence and phase matrices.
_set_directed(directed, calculate_coherence=True)[source]

Switch between directed and undirected Hilbert climate network.

Parameters:
  • directed (bool) – Determines whether the network is constructed as directed.
  • calculate_coherence (bool) – Determines whether coherence and phase are calculated from data or the directed adjacency matrix is constructed from coherence and phase information.
clear_cache(irreversible=False)[source]

Clean up cache.

If irreversible=True, the network cannot be recalculated using a different threshold, or link density.

Parameters:irreversible (bool) – The irreversibility of clearing the cache.
coherence()[source]

Return the Hilbert coherence matrix.

Return type:2D Numpy array [index, index]
Returns:the Hilbert coherence matrix.
data = None

(ClimateData) - The climate data used for network construction.

phase_shift()[source]

Return the average phase shift matrix.

Return type:2D Numpy array [index, index]
Returns:the average phase shift matrix.
set_directed(directed)[source]

Switch between directed and undirected Hilbert climate network.

Also performs the complete network generation.

Parameters:directed (bool) – Determines whether the network is constructed as directed.