0

The total amount of precipitation for the same days using data from 'UCSB-CHG/CHIRPS/DAILY' gave almost identical amounts of precipitation for a large country and for a city in the country.

How can I find the total precipitation accurately?

var countries=ee.FeatureCollection('FAO/GAUL/2015/level2');
var Turkey=countries.filter(ee.Filter.eq('ADM0_NAME','Turkey'));

var city= countries.filter(ee.Filter.eq('ADM1_NAME','Istanbul'));


var chirps = ee.ImageCollection("UCSB-CHG/CHIRPS/DAILY").select('precipitation')
.filterDate('2001-01-01','2001-02-01')


print(
  ui.Chart.image.series({
    imageCollection: chirps,
    region: Turkey,
    reducer: ee.Reducer.mean(),
    scale: 1000
  }).setOptions({title: 'Total Rainfall at Country'})
);

print(
  ui.Chart.image.series({
    imageCollection: chirps,
    region: city,
    reducer: ee.Reducer.mean(),
    scale: 1000
  }).setOptions({title: 'Total Rainfall at City'})
);

1 Answer 1

0

The reducer mean() is the issue. Change it to sum() and you will get the total precipitation value.

print(
  ui.Chart.image.series({
    imageCollection: chirps,
    region: Turkey,
    reducer: ee.Reducer.sum(),
    scale: 1000
  }).setOptions({title: 'Total Rainfall at Country'})
);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.