-
Notifications
You must be signed in to change notification settings - Fork 43
/
Copy path00072_dust_freqecy
89 lines (63 loc) · 2.25 KB
/
00072_dust_freqecy
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
/*
Tutorial Code by Amirhossein Ahrari
YouTube: https://www.youtube.com/@amirhosseinahrarigee
This code is part of a tutorial series on Earth Engine programming techniques
presented on the Amirhossein Ahrari YouTube channel. You are free to use and modify
this code for academic and non-academic purposes. Don't forget to subscribe to
the Amirhossein Ahrari channel and follow the videos to support the instructor!
*/
var cor = [
[46.37795009113803,31.19808745265821],
[50.09132899738803,31.19808745265821],
[50.09132899738803,33.97465347249547],
[46.37795009113803,33.97465347249547],
[46.37795009113803,31.19808745265821]
]
var geometry = ee.Geometry.Polygon(cor)
Map.centerObject(geometry)
var time_start = ee.Date('2005')
var time_end = ee.Date('2016')
var unit = 'year'
var time_dif = time_end.difference(time_start, unit).round()
var aod = ee.ImageCollection("MODIS/061/MCD19A2_GRANULES")
.select('Optical_Depth_055')
.filterDate(time_start, time_end)
.filterBounds(geometry)
.filter(ee.Filter.eq('SATELLITE','T'))
var list = ee.List.sequence(0, time_dif.subtract(1), 1).map(function(delta){
return time_start.advance(delta, unit)
})
print(list)
var aod_collection = ee.ImageCollection(list.map(function(date){
var start_date = ee.Date(date)
var end_date = start_date.advance(1, unit)
var img_agg = aod.filterDate(start_date, end_date).map(function(img){
var bands = img.multiply(0.001)
var thr = bands.gt(0.5)
return thr}).sum()
// var img_agg = aod.filterDate(start_date, end_date).map(function(img){
// return img.multiply(0.001)
// .copyProperties(img, img.propertyNames())
// }).mean()
return img_agg
.set('system:time_start', start_date.millis())
.set('system:time_end', end_date.millis())
.set('system:index', start_date.format('YYYY-MM-dd'))
}))
print(aod_collection)
print(
ui.Chart.image.series(aod_collection, geometry, ee.Reducer.mean(), 1000, 'system:time_start')
)
var occ = aod_collection.map(function(img){
var thr = img.gt(0.5)
return thr
}).sum()
Map.addLayer(occ.clip(geometry),{min:0, max: 365},'occ',false)
Export.image.toDrive({
image: occ.clip(geometry),
description: 'aod_occ',
scale: 1000,
region: geometry,
crs: 'EPSG:4326',
folder: 'test'
})