-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMODISFiltering
More file actions
36 lines (26 loc) · 1.56 KB
/
MODISFiltering
File metadata and controls
36 lines (26 loc) · 1.56 KB
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
var srtm = ee.Image("CGIAR/SRTM90_V4"),
pt = /* color: #d63000 */ee.Geometry.Point([-94.05706782341004, 43.65432823960525]),
modis = ee.ImageCollection("MODIS/006/MOD09GA");
var oeel=require('users/OEEL/lib:loadAll');
// only 2020
modis=modis.filterDate('2020-10-01','2021-01-01');
print(modis.first());
print(ui.Chart.image.series(modis.select('sur_ref.*'), pt, ee.Reducer.mean(), 1000));
// remove cloud
modis=modis.map(function(im){return im.updateMask(im.select('state_1km').bitwiseAnd(3).not());});
print(ui.Chart.image.series(modis.select('sur_ref.*'), pt, ee.Reducer.mean(), 1000));
modis=modis.map(oeel.Algorithms.MODIS.terrainShadow({dem:srtm}))
.map(function(im){return im.updateMask(im.select('shadowMask').not());});
print(modis.first());
print(ui.Chart.image.series(modis.select('sur_ref.*'), pt, ee.Reducer.mean(), 1000));
// interpolate between data and smooth out
modis=oeel.ImageCollection.SavatskyGolayFilter(modis,
ee.Filter.maxDifference(1000*3600*24*15, 'system:time_start', null, 'system:time_start'),
function(infromedImage,estimationImage){
return ee.Image.constant(ee.Number(infromedImage.get('system:time_start'))
.subtract(ee.Number(estimationImage.get('system:time_start'))));},
5,['sur_refl_b.*']);
print(modis);
print('Smoothed data',ui.Chart.image.series(modis.select('d_0_sur_ref.*'), pt, ee.Reducer.mean(), 1000));
print('Smoothed derivate',ui.Chart.image.series(modis.select('d_1_sur_ref.*'), pt, ee.Reducer.mean(), 1000));
print('list of functions used',oeel.refs());