-
Notifications
You must be signed in to change notification settings - Fork 0
/
VIIRS-VNP09GA.js
85 lines (68 loc) · 2.38 KB
/
VIIRS-VNP09GA.js
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
// change latitude and longitude
var region = ee.Geometry.Rectangle(113.5,22,114.5,23)
// change data date
var dataset = ee.ImageCollection('NOAA/VIIRS/001/VNP09GA')
.filter(ee.Filter.date('2013-01-01', '2013-12-31'))
.filterBounds(region);
var rgb = dataset.select(['M5', 'M4', 'M3']); //recommended
//var rgb = dataset.select(['M5']); // use only single band
//var rgb = dataset.select(['I3', 'I2', 'I1']); // false color map
var toband = rgb.toBands() // covert data to multiple-channel image
var rgbVis = {
min: 0.0,
max: 3000.0,
};
print(toband) // see console check for the total number of channels
Map.setCenter(113.5, 22, 10); // show image in GEE, *arguments: center longitude, center latitude, zoom level (the larger the closer)
Map.addLayer(rgb, rgbVis, 'RGB'); // show image in GEE
Export.image.toDrive(
{
image: toband,
description: 'cloud2013b', // export to Google Drive with this file name
scale: 500, // resolution, fixed to 500 (m) is okay
fileFormat: 'GeoTIFF',
maxPixels: 3784216672400,
region: region,
crs: 'EPSG:4326'
}
);
//2
// change latitude and longitude
// kr
var lon1 = 126.7
var lon2 = 128.7
var lat1 = 35.95
var lat2 = 38.2
// tw
var lon1 = 120.2
var lon2 = 121.54
var lat1 = 22.58
var lat2 = 25.1
var region = ee.Geometry.Rectangle(lon1,lat1,lon2,lat2)
var year = '2019'
// change data date
var dataset = ee.ImageCollection('NOAA/VIIRS/001/VNP09GA')
.filter(ee.Filter.date(year+'-01-01', year+'-12-31'))
.filterBounds(region);
var rgb = dataset.select(['M5', 'M4', 'M3']); //recommended
//var rgb = dataset.select(['M5']); // use only single band
//var rgb = dataset.select(['I3', 'I2', 'I1']); // false color map
var toband = rgb.toBands() // covert data to multiple-channel image
var rgbVis = {
min: 0.0,
max: 3000.0,
};
print(toband) // see console check for the total number of channels
Map.setCenter(lon1+0.2, lat1+0.2, 10); // show image in GEE, *arguments: center longitude, center latitude, zoom level (the larger the closer)
Map.addLayer(rgb, rgbVis, 'RGB'); // show image in GEE
Export.image.toDrive(
{
image: toband,
description: 'cloud_kr'+year, // export to Google Drive with this file name
scale: 500, // resolution, fixed to 500 (m) is okay
fileFormat: 'GeoTIFF',
maxPixels: 3784216672400,
region: region,
crs: 'EPSG:4326'
}
);