Script Library
BasicRainfallIntermediate
Rainfall Anomaly & Drought Index
Calculate rainfall anomalies and standardized precipitation index.
Pipeline (1 steps)
- Calculate rainfall anomalies and standardized precipitation index.
Datasets
- chirps-daily
Simulated previewPaste the script in Earth Engine for live results
Outputs the script produces
map Map layers
map Histogram
map Export GeoTIFF
map Area statistics
// Rainfall Anomaly
var chirps = ee.ImageCollection('UCSB-CHG/CHIRPS/DAILY')
.filterBounds(aoi);
var longTermMean = chirps.filterDate('1981-01-01','2020-12-31').mean();
var current = chirps.filterDate(startDate, endDate).mean();
var anomaly = current.subtract(longTermMean);
var result = anomaly.clip(aoi);# Rainfall Anomaly
import ee
chirps = ee.ImageCollection('UCSB-CHG/CHIRPS/DAILY').filterBounds(aoi)
long_term_mean = chirps.filterDate('1981-01-01','2020-12-31').mean()
current = chirps.filterDate(start_date, end_date).mean()
anomaly = current.subtract(long_term_mean)
result = anomaly.clip(aoi)