Landsat 演算法

Landsat 集合結構

USGS 會為每顆衛星產生 3 個層級 (類別) 的資料:

  • 第 1 級 (T1):符合幾何和輻射度品質規定的資料
  • 第 2 層 (T2):不符合第 1 層規定的資料
  • 即時 (RT):尚未評估的資料 (評估作業最多需要一個月)。

如需更多資訊,請參閱 USGS 說明文件,瞭解收集 2 層級。

為了讓您同時存取經過驗證的 T1 資料和最新的即時資料,我們已依層級和衛星將場景分組為集合。Landsat 8 的範例如下:

ID 說明
LANDSAT/LC08/C02/T1_RT Landsat 8、Collection 2、Tier 1 + 即時
LANDSAT/LC08/C02/T1 Landsat 8、Collection 2,僅限第 1 級
LANDSAT/LC08/C02/T2 Landsat 8、Collection 2,僅限第 2 級

系統每天都會將新取得的影像加入 T1_RT 集合。一旦 RT 場景經過重新處理,並且歸類為 T1 或 T2,就會從 T1_RT 集合中移除,而新版本會新增至適當的集合。如果您的作品很容易遭到移除,或可能出現登錄錯誤的場景,建議您採用 T1 集合,但一般來說,新取得的場景很少會出現登錄錯誤。

上述每個集合都包含原始資料 (即經過縮放的傳感器輻度)。此外,對於每個包含 T1 或 T2 圖像的集合,系統會提供 TOA (大氣頂部反射率)、SR (地表反射率) 和 LST (地表溫度) 產品。下表以 Landsat 8 資料為例,說明 TOA 和 SR/LST 集合中的集合 ID。

ID 說明
LANDSAT/LC08/C02/T1_RT_TOA Landsat 8、Collection 2、Tier 1 + 即時、TOA
LANDSAT/LC08/C02/T1_TOA Landsat 8、Collection 2、僅限第 1 層、TOA
LANDSAT/LC08/C02/T1_L2 Landsat 8、Collection 2、僅限第 1 級、SR 和 LST
LANDSAT/LC08/C02/T2_TOA Landsat 8、Collection 2、僅限第 2 級、TOA

這些資料適用於 Landsat 4、5、7、8 和 9。將上述集合定義中的「LC08」替換為下表中的 ID,即可擷取各種衛星的集合。

ID 說明
LT04 Landsat 4、主題地圖 (TM)
LT05 Landsat 5、主題地圖 (TM)
LE07 Landsat 7、Enhanced Thematic Mapper Plus (ETM+)
LC08 Landsat 8,Operational Land Imager (OLI)
LC09 Landsat 9、Operational Land Imager 2 (OLI-2)

Landsat 產品素材資源集合狀態

Collection 1 之前:USGS 已停止製作或發布這類資料,Earth Engine 也不支援這類資料,因此會在 2024 年從 Data Catalog 中移除。

Collection 1:USGS 已停止製作或發布,且不受 Earth Engine 支援,因此將於 2024 年從資料目錄中移除。請在 2024 年 7 月 1 日前,按照遷移指南更新 Earth Engine 指令碼、模組和應用程式至收集 2,以免要求失敗。

Collection 2:美國地質調查局目前的資料集。在 Earth Engine 資料目錄中提供完整資訊。

Landsat 處理方法

Earth Engine 包含多種 Landsat 專屬處理方法。具體來說,有幾種方法可用於計算感測器輻照度、大氣頂層 (TOA) 反射率、地表反射率 (SR)、雲量分數和無雲合成影像。

感應器上的輻照度和 TOA 反射率

Earth Engine 中的「原始」場景包含數位數字 (DN) 影像,代表經過縮放的輻射度。將數碼正形轉換為感測器輻照度,是一種線性轉換,會使用儲存在場景中繼資料中的係數 (Chander et al. 2009)。ee.Algorithms.Landsat.calibratedRadiance() 方法會執行這項轉換作業。轉換為 TOA (或感測器) 反射率是一種線性轉換,可考量太陽高度和季節性變化的地球-太陽距離。ee.Algorithms.Landsat.TOA() 方法會處理 TOA 轉換。TOA 方法會將熱像波段轉換為亮度溫度。如要進一步瞭解如何計算 TOA 反射率或亮度溫度,請參閱 Chander 等人 (2009) (或 這個 USGS 網站的 Landsat 8 相關資訊)。以下範例說明如何將 Landsat 8 影像的原始資料轉換為輻照度和 TOA 反射率:

程式碼編輯器 (JavaScript)

// Load a raw Landsat scene and display it.
var raw = ee.Image('LANDSAT/LC08/C02/T1/LC08_044034_20140318');
Map.centerObject(raw, 10);
Map.addLayer(raw, {bands: ['B4', 'B3', 'B2'], min: 6000, max: 12000}, 'raw');

// Convert the raw data to radiance.
var radiance = ee.Algorithms.Landsat.calibratedRadiance(raw);
Map.addLayer(radiance, {bands: ['B4', 'B3', 'B2'], max: 90}, 'radiance');

// Convert the raw data to top-of-atmosphere reflectance.
var toa = ee.Algorithms.Landsat.TOA(raw);

Map.addLayer(toa, {bands: ['B4', 'B3', 'B2'], max: 0.2}, 'toa reflectance');

Python 設定

請參閱「 Python 環境」頁面,瞭解 Python API 和如何使用 geemap 進行互動式開發。

import ee
import geemap.core as geemap

Colab (Python)

# Load a raw Landsat scene and display it.
raw = ee.Image('LANDSAT/LC08/C02/T1/LC08_044034_20140318')
m = geemap.Map()
m.center_object(raw, 10)
m.add_layer(
    raw, {'bands': ['B4', 'B3', 'B2'], 'min': 6000, 'max': 12000}, 'raw'
)

# Convert the raw data to radiance.
radiance = ee.Algorithms.Landsat.calibratedRadiance(raw)
m.add_layer(radiance, {'bands': ['B4', 'B3', 'B2'], 'max': 90}, 'radiance')

# Convert the raw data to top-of-atmosphere reflectance.
toa = ee.Algorithms.Landsat.TOA(raw)

m.add_layer(toa, {'bands': ['B4', 'B3', 'B2'], 'max': 0.2}, 'toa reflectance')
m

表面反射

Landsat 地表反射率 (SR) 資料可在 Earth Engine 中取得,為 USGS 集合 2 級別 2 的檔案副本。請注意,Landsat 4、5 和 7 SR 資料是使用 LEDAPS 演算法產生,而 Landsat 8 和 9 SR 資料則是使用 LaSRC 演算法產生。 瞭解這些演算法,以及與美國地質調查局 (USGS) 的差異

您可以存取 USGS 集合 2 的 Landsat 8 等級 2 圖像,如下所示:

程式碼編輯器 (JavaScript)

var srImage = ee.Image('LANDSAT/LC08/C02/T1_L2/LC08_044034_20201028');

Python 設定

請參閱「 Python 環境」頁面,瞭解 Python API 和如何使用 geemap 進行互動式開發。

import ee
import geemap.core as geemap

Colab (Python)

sr_image = ee.Image('LANDSAT/LC08/C02/T1_L2/LC08_044034_20201028')

Collection 2 Landsat 4 到 9 的表面反射率資料集如下:

程式碼編輯器 (JavaScript)

var surfaceReflectanceL4 = ee.ImageCollection('LANDSAT/LT04/C02/T1_L2');
var surfaceReflectanceL5 = ee.ImageCollection('LANDSAT/LT05/C02/T1_L2');
var surfaceReflectanceL7 = ee.ImageCollection('LANDSAT/LE07/C02/T1_L2');
var surfaceReflectanceL8 = ee.ImageCollection('LANDSAT/LC08/C02/T1_L2');
var surfaceReflectanceL9 = ee.ImageCollection('LANDSAT/LC09/C02/T1_L2');

Python 設定

請參閱「 Python 環境」頁面,瞭解 Python API 和如何使用 geemap 進行互動式開發。

import ee
import geemap.core as geemap

Colab (Python)

surface_reflectance_l4 = ee.ImageCollection('LANDSAT/LT04/C02/T1_L2')
surface_reflectance_l5 = ee.ImageCollection('LANDSAT/LT05/C02/T1_L2')
surface_reflectance_l7 = ee.ImageCollection('LANDSAT/LE07/C02/T1_L2')
surface_reflectance_l8 = ee.ImageCollection('LANDSAT/LC08/C02/T1_L2')
surface_reflectance_l9 = ee.ImageCollection('LANDSAT/LC09/C02/T1_L2')

簡易雲端評分

如要根據 Landsat 像素的相對雲量來評分,Earth Engine 會在 ee.Algorithms.Landsat.simpleCloudScore() 方法中提供基本的雲量評分演算法。(如需實作詳細資訊,請參閱這個 Code 編輯器範例指令碼)。以下範例使用雲層評分演算法,遮蓋 Landsat 8 影像中的雲:

程式碼編輯器 (JavaScript)

// Load a cloudy Landsat scene and display it.
var cloudy_scene = ee.Image('LANDSAT/LC08/C02/T1_TOA/LC08_044034_20140926');
Map.centerObject(cloudy_scene);
Map.addLayer(cloudy_scene, {bands: ['B4', 'B3', 'B2'], max: 0.4}, 'TOA', false);

// Add a cloud score band.  It is automatically called 'cloud'.
var scored = ee.Algorithms.Landsat.simpleCloudScore(cloudy_scene);

// Create a mask from the cloud score and combine it with the image mask.
var mask = scored.select(['cloud']).lte(20);

// Apply the mask to the image and display the result.
var masked = cloudy_scene.updateMask(mask);
Map.addLayer(masked, {bands: ['B4', 'B3', 'B2'], max: 0.4}, 'masked');

Python 設定

請參閱「 Python 環境」頁面,瞭解 Python API 和如何使用 geemap 進行互動式開發。

import ee
import geemap.core as geemap

Colab (Python)

# Load a cloudy Landsat scene and display it.
cloudy_scene = ee.Image('LANDSAT/LC08/C02/T1_TOA/LC08_044034_20140926')
m = geemap.Map()
m.center_object(cloudy_scene)
m.add_layer(
    cloudy_scene, {'bands': ['B4', 'B3', 'B2'], 'max': 0.4}, 'TOA', False
)

# Add a cloud score band.  It is automatically called 'cloud'.
scored = ee.Algorithms.Landsat.simpleCloudScore(cloudy_scene)

# Create a mask from the cloud score and combine it with the image mask.
mask = scored.select(['cloud']).lte(20)

# Apply the mask to the image and display the result.
masked = cloudy_scene.updateMask(mask)
m.add_layer(masked, {'bands': ['B4', 'B3', 'B2'], 'max': 0.4}, 'masked')
m

如果您在程式碼編輯器中執行這個範例,請嘗試切換 TOA 圖層的顯示設定,比較有遮罩和未遮罩圖像的差異。(如需操作說明,請參閱程式碼編輯器文件的「圖層管理工具」一節)。請注意,simpleCloudScore() 的輸入內容是單一 Landsat 到達觀景畫面。請注意,simpleCloudScore() 會將名為 'cloud' 的頻帶新增至輸入圖片。雲層帶包含雲量分數,範圍從 0 (無雲) 到 100 (最為多雲)。先前的範例使用雲朵分數的任意門檻 (20) 來遮蔽雲霧狀像素。如要將此演算法套用至 Landsat 影像的 Earth Engine 馬賽克,請設定 SENSOR_ID 屬性:

程式碼編輯器 (JavaScript)

// Load a Landsat 8 TOA collection, make 15-day mosaic, set SENSOR_ID property.
var mosaic = ee.ImageCollection('LANDSAT/LC08/C02/T1_TOA')
  .filterDate('2019-06-01', '2019-06-16').mosaic()
  .set('SENSOR_ID', 'OLI_TIRS');

// Cloud score the mosaic and display the result.
var scored_mosaic = ee.Algorithms.Landsat.simpleCloudScore(mosaic);
Map.addLayer(scored_mosaic, {bands: ['B4', 'B3', 'B2'], max: 0.4},
    'TOA mosaic');

Python 設定

請參閱「 Python 環境」頁面,瞭解 Python API 和如何使用 geemap 進行互動式開發。

import ee
import geemap.core as geemap

Colab (Python)

# Load a Landsat 8 TOA collection, make 15-day mosaic, set SENSOR_ID property.
mosaic = (
    ee.ImageCollection('LANDSAT/LC08/C02/T1_TOA')
    .filterDate('2019-06-01', '2019-06-16')
    .mosaic()
    .set('SENSOR_ID', 'OLI_TIRS')
)

# Cloud score the mosaic and display the result.
scored_mosaic = ee.Algorithms.Landsat.simpleCloudScore(mosaic)
m = geemap.Map()
m.add_layer(
    scored_mosaic,
    {'bands': ['B4', 'B3', 'B2'], 'max': 0.4},
    'TOA mosaic',
)
m

SENSOR_ID 是個別圖片的屬性。當 Earth Engine 製作多張圖片的馬賽克時,必須捨棄個別圖片的中繼資料,包括 SENSOR_ID 屬性。為了為馬賽克圖片評分,Earth Engine 會尋找該屬性,但找不到,因此會發生錯誤。請手動設定這項屬性,避免發生這種情況。Landsat 5、7 和 8(9) 的感應器 ID 分別為「TM」、「ETM」和「OLI_TIRS」。

簡單的複合

如要建立簡單的無雲 Landsat 合成影像,Earth Engine 提供 ee.Algorithms.Landsat.simpleComposite() 方法。這個方法會選取各個位置的場景子集,將其轉換為 TOA 反射率,套用簡單的雲層分數,並取得雲量最少的像素中位數。這個範例會使用預設參數建立簡單的複合圖,並將其與使用自訂參數的複合圖進行比較,以便比較雲端分數門檻和百分比:

程式碼編輯器 (JavaScript)

// Load a raw Landsat 5 ImageCollection for a single year.
var collection = ee.ImageCollection('LANDSAT/LT05/C02/T1')
    .filterDate('2010-01-01', '2010-12-31');

// Create a cloud-free composite with default parameters.
var composite = ee.Algorithms.Landsat.simpleComposite(collection);

// Create a cloud-free composite with custom parameters for
// cloud score threshold and percentile.
var customComposite = ee.Algorithms.Landsat.simpleComposite({
  collection: collection,
  percentile: 75,
  cloudScoreRange: 5
});

// Display the composites.
Map.setCenter(-122.3578, 37.7726, 10);
Map.addLayer(composite, {bands: ['B4', 'B3', 'B2'], max: 128}, 'TOA composite');
Map.addLayer(customComposite, {bands: ['B4', 'B3', 'B2'], max: 128},
    'Custom TOA composite');

Python 設定

請參閱「 Python 環境」頁面,瞭解 Python API 和如何使用 geemap 進行互動式開發。

import ee
import geemap.core as geemap

Colab (Python)

# Load a raw Landsat 5 ImageCollection for a single year.
collection = ee.ImageCollection('LANDSAT/LT05/C02/T1').filterDate(
    '2010-01-01', '2010-12-31'
)

# Create a cloud-free composite with default parameters.
composite = ee.Algorithms.Landsat.simpleComposite(collection)

# Create a cloud-free composite with custom parameters for
# cloud score threshold and percentile.
custom_composite = ee.Algorithms.Landsat.simpleComposite(
    collection=collection, percentile=75, cloudScoreRange=5
)

# Display the composites.
m = geemap.Map()
m.set_center(-122.3578, 37.7726, 10)
m.add_layer(
    composite, {'bands': ['B4', 'B3', 'B2'], 'max': 128}, 'TOA composite'
)
m.add_layer(
    custom_composite,
    {'bands': ['B4', 'B3', 'B2'], 'max': 128},
    'Custom TOA composite',
)
m

請注意,簡易合成的輸入內容是原始圖像集合。另請注意,根據預設,反射帶輸出值的反射率會縮放至 8 位元,而熱帶輸出值則會將絕對溫度減去 100,以便符合 8 位元範圍。您可以將 asFloat 參數設為 true 來變更這項行為,以便取得未經縮放、未經偏移的浮點輸出值。