組合數(shù)據(jù)
主要功能
組合指定時間段(六個月)的LC8數(shù)據(jù)
代碼
// Composite 6 months of Landsat 8.
// Note that the input to simpleComposite is raw data.
var l8 = ee.ImageCollection('LANDSAT/LC08/C01/T1');
// The asFloat parameter gives floating-point TOA output instead of
// the UINT8 outputs of the default simpleComposite().
var composite = ee.Algorithms.Landsat.simpleComposite({
collection: l8.filterDate('2015-1-1', '2015-7-1'),
asFloat: true
});
// Pick a spot with lots of clouds.
Map.setCenter(-47.6735, -0.6344, 12);
// Display a composite with a band combination chosen from:
// https://landsat.usgs.gov/how-do-landsat-8-band-combinations-differ-landsat-7-or-landsat-5-satellite-data
Map.addLayer(composite, {bands: ['B6', 'B5', 'B4'], max: [0.3, 0.4, 0.3]});
步驟分析
- 創(chuàng)建數(shù)據(jù)集對象研铆,使用名稱來篩選數(shù)據(jù)
- 組合數(shù)據(jù)阱持,使用影像日期屬性來篩選數(shù)據(jù)集拴孤,作為輸入數(shù)據(jù)完成數(shù)據(jù)組合
- 設(shè)置地圖中心口糕,縮放等級
- 添加組合結(jié)果圖層譬胎,展示結(jié)果
主要方法
- ee.Algorithms.Landsat.simpleComposite()
Computes a Landsat TOA composite from a collection of raw Landsat scenes. It applies standard TOA calibration and then assigns a cloud score to each pixel using the SimpleLandsatCloudScore algorithm. It selects the lowest possible range of cloud scores at each point and then computes per-band percentile values from the accepted pixels. This algorithm also uses the LandsatPathRowLimit algorithm to select only the least-cloudy scenes in regions where more than maxDepth input scenes are available.
Arguments:
collection (ImageCollection):
The raw Landsat ImageCollection to composite.
percentile (Integer, default: 50):
The percentile value to use when compositing each band.
cloudScoreRange (Integer, default: 10):
The size of the range of cloud scores to accept per pixel.
maxDepth (Integer, default: 40):
An approximate limit on the maximum number of scenes used to compute each pixel.
asFloat (Boolean, default: false):
If true, output bands are in the same units as the Landsat.TOA algorithm; if false, TOA values are converted to uint8 by multiplying by 255 (reflective bands) or subtracting 100 (thermal bands) and rounding to the nearest integer.
Returns: Image
計算landsat的TOA組合結(jié)果炫七。對指定的landsat數(shù)據(jù)執(zhí)行標準TOA矯正爬立,然后為每一個像素計算一個云指數(shù)(cloud score),使用simpleLandsatCloudScore算法万哪。在每一個像素上懦尝,選擇計算出的最低值知纷,然后計算每一個波段上的百分比。該算法也使用LandsatPathRowLimit算法來選擇maxDepth參數(shù)控制的最大允許運算深度陵霉,即選擇cloudscore最少的前多少景影像琅轧。
輸入?yún)?shù):數(shù)據(jù)集(原始landsat數(shù)據(jù)集),precentile(百分比系數(shù)踊挠,組合不同波段時乍桂,使用的系數(shù),默認是50)效床,云量允許范圍(允許一個位置上cloudscore的范圍)睹酌,maxDepth(整數(shù),控制參與組合的影像數(shù)量)剩檀,asFloat(布爾值憋沿,控制返回結(jié)果是否為浮點型)