I am pretty new on GEE and idk how easy is this task. I want to find daily precipitation for all Brazilian municipalities in 2006. I applied a map function with reduce regions and end up with a feature collection of municipalities. But I really need the date of reference for each element (day and month). I tried to use set function but idk how to guarantee each information would have the correct date from the image that was calculated. My ending goal is a table to export to google drive.
Here's my code:
var mun = ee.FeatureCollection("users/rodrigoccuri/BRMUE250GC_SIR");
// Importing Chirps dataset:
var chirps = ee.ImageCollection('UCSB-CHG/CHIRPS/DAILY');
// Filtering year 2006:
var chirps06 = chirps.filterDate('2006-01-01', '2006-12-31');
// Creating a function to reduce regions for each image by pixel mean for mun:
var reduce = function(image) {
return image.reduceRegions(mun, ee.Reducer.mean(), 1000)
}
// Appling reducer for each image in the collection:
var precmun06 = chirps06.map(reduce).flatten();
print(precmun06.first());