The goal I am trying to achieve is to output imagery for my roi representing maximum NDVI for each season for each year in my Landsat time series (1982 - 2020). I know how to make greenest pixel composites in earth engine and divide it annually using this method:
function ndviForYear(year) {
var startDate = ee.Date.fromYMD(year, 1, 1);
var collection = final_col
.filterDate(startDate, startDate.advance(1, 'year'));
var reduced = collection
.select('nd','system:time_start')
.reduce(ee.Reducer.count()
.combine(ee.Reducer.percentile([80]), null, true)
);
return reduced
.select('nd_p80','system:time_start_p80')
.set('year', year);
}
var ndviCollection = ee.ImageCollection(
ee.List.sequence(1982, 2020).map(ndviForYear)
);
I want a similar output, but instead of one image for each year, I want maximum (80th percentile) seasonal NDVI -- so four images per year (winter, spring, summer, fall). Does anyone know how to easily modify this script to achieve this?
Here is the full code link: https://code.earthengine.google.com/88ebcdcce75e477236b8f74f222319e9 Here is the link to the roi asset: https://code.earthengine.google.com/?asset=users/alo266/Sierra_Ancha