前几期我们介绍了MODIS和LANDSAT8遥感影像的MDVI时间序列,其他数据也与此类似,大家根据实际情况修改即可。本期我们介绍Sentinel-2   Level-2A数据在时间序列方面的研究。

COPERNICUS/S2_SR

如果想深入了解这两个数据集,可以登录:

https://sentinel.esa.int/web/sentinel/user-guides/sentinel-2-msi/product-types/level-2a

European Union/ESA/Copernicus

https://sentinel.esa.int/web/sentinel/user-guides/sentinel-2-msi/resolutions/radiometric

辐射分辨率介绍

  GEE官方介绍:Sentinel-2 is a wide-swath, high-resolution, multi-spectral imaging mission supporting Copernicus Land Monitoring studies, including the monitoring of vegetation, soil and water cover, as well as observation of inland waterways and coastal areas.

  The Sentinel-2 L2 data are downloaded from scihub. They were computed by running sen2cor. WARNING: ESA did not produce L2 data for all L1 assets, and earlier L2 coverage is not global.

  The assets contain 12 UINT16 spectral bands representing SR scaled by 10000 (unlike in L1 data, there is no B10). There are also several more L2-specific bands (see band list for details). See the Sentinel-2 User Handbook for details. In addition, three QA bands are present where one (QA60) is a bitmask band with cloud mask information. For more details, see the full explanation of how cloud masks are computed.

  EE asset ids for Sentinel-2 L2 assets have the following format: COPERNICUS/S2_SR/20151128T002653_20151128T102149_T56MNN. Here the first numeric part represents the sensing date and time, the second numeric part represents the product generation date and time, and the final 6-character string is a unique granule identifier indicating its UTM grid reference (see MGRS).

  Clouds can be removed by using COPERNICUS/S2_CLOUD_PROBABILITY. See this tutorial explaining how to apply the cloud mask.

  分辨率:10m

  熟悉的朋友应该都熟悉

Landsat8的NDVI计算是通过4、5波段,而哨兵2号数据的NDVI计算是通过4、8波段。

继续引用大佬的总结:

  NDVI = (近红外波段 - 红波段) / (近红外波段 + 红波段)

  针对每种卫星的波段,选用的波段都有所不同,公式如下:

  Landsat8: NDVI = (band5 - band4) / (band5 + band4)

  Sentinel2: NDVI = (band8 - band4) / (band8 + band4)

  Modis: NDVI = (band2 - band1) / (band2 + band1)

  ETM/TM: NDVI = (band4 - band3) / (band4 + band3)

  AVHRR: NDVI = (CH2 - CH1) / (CH2 + CH1)

  因为哨兵系列数据分辨率高,我们在研究过程中考虑的分辨率还是500。话不多说,开始~


//还是老样子哈,以广东省2020年为目标
var geometry = ee.FeatureCollection('users/ZhengkunWang/guangdongsheng')
Map.centerObject(geometry,7)
//还是原来的配方,还是原来的调色板
var colorizedVis = {min: -0.8,max: 0.8,palette: ['blue', 'white', 'green'],
};//使用QA波段去云
function maskS2clouds(image) {var qa = image.select('QA60');// Bits 10 and 11 are clouds and cirrus, respectively.var cloudBitMask = 1 << 10;var cirrusBitMask = 1 << 11;// Both flags should be set to zero, indicating clear conditions.var mask = qa.bitwiseAnd(cloudBitMask).eq(0).and(qa.bitwiseAnd(cirrusBitMask).eq(0));return image.updateMask(mask).divide(10000).set(image.toDictionary(image.propertyNames()));
}
//特别注意的是,在数学变换之后,保持原始影像的属性,所以这里.set(image.toDictionary(image.propertyNames()));就是这个意思
//sentinel2 and geometry
var S2_COL = ee.ImageCollection("COPERNICUS/S2").filterDate("2020-01-01", "2020-12-31").filter(ee.Filter.lt('CLOUDY_PIXEL_PERCENTAGE',20)).filterBounds(geometry).map(maskS2clouds).map(function(image){var ndvi = image.normalizedDifference(["B8","B4"]).rename('NDVI')return image.addBands(ndvi)}).select('NDVI');
print(S2_COL)
Map.addLayer(S2_COL.mean().clip(geometry), colorizedVis, 'col');
var S2_chart = ui.Chart.image.series({imageCollection: S2_COL.select('NDVI'),region: geometry,reducer: ee.Reducer.mean(),scale: 500}).setOptions({interpolateNulls: true,lineWidth: 2,title: 'NDVI Time Seires',vAxis: {title: 'NDVI'},hAxis: {title: 'Date'},trendlines: { 0: {title: 'NDVI_trend',type:'linear', showR2: true,  color:'red', visibleInLegend: true}}});
print(S2_chart);

  这次我们一气呵成

  观察这个时间序列可以发现,同一天因为有好多轨道影像的原因,导致同一天有很多不同的值,所以我们需要进行日平均或月平均计算。今天我们先介绍月平均的时间序列分析。

var geometry = ee.FeatureCollection('users/ZhengkunWang/guangdongsheng')
Map.centerObject(geometry,6)var colorizedVis = {min: -0.8,max: 0.8,palette: ['blue', 'white', 'green'],
};//使用QA波段去云
function maskS2clouds(image) {var qa = image.select('QA60');// Bits 10 and 11 are clouds and cirrus, respectively.var cloudBitMask = 1 << 10;var cirrusBitMask = 1 << 11;// Both flags should be set to zero, indicating clear conditions.var mask = qa.bitwiseAnd(cloudBitMask).eq(0).and(qa.bitwiseAnd(cirrusBitMask).eq(0));return image.updateMask(mask).divide(10000).set(image.toDictionary(image.propertyNames()));
}
var S2 = ee.ImageCollection('COPERNICUS/S2')
.filterDate('2020-01-01', '2020-12-31')
.filterBounds(geometry)
.filter(ee.Filter.lt('CLOUDY_PIXEL_PERCENTAGE', 20))
.map(maskS2clouds);
var addNDVI = function(image) {
return image.addBands(image.normalizedDifference(['B8', 'B4']).rename('NDVI'));
};
// Add NDVI band to image collection
var S2 = S2.map(addNDVI);
var NDVI = S2.select(['NDVI']);
print(NDVI);
var NDVImed = NDVI.median();
Map.addLayer(NDVImed.clip(geometry), colorizedVis, 'NDVI image');var years = ee.List.sequence(2020, 2020);
var months = ee.List.sequence(1, 12);
var S2_monthlymeanNDVI =  ee.ImageCollection.fromImages(years.map(function (y) {return months.map(function(m) {return NDVI.filter(ee.Filter.calendarRange(y,y, 'year')).filter(ee.Filter.calendarRange(m, m, 'month')).mean().set('year', y).set('month', m).set('system:time_start', ee.Date.fromYMD(y, m, 1));});}).flatten()
);
// Create a monthly time series chart.
var plotNDVI = ui.Chart.image.seriesByRegion(S2_monthlymeanNDVI, geometry,ee.Reducer.mean(),
'NDVI',500,'system:time_start').setChartType('LineChart').setOptions({interpolateNulls: true,title: 'NDVI Monthly time series',hAxis: {title: 'Date'},vAxis: {title: 'NDVI',viewWindowMode: 'explicit', viewWindow: {max: 0.7,min: 0.3,},gridlines: {count: 10,}},trendlines: { 0: {title: 'NDVI_trend',type:'linear', showR2: true,  color:'red', visibleInLegend: true}}});
// Display.
print(plotNDVI);

可能是影像太多了,算了好几分钟,终于搞定:

结果如图:

  看完时间序列的话,拟合性还可以,但是全年一直增长?这合适吗?而且日期序号也有错误,小编还在找问题,如果有大神看出来的话,可以指点我一下下。

更多精彩内容请关注:

GEEer成长日记五:Sentinel-2计算NDVI并逐月时间序列分析相关推荐

  1. GEEer成长日记十二:Modis_LST地表温度产品时间序列分析

    更多精彩内容请关注微信公众号:GEEer成长日记 今天我们介绍Modis_LST产品MODIS/006/MOD11A1,这款产品目前来说使用率很高,而且有每日数据,经过很多校正得到的. 之后我们将介绍 ...

  2. GEEer成长日记八:Landsat8_SR计算NDVI逐年时序变化,并通过影像判断城市扩张

    前几期我们挨个介绍了Modis.Landsat.Sentinel-2产品和数据在逐日和逐月时间序列方面的研究.还介绍了Whittaker Smoother在时间序列研究的应用.本期我们将介绍年尺度的时 ...

  3. GEEer成长日记十三:Landsat_SR计算地表温度时间序列

    更多精彩内容请关注微信公众号:GEEer成长日记 上期我们介绍了Modis_LST产品MODIS/006/MOD11A1的时间序列,因为这款产品是官方已经经过各种矫正和处理的产品,精度较高,且范围广, ...

  4. GEEer成长日记二十:使用Sentinel 2影像计算水体指数NDWI、MNDWI并下载到本地

    一.NDWI和MNDWI计算公式介绍 NDWI(归一化差异水体指数) NDWI = (GREEN-NIR)/(GREEN+NIR) 式中: GREEN为绿光波段: NIR为近红外波段.NDWI主要利用 ...

  5. GEEer成长日记二十一:Sentinel-2影像计算多种指数

    欢迎关注公众号:GEEer成长日记 本次计算Sentinel-2影像计算几种常用指数的方法: var s2 = ee.ImageCollection("COPERNICUS/S2_SR&qu ...

  6. GEEer成长日记十九:使用Landsat 8影像计算水体指数NDWI、MNDWI并下载到本地

    目录 一.NDWI和MNDWI计算公式介绍 1.NDWI(归一化差异水体指数) 2.MNDWI(改进的归一化差异水体指数) 二.使用Landsat8影像计算NDWI和MNDWI 1.获取Landsat ...

  7. GEEer成长日记一:GEE账号注册详细步骤

    写在最前面:非常开心能以这样的方式与各位同仁一起交流学习.作为GIS和RS的学生或从业者,GEE(Google Earth Engine)的出现无疑为我们的工作学习带来了很大的便利.短时间聚集了庞大的 ...

  8. GEEer成长日记九:Worldpop100m分辨率人口数据可视化及批量下载

    最近看到好多小伙伴在找Worldpop人口数据.小编之前去看的时候,全国的影像一张就4G左右,太大了.不过小编已经为大家搜集好了全国的数据,关注微信公众号:GEEer成长日记.即可获取. 今天我们主要 ...

  9. GEEer成长日记十七:在Google Earth Engine(GEE)中批量下载MODIS NDVI数据

    所使用数据集为:MOD13Q1.006 Terra Vegetation Indices 16-Day Global 250m 需注意的是,要得到真实的NDVI,需要乘以0.0001 完整代码如下: ...

最新文章

  1. 傅里叶变换时间复杂度
  2. 20101029总结
  3. python 一些函数语法中参数用中括号([])和逗号(,)嵌套表示是何种含义?可选参数
  4. el-input中设置onkeypress事件是否匹配正则表达式显示输入内容的格式
  5. sap 获取计划订单bapi_sapbapi的清单.doc
  6. sql语句中 and 与or 的优先级
  7. 组成原理---补码加减法,原码一两位乘法,补码一两位乘法,754标准
  8. 重磅消息,Redis开源作者宣布不再维护Redis项目!
  9. 继承ActionSupport实现Action
  10. android之LitePal 3.0 的基本使用
  11. 修改Android 模拟器IMEI
  12. etcd教程(二)—clientv3简单使用
  13. elasticsearch 聚合搜索
  14. 十年自学编程成才(编程小白必看)
  15. 光与色的故事--颜色模型浅析
  16. 《第一行代码》 第一章:第一行Android代码
  17. 跨越40年的甲骨文公司,正在成为年轻一代的时尚选择
  18. 除了霸王洗发水,还能怎么拯救程序员的发际线?
  19. 有关光照模块的具体问题及解决方案
  20. 开源走向世界(上):开源构建全球化的舞台丨BDTC 2021

热门文章

  1. 微信数据分析功能为大数据战略铺路
  2. 【HTML】零基础入门教程
  3. 2023年第二十届五一数学建模B题:快递需求分析问题-思路详解
  4. 2017年最新黑马Python2017年就业班不加密视频教程
  5. C++A类继承B C类_基金定投买a类还是c类好,c类基金为什么不适合定投
  6. 2021上半年信息系统项目管理师真题与答案
  7. 一键打造自己的Gilde图片加载控件
  8. 原来程序员的母亲节可以这样温馨!
  9. oracle修改表字段名备注_Oracle修改表或者字段的注释
  10. 橙心优选模式的小程序/APP开发需要多少钱?