NetCDF Territorial Classification and Python Colab Scripts Based on Band-Pass Filtered SbAI Time-Series Signals Between 0.1 and 0.5 Cycles per Year in Southern South America (Argentina, Chile, and Uruguay). (TS-BP-2-10)

Otros responsables
Fecha
Publicador:
Consejo Nacional de Investigaciones Científicas y Técnicas
Fecha de depósito:
27/05/2026
Fecha de creación:
20/5/2026
Clasificación temática
Palabras clave
Resumen
This notebook implements a complete pipeline for FIR bandpass filtering and spatial classification of SbAI data:
- Applies a FIR bandpass filter (1.5–10 years, 127 taps) to isolate mid‑frequency variability.
- Normalizes and interpolates missing values along the time axis.
- Saves filtered series as NetCDF for reproducibility.
- Performs clustering with KMeans++ using a two‑stage scaling strategy:
- RobustScaler to mitigate outliers.
- StandardScaler to normalize temporal profiles.
- Generates classification maps with geographic boundaries.
- Extracts both cluster centroids and representative series closest to centroids.
- Computes clustering quality metrics (Silhouette, explained variance, relative reconstruction error).
- Runs an Elbow Method test to evaluate optimal number of clusters using:
- Inertia (SSE).
- Explained variance (R²).
- Relative reconstruction error (%).
Información Técnica
The workflow consists of:
1. Mount Google Drive and define the working directory (`base_dir`).
2. Load raw CSV (`SbAI16_era5_roi2_latlon_fecha.csv`).
3. Apply FIR bandpass filter (1.5–10 years, 127 taps).
- Save output in `netcdf_sbai_025_bandpass_fir.nc`.
4. Classification:
- Stack filtered series into pixel × time matrix.
- Apply scaling:
- RobustScaler + StandardScaler → `classif_kmeans_TS-BP2-10.nc`.
- Run KMeans++ (n_clusters=5, n_init=10).
- Save cluster maps, centroids, and representative series.
5. Visualization:
- Maps of clusters with canvas boundaries (`canvas.gpkg`).
- Centroids and representative series plotted with publication‑ready formatting.
6. Metrics:
- Silhouette index.
- Explained variance (R²).
- Relative reconstruction error.
7. Elbow Method:
- Iterates k=2…20 clusters.
- Computes inertia (SSE), explained variance (R²), and relative reconstruction error (%).
- Produces separate plots for each metric to guide cluster selection.
Colecciones
Condiciones de uso
Las buenas prácticas científicas esperan que se otorgue el crédito adecuado mediante una citación. Utilice un formato de citación y aplique estas normas de reutilización:
Licencia Creative Commons
Excepto donde se indique lo contrario, la licencia de este ítem se describe como by-nc-sa
Archivos
ARCHIVO
NOTAS DE USO
TAMAÑO
