This project provides a Python script to analyze groundwater level time series data. It is a recreation of the analysis presented in a series of supplementary figures. Since the original data was not available, the script uses synthetically generated data that mimics the key characteristics of the original dataset (trend, seasonality, etc.).
The groundwater_analysis.py script performs the following analysis steps:
- Synthetic Data Generation: Creates a realistic groundwater time series with trend and seasonal components.
- Imputation of Missing Data: Simulates missing data points and fills them using linear interpolation.
- Singular Spectrum Analysis (SSA): Decomposes the time series into its primary trend and residual components.
- Spectral Analysis: Calculates and plots the power spectral density of the time series to identify dominant periodicities.
- Mann-Kendall Trend Test: Performs a Mann-Kendall test to statistically identify the presence of a monotonic trend in the data.
-
Install dependencies:
pip install -r requirements.txt
-
Run the analysis script:
python groundwater_analysis.py
Running the script will generate the following output files, which are recreations of the original figures:
Fig_S1_recreated.png: Temporal analysis showing observed vs. imputed data.Fig_S2_recreated.png: Periodogram showing the spectral analysis results.Fig_S4_recreated.png: A conceptual map showing the spatial distribution of trends.Fig_S5_recreated.png: SSA decomposition of the time series into trend and residuals.
The script will also print the results of the Mann-Kendall trend test to the console.