I want to calculate seasonal variations of LST over some years
what I have so far is monthly average but can't make seasons out of those months !!
here is my code
var LandsatLST = require('users/sofiaermida/landsat_smw_lst:modules/Landsat_LST.js')
var geometry = ee.Geometry.Rectangle( 32.96780026,28.39841527,32.97560417,28.40330991);
var satellite = 'L7';
var date_start = '2000-01-01';
var date_end = '2021-12-30';
var use_ndvi = true;
var LandsatColl = LandsatLST.collection(satellite, date_start, date_end, geometry, use_ndvi)
var LandsatColl = LandsatColl.select("LST")
//#convert to Celsius
var LandsatColl = LandsatColl.map(function(img) {
return img
.subtract(273.15)
.copyProperties(img, ['system:time_start']);
});
var years = ee.List.sequence(2000, 2021);
var months = ee.List.sequence(1, 12);
var yrMo = ee.ImageCollection.fromImages(
years.map(function (y) {
return months.map(function (m) {
return LandsatColl
.filter(ee.Filter.calendarRange(y, y, 'year'))
.filter(ee.Filter.calendarRange(m, m, 'month'))
.mean()
.set('Month', m)
.set('year',y)
.copyProperties(LandsatColl, ['system:time_start']);
});
}).flatten());
I want to filter the image collection by seasonal average, I tried :
var seasons = ee.List([[1,3], [4,6], [7,9],[10,12]])
var createSeasonComposites = function(months) {
var startMonth = ee.List(months).get(0)
var endMonth = ee.List(months).get(1)
var monthFilter = ee.Filter.calendarRange(startMonth, endMonth, 'month')
var seasonFiltered = yrMo.filter(monthFilter)
var composite = seasonFiltered.mean()
return composite
}
var compositeList = seasons.map(createSeasonComposites)
print(compositeList,"seasons")
but the ee.Filter.calendarRange() doesn't work in my case due to the absence of timestamps which I tried to add but failed ?!
Any help how to make the seasonal averages ?