# MIWaveletₐnalysis **Dominant role of soil moisture in controlling Nighttime Net Ecosystem Exchange in Sub-Humid West African Ecosystems_** > Last updated: 2026-07-03 This repository provides the raw data and the R / MATLAB scripts to reproduce the analyses, figures and results presented in the scientific manuscript "Dominant role of soil moisture in controlling Nighttime Net Ecosystem Exchange in Sub-Humid West African Ecosystems", submitted to JGR Biogeosciences. The workflow combines **mutual information** (to quantify statistical dependencies between NEE and its drivers) and **wavelet analysis** (to resolve those dependencies across time scales) in order to investigate the scale-dependent controls of nighttime net ecosystem exchange (NEE). ## Public Release ``` ``` --- ## Table of Contents 1. Requirements (#requirements) 2. Installation (#installation) 3. Data (#data) 4. Repository Structure (#repository-structure) 5. How to Run (#how-to-run) 6. Reproducing the Figures (#reproducing-the-figures) 7. Acknowledgements (#acknowledgements) 8. Contact (#contact) --- ## Requirements | Software | Version | Purpose | |---|---|---| | R | 4. 2. 0 | Data processing, gap-filling, mutual information | | MATLAB | R2022b (v9. 13. 0) | Wavelet power, coherence and phase analysis | **R packages** ```R install. packages (c ("data. table", "lubridate", "randomForest", "varrank", "REddyProc", "openeddy", "tidyverse", "ggplot2") ) ``` **MATLAB toolboxes** (included in the `Processing` subfolder) - Wavelet coherence routines from Grinsted et al. (2004) — folder `wavelet-coherence-master` (see Acknowledgements (#acknowledgements) ) - *Cumulative Arcwise Significance of Global Wavelet Power and Global Coherence Spectra* (v1. 0. 0. 0) by Justin Schulte — folder `arcwiseₛigtest`, available on MATLAB Central File Exchange (https: //fr. mathworks. com/matlabcentral/profile/authors/6932485) > Adjust the package list above to match the actual dependencies used by your scripts. --- ## Installation Download and unpack the zip archive. Set the main project path at the top of each script so that it matches your local environment before running anything. --- ## Data The data sets used in this study are provided by the **AMMA-CATCH** observatory and are available through the following DOIs. Each data set covers the two flux stations, **Nalohou** and **Bellefoungou**. | Data set | Content | DOI | |---|---|---| | AE. H2OFluxOdc | Meteorology, fluxes and soil moisture at the flux stations | 10. 17178/AMMA-CATCH. AE. SHFluxOdc (http: //dx. doi. org/10. 17178/AMMA-CATCH. AE. SHFluxOdc) | | CE. SWOdc | Complementary soil temperature and humidity | 10. 17178/AMMA-CATCH. CE. SWOdc (http: //dx. doi. org/10. 17178/AMMA-CATCH. CE. SWOdc) | | CL. RainOd | Rainfall | 10. 17178/AMMA-CATCH. CL. RainOd (http: //dx. doi. org/10. 17178/AMMA-CATCH. CL. RainOd) | The scripts read these inputs and write intermediate and final outputs to the `Processing/` and `Figures/` subfolders. --- ## Repository Structure ``` MIWaveletₐnalysis/ ├── Processing/ # Analysis pipeline + dependencies │ ├── NEEdataₚostₚrocess. r # Data preparation │ ├── Mutualᵢnformationₐnalysis. r # Mutual information analysis │ ├── NEEdataMDSgapfilling. r # Gap-filling (MDS) │ ├── NEEdataRFgapfilling. r # Gap-filling of long gaps (Random Forest) │ ├── Globalₚowerₐnalysis. m # Global wavelet power │ ├── Coherenceₐnalysis. m # Wavelet coherence │ ├── Phaseₐnalysis. m # Phase difference (wavelets) │ ├── wavelet-coherence-master/ # Grinsted et al. (2004) toolbox │ └── arcwiseₛigtest/ # Schulte arcwise significance toolbox ├── Figures/ # Code to generate the article figures ├── LICENSE └── README. md ``` ### Pipeline overview | Stage | File | Description | |---|---|---| | 1. Preparation | `NEEdataₚostₚrocess. r` | Data preparation | | 2. Mutual information | `Mutualᵢnformationₐnalysis. r` | Analysis using mutual information | | 3. Gap-filling (short) | `NEEdataMDSgapfilling. r` | Marginal distribution sampling (MDS) | | 4. Gap-filling (long) | `NEEdataRFgapfilling. r` | Random Forest (RF) ; also prepares data for coherence analysis | | 5. Wavelet power | `Globalₚowerₐnalysis. m` | Global wavelet power analysis | | 6. Wavelet coherence | `Coherenceₐnalysis. m` | Wavelet coherence analysis | | 7. Phase | `Phaseₐnalysis. m` | Phase difference analysis using wavelets | --- ## How to Run Run the R stages in order, then the MATLAB stages. **R (interactive) ** ```R source (". /Processing/NEEdataₚostₚrocess. r") source (". /Processing/Mutualᵢnformationₐnalysis. r") source (". /Processing/NEEdataMDSgapfilling. r") source (". /Processing/NEEdataRFgapfilling. r") ``` **MATLAB** ```matlab run ('. /Processing/Globalₚowerₐnalysis. m') run ('. /Processing/Coherenceₐnalysis. m') run ('. /Processing/Phaseₐnalysis. m') ``` Make sure the main path is set in accordance with your local settings. --- ## Reproducing the Figures Once the pipeline has produced its outputs, generate the article figures with the scripts in the `Figures/` subfolder. --- ## Acknowledgements The wavelet transform analysis makes use of the source code shared by **Grinsted, A. , Moore, J. C. , and Jevrejeva, S. (2004) **, *Application of the cross wavelet transform and wavelet coherence to geophysical time series*, Nonlinear Processes in Geophysics, 11, 561–566. The assessment of the statistical significance of the global wavelet power and global coherence spectra uses the toolbox *Cumulative Arcwise Significance of Global Wavelet Power and Global Coherence Spectra* (v1. 0. 0. 0) by **Justin Schulte**, distributed through the MATLAB Central File Exchange. Eddy covariance flux post-processing and gap-filling rely on the **REddyProc** package: Wutzler, T. , Lucas-Moffat, A. , Migliavacca, M. , Knauer, J. , Sickel, K. , Šigut, L. , Menzer, O. , and Reichstein, M. (2018): *Basic and extensible post-processing of eddy covariance flux data with REddyProc*, Biogeosciences, 15, 5015–5030, https: //doi. org/10. 5194/bg-15-5015-2018. Variable ranking based on mutual information uses the **varrank** package: Kratzer, G. , and Furrer, R. (2018): *varrank: an R package for variable ranking based on mutual information with applications to observed systemic datasets*, http: //arxiv. org/abs/1804. 07134. --- ## Contact - **Renaud Koukoui** — romeo. koukoui@imsp-uac. org - **Ossénatou Mamadou** — ossenatou. mamadou@imsp-uac. org ---
Koukoui et al. (Fri,) studied this question.
Synapse has enriched 5 closely related papers on similar clinical questions. Consider them for comparative context: