-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMODIS_video
47 lines (46 loc) · 1.2 KB
/
MODIS_video
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/**** Start of imports. If edited, may not auto-convert in the playground. ****/
var africa = /* color: #00d6cc */ee.Geometry.Polygon(
[[[-19.69, 37.72],
[-19.69, -35.46],
[53.44, -35.46],
[53.44, 37.72]]]);
/***** End of imports. If edited, may not auto-convert in the playground. *****/
var imgArr = [];
var year = 2001;
while (year < 2017) {
var month = 1;
while (month < 13) {
var start = ee.Date(year + '-' + month + '-01');
month++;
var end;
if(month == 13) {
var y = year + 1;
month--;
end = ee.Date(y + '-' + month + '-01');
break;
} else {
end = ee.Date(year + '-' + month + '-01');
}
var FIRMS = ee.ImageCollection('FIRMS')
.filterDate(start, end)
var sum = FIRMS.reduce(ee.Reducer.sum())
var binary = sum.divide(sum).select('T21_sum')
.rename('binary')
.visualize({palette: ['FF0000']})
imgArr.push(binary)
}
month = 1
year++
}
var images = ee.ImageCollection(imgArr)
print(images)
Map.addLayer(images)
Export.video.toDrive({
collection: images,
description: 'videoTest',
dimensions: 720,
framesPerSecond: 12,
region: africa
});
Map.addLayer(africa)
Map.centerObject(africa)