-
Notifications
You must be signed in to change notification settings - Fork 0
/
ros_vars
104 lines (90 loc) · 2.84 KB
/
ros_vars
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
var start = ee.Date('2011-01-01');
var finish = ee.Date('2011-12-31');
var bbox = ee.Geometry.Rectangle({coords:[-180,-90,180,90],geodesic:false});
var biomass = ee.Image('WHRC/biomass/tropical').select('Mg');
print(biomass,'biomass');
//users/potapovpeter/GEDI_V27
var canH = ee.ImageCollection("users/potapovpeter/GEDI_V27");
print(canH,'canopy height');
var visParams = {
min: 0.0,
max: 30.0,
palette: [
'FFFFFF', 'CE7E45', 'DF923D', 'F1B555', 'FCD163', '99B718', '74A901',
'66A000', '529400', '3E8601', '207401', '056201', '004C00', '023B01',
'012E01', '011D01', '011301'
],
};
Map.addLayer(canH, visParams, 'Aboveground Live Woody Biomass');
/*
var monthly_evi = ee.List.sequence(0, 11).map(function(n) { // .sequence: number of months from starting year to present
var start = ee.Date('2011-01-01').advance(n, 'month'); // Starting date
var end = start.advance(1, 'month'); // Step by each iteration
var eviterr = ee.ImageCollection("MODIS/006/MOD13Q1")
.select('EVI')
.filterDate(start,end)
.mean().multiply(0.0001)
.set('date', start);
var eviaqua = ee.ImageCollection("MODIS/006/MYD13Q1")
.select('EVI')
.filterDate(start,end)
.mean().multiply(0.0001)
.set('date', start);
var lai = ee.ImageCollection("MODIS/006/MYD15A2H")
.select('Lai_500m')
.filterDate(start,end)
.mean().multiply(0.1)
.set('date', start);
var evi = eviterr.add(eviaqua).divide(2).set('date', start);
return evi.addBands(lai);
});
monthly_evi = ee.ImageCollection(monthly_evi);
print(monthly_evi,'evi');
var palsar = ee.ImageCollection("JAXA/ALOS/PALSAR/YEARLY/SAR")
.select('HH','HV')
.filterDate(ee.Date('2009-01-01'),ee.Date('2009-12-12')).
palsar = ee.Image(palsar)
.pow(2).log10().multiply(10).subtract(83);
print(palsar,'sar');
var strct = biomass.addBands(palsar);
print(strct,'structure');
var visParams = {
min: 0.0,
max: 350.0,
palette: [
'FFFFFF', 'CE7E45', 'DF923D', 'F1B555', 'FCD163', '99B718', '74A901',
'66A000', '529400', '3E8601', '207401', '056201', '004C00', '023B01',
'012E01', '011D01', '011301'
],
};
//Map.setCenter(-69.43, 0.35, 3);
var shapes = ee.FeatureCollection("users/dsandovalhdh/fire_perimeter_2011");
Map.addLayer(biomass, visParams, 'Aboveground Live Woody Biomass');
//Map.addLayer(shapes);
var values= strct.reduceRegions({
collection: shapes,
reducer: ee.Reducer.mean(),
scale: 250
});
//console.log(values);
Export.table.toDrive(values,
"fire_project",
"fire_veg",
"fire_veg");
/*
var values = monthly_evi.map(function(image) {
return image.reduceRegions({
collection: shapes,
reducer: ee.Reducer.mean(),
scale: 250
}).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_project",
"fire_veg",
"fire_veg");
*/