-
Notifications
You must be signed in to change notification settings - Fork 0
/
heatOut
89 lines (70 loc) · 2.13 KB
/
heatOut
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
var start = ee.Date('2001-01-01');
var end = ee.Date('2020-09-01');
var bbox = ee.Geometry.Rectangle({coords:[-60, -21, -56, -17],geodesic:false});
//load biomass -180,-90,180,60
var biomass = ee.Image('WHRC/biomass/tropical').select('Mg');
print(biomass,'biomass');
//load raw FRP, force all to the same projections
var FRPmod=ee.ImageCollection("MODIS/006/MOD14A1").filterBounds(bbox).filterDate(start, end).select('MaxFRP').max().multiply(0.1);
var FRPmyd=ee.ImageCollection("MODIS/006/MYD14A1").filterBounds(bbox).filterDate(start, end).select('MaxFRP').max().multiply(0.1);
var FRPmax = FRPmod.addBands(FRPmyd);
// Reduce the image to get a one-band maximum value image.
var FRPmax = FRPmax.reduce(ee.Reducer.max()).reproject({crs:'EPSG:4326',scale:1000});
print(FRPmax,'FRPmax');
// get area per pixel m2
var pixelarea = ee.Image.pixelArea().reproject({crs:'EPSG:4326',scale:1000}).clip(bbox);
//print(pixelarea,'area');
var Homax=FRPmax.divide(pixelarea);
var firesVis = {
min: 0,
max: 20,
palette: ['red', 'orange', 'yellow'],
};
//Map.addLayer(Homax, firesVis, 'Homax');
// Export the image, specifying scale and region.
Export.image.toDrive({
image: Homax,
description: 'max_frp_1km',
scale: 1000,
region: bbox
});
/*
// Export the image, specifying scale and region.
Export.image.toDrive({
image: Homax,
description: 'max_frp',
scale: 5000,
region: bbox
});
/*
//get max value.
var maxFRPvalue = Homax.reduceRegion({
reducer: ee.Reducer.max(),
geometry: bbox,
scale: 1000,
maxPixels: 1e11,
bestEffort: true,
tileScale: 16
});
Export.table.toDrive({
collection: ee.FeatureCollection([
ee.Feature(null, maxFRPvalue)
]),
description: 'Homax_from_FRP',
fileFormat: 'CSV'
});
/*
var maxFRPvalue = FRPmax.reduceRegion({
reducer: ee.Reducer.max(),
geometry: bbox,
scale: 1000,
maxPixels: 1e11
});
var ridiculousComputation = ee.Image(1).reduceRegion({
reducer: 'count',
geometry: ee.Geometry.Rectangle([-180, -90, 180, 90], null, false),
scale: 100,
maxPixels: 1e11
});
print(maxFRPvalue,'maxFRPvalue');
*/