I've been trying to write a function for time series data script that currently looks like this:
var fall_1987_mf = final_col
.select('ndvi','time')
.filterDate('1987-09-22','1987-12-22')
.reduce(ee.Reducer.percentile([80]))
.clip(mf);
Map.addLayer(fall_1987_mf,ndviParams,"fall 1987");
var fall_1988_mf = final_col
.select('ndvi','time')
.filterDate('1988-09-22','1988-12-22')
.reduce(ee.Reducer.percentile([80]))
.clip(mf);
Map.addLayer(fall_1988_mf,ndviParams,"fall 1989");
var fall_1989_mf = final_col
.select('ndvi','time')
.filterDate('1989-09-22','1989-12-22')
.reduce(ee.Reducer.percentile([80]))
.clip(mf);
Map.addLayer(fall_1989_mf,ndviParams,"fall 1989");
var fall_1990_mf = final_col
.select('ndvi','time')
.filterDate('1990-09-22','1990-12-22')
.reduce(ee.Reducer.percentile([80]))
.clip(mf);
Map.addLayer(fall_1990_mf,ndviParams,"fall 1990");
and so on…. This currently runs from 1982 to 2020 and I am going to do it for the three other seasons and I would obviously would prefer a more concise way to code this out. My ideal output is 12 image collections with one for each season in each of the 3 rois (mf, nf, and sf).
Link to full script: https://code.earthengine.google.com/93740a3a82c2354055f618ce00cdec47
Best Answer
You could map over a list of years:
https://code.earthengine.google.com/b78659321316f08cefbb2f0cb3dcb4b8