问题:
我刚接触GEE,关于您发的Google Earth Engine——Sentinel-5P (Sentinel-5P OFFL SO2)二氧化硫的使用和下载(中国区域案例分析和下载)这篇文章,我还想请教您个问题。您分享了中国区域SO2展示和下载的代码,但是这个代码里是11天的数据取平均后,镶嵌在一张图上?不知道我理解的是不是对的。我现在如果要下载三个月的数据,每三天的数据平均镶嵌在一张tif图上,(比如21年6月到8月的数据,0601-0603的数据均值在一张图上,0604-0606的数据均值在另一张图上)。请问我应该怎么修改代码呢?
这个问题其实很简单:只要修改日期就好了,然后把握们统计的量编程平均值即可,然后导出下载,但是这个问题有一个很严重的问题就是,因为时间短,所以很多地方都会有空值,所以建议还是逐日的数据要根据研究区内是否会产生空值来决定采取什么样的方式进行修补。
这里代码:
// 分别定义两年的影响数据筛选
//用时间节点获取你想要的影像
var y2019 = ee.ImageCollection("COPERNICUS/S5P/OFFL/L3_SO2").filterDate("2019-06-01","2019-06-3");
var y20191 = ee.ImageCollection("COPERNICUS/S5P/OFFL/L3_SO2").filterDate("2019-06-04","2019-06-6");
var y20192 = ee.ImageCollection("COPERNICUS/S5P/OFFL/L3_SO2").filterDate("2019-06-07","2019-06-9");
var y20193 = ee.ImageCollection("COPERNICUS/S5P/OFFL/L3_SO2").filterDate("2019-06-10","2019-06-12");
var y20194 = ee.ImageCollection("COPERNICUS/S5P/OFFL/L3_SO2").filterDate("2019-06-12","2019-06-15");
var y20195 = ee.ImageCollection("COPERNICUS/S5P/OFFL/L3_SO2").filterDate("2019-06-16","2019-06-18");
var y20196 = ee.ImageCollection("COPERNICUS/S5P/OFFL/L3_SO2").filterDate("2019-06-19","2019-06-20");
var y20196 = ee.ImageCollection("COPERNICUS/S5P/OFFL/L3_SO2").filterDate("2019-06-19","2019-06-20");
var y20197 = ee.ImageCollection("COPERNICUS/S5P/OFFL/L3_SO2").filterDate("2019-06-20","2019-06-22");
var y20198 = ee.ImageCollection("COPERNICUS/S5P/OFFL/L3_SO2").filterDate("2019-06-23","2019-06-25");
var y20199 = ee.ImageCollection("COPERNICUS/S5P/OFFL/L3_SO2").filterDate("2019-06-26","2019-06-28");
var y201910 = ee.ImageCollection("COPERNICUS/S5P/OFFL/L3_SO2").filterDate("2019-06-29","2019-06-30");
//获取中国边界
var countries = ee.FeatureCollection("USDOS/LSIB_SIMPLE/2017").filter(ee.Filter.eq("country_co", "CH"))
// 上色
var band_viz = {
min: 0.0,
max: 0.0005,
palette: ['black', 'blue', 'purple', 'cyan', 'green', 'yellow', 'red']
};
//图层加载
Map.addLayer(y2019.mean().select("SO2_column_number_density").clip(countries),band_viz," 2019");
Map.addLayer(y20191.mean().select("SO2_column_number_density").clip(countries),band_viz," 20191");
Map.addLayer(y20192.mean().select("SO2_column_number_density").clip(countries),band_viz," 20192");
Map.addLayer(y20193.mean().select("SO2_column_number_density").clip(countries),band_viz," 20193");
Map.addLayer(y20194.mean().select("SO2_column_number_density").clip(countries),band_viz," 20194");
Map.addLayer(y20195.mean().select("SO2_column_number_density").clip(countries),band_viz," 20195");
Map.addLayer(y20196.mean().select("SO2_column_number_density").clip(countries),band_viz," 20196");
Map.addLayer(y20197.mean().select("SO2_column_number_density").clip(countries),band_viz," 20197");
Map.addLayer(y20198.mean().select("SO2_column_number_density").clip(countries),band_viz," 20198");
Map.addLayer(y20199.mean().select("SO2_column_number_density").clip(countries),band_viz," 20199");
Map.addLayer(y201910.mean().select("SO2_column_number_density").clip(countries),band_viz," 201910");
至于下载的化:
//分别利用已经定义的影像名称来下载即可
Export.image.toDrive({
//这里的mean就代表求均值
image: y2019.mean().select("SO2_column_number_density").clip(countries),
region:countries,
scale:1000,
description: "CHINA_so2_1Km",
folder: 'CHINA_so2_1Km',
});