Analysis Code Supporting "Snow drought advances spring phenology in northern ecosystems"
收藏资源简介:
This repository contains the Python and R scripts supporting the manuscript entitled “Snow drought advances spring phenology in northern ecosystems.” The study investigates snow-drought dynamics, their effects on spring vegetation phenology, the associated climatic drivers and mechanisms, and their consequences for ecosystem productivity. The code is provided as a ZIP archive and should be extracted before use. The scripts are organized into five folders representing the principal stages of the analysis. The folders should generally be processed in alphabetical order from aSnowDroughtDynamics to eSOSShiftGPPConsequences, and the scripts within each folder should be run in numerical order. The aSnowDroughtDynamics folder contains four Python scripts. 01_last_snow_month.py calculates monthly snow-cover and snow-water-equivalent climatologies, identifies seasonally snow-covered pixels, and derives the pixel-specific climatological last snow month. 02_identify_snow_drought.py identifies annual snow-drought events from three-month SWE conditions and classifies them as warm, dry, or compound snow droughts according to precipitation and temperature thresholds. 03_snow_drought_frequency_severity.py calculates the frequency and relative SWE-deficit severity of the three snow-drought types. 04_snow_drought_hydroclimate.py calculates monthly hydroclimatic anomalies, aggregates them over the pixel-specific snow-drought window, and characterizes their differences relative to years without snow drought. The bPhenology folder contains three Python scripts for extracting vegetation phenology from MODIS EVI. 01_compute_evi_background.py estimates annual pixel-level background EVI using good-quality observations. 02_fit_daily_evi.py reconstructs daily EVI curves using double-logistic fitting. 03_extract_phenology.py derives annual start of season, peak of season, end of season, and growing-season length for 2000–2025. The cSnowDroughtSOSResponse folder contains 01_snow_drought_sos_response.py, which quantifies pixel-level start-of-season responses to warm, dry, and compound snow droughts relative to the mean SOS during years without snow drought. Negative response values indicate advanced SOS, whereas positive values indicate delayed SOS. The dSOSDriversAndMechanisms folder contains the scripts used to investigate the environmental controls and mechanistic pathways of SOS responses. 01_prepare_model_inputs.py calculates annual SOS anomalies, prepares dynamic and static predictors, aggregates environmental anomalies over the snow-drought and pre-SOS windows, and exports separate pixel-year tables for warm, dry, and compound snow droughts. 02_random_forest_shap.R performs random forest modeling, model evaluation, permutation importance, partial dependence, and SHAP analyses. 03_structural_equation_models.R applies structural equation modeling to examine the pathways linking snow, hydroclimatic, energy, and pre-SOS environmental conditions to SOS responses. The eSOSShiftGPPConsequences folder contains 01_sos_shift_gpp_response.py, which calculates early-season gross primary productivity within the climatological SOS-to-POS window and evaluates GPP responses associated with snow-drought-induced SOS advances and delays. The analysis is conducted separately for warm, dry, and compound snow droughts using the GOSIF, FluxSat, and MODIS GPP products. The original satellite, reanalysis, productivity, topographic, and ancillary datasets are not redistributed in this repository. These datasets are publicly available from their respective data providers, as documented in the manuscript’s Data availability section. The scripts use repository-relative input and output paths and are intended to reproduce the principal data-processing and statistical-analysis procedures after the required source data have been downloaded and prepared according to the spatial grids, units, and filename conventions specified in the code.



