Ground-truthing has never been so easy as with the GEE.

In this excercise we are going to validate the CHIRPS rainfall product with rainfall stations in the field.

Step 1: Import the Chirps image collection into the GEE.

Step 2: Import the fusion table with field measurement location.

var Rainfallstations = ee.FeatureCollection('ft:1vnNFgZt4avuVXjYm2gYsqr-25hzVefHUq3TCwUCu','geometry');

Step 3: Setup the time range for the dataseries.

// Define time range
var startyear = 2000;
var endyear = 2005;

// Set date in ee date format
var startdate = ee.Date.fromYMD(startyear,1,1);
var enddate = ee.Date.fromYMD(endyear,12,31)

Step 4: Create a list with years and months.

// create list for years
var years = ee.List.sequence(startyear,endyear);

// make a list with months
var months = ee.List.sequence(1,12);

Step 5: Filter for data and location.

// Filter chirps
var Pchirps = chirps.filterDate(startdate, enddate)
  // Sort chronologically in descending order.
  .sort('system:time_start', false)

Step 6: Calculate the monthly rainfall with the function below.

// calculate the P for each month
var MonthlyChirps =  ee.ImageCollection.fromImages( (y) {
    var w = Pchirps.filter(ee.Filter.calendarRange(y, y, 'year'))
             .filter(ee.Filter.calendarRange(m, m, 'month'))
    return w.set('year', y)
             .set('month', m)
             .set('date', ee.Date.fromYMD(y,m,1))

Step 7: Add the sampling points to the map

// add items to the map
Map.addLayer(Rainfallstations,false,"rainfall stations");

Step 8: Create a chart that samples all points for the whole image collection

// Predefine the chart titles.
var title = {
  title: 'Precipitation',
  hAxis: {title: 'Time'},
  vAxis: {title: 'P (mm)'},

// create a chart with a reducer
var chart = ui.Chart.image.seriesByRegion(
  MonthlyChirps, Rainfallstations, ee.Reducer.mean(), 'precipitation', 5000, 'system:time_start', 'station')


Step 9: Click the pop out icon in the right top corner.


Step 10: Download the csv file.


Step 11: Calculate the mean and compare it with the measured data.

See an example here.