前兩次我們介紹了MODIS_NDVI和LANDSAT8_NDVI產(chǎn)品的時間序列,它們都是基于Landsat8_TOA影像制成的。實際工作中我們還需要通過LANDSAT8_SR影像進行NDVI時間序列分析,那么該怎么開展工作呢?本期我們就來介紹介紹。
下一期我們將介紹Sentinel-2數(shù)據(jù)在時間序列方面的研究。
LANDSAT/LC08/C01/T1_SR (deprecated)
?如果想深入了解這兩個數(shù)據(jù)集,可以登錄:
Landsat Surface Reflectance | U.S. Geological Survey
官方介紹:This dataset is the atmospherically corrected surface reflectance from the Landsat 8 OLI/TIRS sensors. These images contain 5 visible and near-infrared (VNIR) bands and 2 short-wave infrared (SWIR) bands processed to orthorectified surface reflectance, and two thermal infrared (TIR) bands processed to orthorectified brightness temperature
These data have been atmospherically corrected using?LaSRC?and includes a cloud, shadow, water and snow mask produced using?CFMASK, as well as a per-pixel saturation mask.
Strips of collected data are packaged into overlapping "scenes" covering approximately 170km x 183km using a?standardized reference grid.
See also?the USGS page on SR QA bands.
SR can only be produced for Landsat assets processed to the?L1TP level
Data provider notes:
-
Although Surface Reflectance can be processed only from the Operational Land Imager (OLI) bands, SR requires combined OLI/Thermal Infrared Sensor (TIRS) product (LC8) input in order to generate the accompanying cloud mask. Therefore, OLI only (LO8), and TIRS only (LT8) data products cannot be calculated to SR.
-
SR is not run for a scene with a solar zenith angle greater than 76°.
-
Users are cautioned to avoid using SR for data acquired over high latitudes (> 65°).
-
The panchromatic band (ETM+ Band 7, OLI Band 8) is not processed to Surface Reflectance.
-
Efficacy of SR correction will be likely reduced in areas where atmospheric correction is affected by adverse conditions:
-
Hyper-arid or snow-covered regions
-
Low sun angle conditions
-
Coastal regions where land area is small relative to adjacent water
-
Areas with extensive cloud contamination
-
This product is generated by Google using a Docker image supplied by USGS.
分辨率:30m
波段介紹:
首先在計算NDVI之前,我們先了解幾種NDVI計算的方式,感謝大佬的總結(jié)(https://blog.csdn.net/weixin_43360896/article/details/108344915)。我就直接搬用了。
//方法一:普通方式,通過將數(shù)學(xué)公式翻譯為代碼直接計算
function NDVI_V1(img) {
var nir = img.select("B5");
var red = img.select("B4");
var ndvi = nir.subtract(red).divide(nir.add(red));
return ndvi;
}
//方法二:將計算公式直接帶入,通過解析字符串實現(xiàn)計算。這種方式更加靈活,在某些特殊情況下非常好用,而且非常直觀。
//在這里多插一嘴,這個img.expression在復(fù)雜公式計算的時候,可謂真香!屢試不爽
function NDVI_V2(img) {
var nir = img.select("B5");
var red = img.select("B4");
var ndvi = img.expression(
"(B5 - B4)/(B5 + B4)",
{
"B5": nir,
"B4": red
});
return ndvi;
}
//方法三:GEE將計算公式封裝為一個方法可以直接調(diào)用
function NDVI_V3(img) {
var ndvi = img.normalizedDifference(["B5","B4"]);
return ndvi;
}
? 好了,介紹完幾種NDVI的計算方法后,我們使用第三種方法開始進行時間序列分析。
//還是老樣子哈,以廣東省2020年為目標(biāo)
var geometry = ee.FeatureCollection('users/ZhengkunWang/guangdongsheng')
Map.centerObject(geometry,6)
var colorizedVis = {
min: -0.8,
max: 0.8,
palette: ['blue', 'white', 'green'],
};
//去云的方法照搬就可以,想深入了解的同學(xué)可以去看看波段介紹
//cloud mask
function maskL8sr(image) {
// Bits 3 and 5 are cloud shadow and cloud, respectively.
var cloudShadowBitMask = (1 << 3);
var cloudsBitMask = (1 << 5);
// Get the pixel QA band.
var qa = image.select('pixel_qa');
// Both flags should be set to zero, indicating clear conditions.
var mask = qa.bitwiseAnd(cloudShadowBitMask).eq(0)
.and(qa.bitwiseAnd(cloudsBitMask).eq(0));
return image.updateMask(mask);
}
var col = ee.ImageCollection('LANDSAT/LC08/C01/T1_SR')
.map(maskL8sr)
.filterDate('2020-01-01','2020-12-31')
.filterBounds(geometry)
.map(function(image){
var ndvi = image.normalizedDifference(['B5', 'B4']).rename('NDVI');
return image.addBands(ndvi)
})
.select('NDVI');
Map.addLayer(col.mean().clip(geometry), colorizedVis, 'col');
結(jié)果如圖:
print(ui.Chart.image.series(col, geometry, ee.Reducer.mean(), 500));
結(jié)果如圖:
其實看完時間序列,還是會發(fā)現(xiàn),有好多異常值。對我們的研究來說肯定是不適用的。
我們先研究研究它的變化趨勢吧。
var landsat8trendline = Chart.image.series(col, geometry, ee.Reducer.mean(), 500);
landsat8trendline = landsat8trendline
.setOptions({
title: 'Landsat 8 SR NDVI',
hAxis: {title: 'Date', gridlines: {count: 10}},
vAxis: {title: 'NDVI',viewWindowMode: 'explicit', viewWindow: {max: 1,min: -0.25,},gridlines: {count: 5,}},
interpolateNulls: true,
lineWidth: 1,
pointSize: 1,
trendlines: { 0: {title: 'NDVI_trend',type:'linear', showR2: true, color:'red', visibleInLegend: true}}
});
print(landsat8trendline)
這次我們在趨勢線分析的時候,還加入了趨勢線的相關(guān)系數(shù)R2進行分析,雖然結(jié)果0.033,但是看起來還算可以。強行接受
既然結(jié)果不太美觀,我們在進行月平均分析一波吧。
var years = ee.List.sequence(2020, 2020);
var months = ee.List.sequence(1, 12);
var landsat8monthlymeanNDVI = ee.ImageCollection.fromImages(
years.map(function (y) {
return months.map(function(m) {
return col.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()
);
print(ui.Chart.image.series(landsat8monthlymeanNDVI, geometry, ee.Reducer.mean(), 500));
? 稍微平滑了一點點吧算是。再加入趨勢線看看相關(guān)系數(shù)
var monthlymeantrendline = Chart.image.series(landsat8monthlymeanNDVI, geometry, ee.Reducer.mean(), 500);
monthlymeantrendline = monthlymeantrendline
.setOptions({
title: 'Landsat 8 SR NDVI',
hAxis: {title: 'Date', gridlines: {count: 10}},
vAxis: {title: 'NDVI',viewWindowMode: 'explicit', viewWindow: {max: 1,min: -0.25,},gridlines: {count: 5,}},
interpolateNulls: true,
lineWidth: 1,
pointSize: 1,
trendlines: { 0: {title: 'NDVI_trend',type:'linear', showR2: true, color:'red', visibleInLegend: true}}
});
print(monthlymeantrendline)
? 哈哈,相關(guān)系數(shù)翻了10倍。其實趨勢沒有變,只是月平均NDVI更加平滑罷了。不過月平均分析還是挺管用的。
更多精彩內(nèi)容請關(guān)注:
?文章來源地址http://www.zghlxwxcb.cn/news/detail-412936.html文章來源:http://www.zghlxwxcb.cn/news/detail-412936.html
?
到了這里,關(guān)于GEEer成長日記四:Landsat8_SR計算NDVI并時間序列分析的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!