-
Notifications
You must be signed in to change notification settings - Fork 0
/
litter_extract
50 lines (41 loc) · 1.57 KB
/
litter_extract
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
48
49
50
var start = ee.Date('2019-01-01');
var finish = ee.Date('2019-01-02');
var bbox = ee.Geometry.Rectangle({coords:[-180,-90,180,60],geodesic:false});
var biomass = ee.Image('WHRC/biomass/tropical').select('Mg');
print(biomass,'biomass');
//var frp = ee.ImageCollection("NOAA/GOES/16/FDCF").select('Power').filterDate(start,finish).sum();
//var bbox = ame.bounds();
//print(frp,'frp');
var litter = ee.FeatureCollection("users/dsandovalhdh/litter_sample").filterBounds(bbox);
print(litter,'litter');
Map.addLayer(litter);
//aggregation to monthly
var data_month = ee.List.sequence(0, 155).map(function(n) { // .sequence: number of years from starting year to present
var start = ee.Date('2003-01-01').advance(n, 'month'); // Starting date
var end = start.advance(1, 'month'); // Step by each iteration
var laimean= ee.ImageCollection("MODIS/006/MYD15A2H")
.select('Lai_500m')
.filterDate(start,end)
.mean().multiply(0.1).reproject('EPSG:4326', null, 500)
.set('date', start);
return laimean;
//return dlai.addBands(alph).addBands(gpp);
//return frp;
});
data_month = ee.ImageCollection(data_month);
print(data_month,'data_month');
var values = data_month.map(function(image) {
return image.reduceRegions({
collection: litter,
reducer: ee.Reducer.mean(),
scale: 1000
}).map(function(feature) {
// Add some identifying information from the image.
return feature.set('date', image.get('date'))
})
}).flatten();
// console.log(values);
Export.table.toDrive(values,
"Fire_analysis",
"ROS_cor",
"ROS_cor");