אלגוריתמים של Landsat

מבנה הקולקציה של Landsat

ה-USGS יוצר נתונים ב-3 רמות (קטגוריות) לכל לוויין:

  • רמה 1 (T1) – נתונים שעומדים בדרישות האיכות הגיאומטרית והרדיומטרית
  • רמה 2 (T2) – נתונים שלא עומדים בדרישות של רמה 1
  • זמן אמת (RT) – נתונים שעדיין לא הוערכו (התהליך עשוי להימשך עד חודש).

מידע נוסף זמין ב מסמכי התיעוד של USGS לגבי רמות האיסוף מסוג 2.

כדי לאפשר גישה גם לנתוני T1 המאושרים וגם לנתונים העדכניים ביותר בזמן אמת, קיבצנו את התמונות לקולקציות לפי רמה וסוג לוויין. דוגמאות ל-Landsat 8:

מזהה תיאור
LANDSAT/LC08/C02/T1_RT Landsat 8, ‏ Collection 2, ‏ Tier 1 + Real Time
LANDSAT/LC08/C02/T1 Landsat 8, ‏ Collection 2, ‏ Tier 1 בלבד
LANDSAT/LC08/C02/T2 Landsat 8, ‏ Collection 2, ‏ Tier 2 בלבד

תמונות חדשות שצולמו מתווספות לקולקציה T1_RT מדי יום. אחרי שסצנה מסוג RT תעובד מחדש ותסווג כ-T1 או כ-T2, היא תוסר מהאוסף T1_RT והגרסה החדשה תתווסף לאוספים המתאימים. אם העבודה שלכם רגישת להסרות או לסצנות שעשויות להיות רשומות בטעות, מומלץ להשתמש באוסף T1. באופן כללי, נדיר מאוד ששגיאת רישום תהיה גדולה מספיק כדי להבחין בה בסצנות חדשות.

כל אחד מהאוספים הקודמים מכיל את הנתונים הגולמיים (כלומר, קרינה בקנה מידה, במדד חיישן). בנוסף, לכל אוסף שמכיל תמונות T1 או T2 מוצעים מוצרים של TOA (רפלקטיביות בחלק העליון של האטמוספרה), SR (רפלקטיביות פני השטח) ו-LST (טמפרטורת פני השטח). בטבלה הבאה מתוארים מזהי הקולקציות של TOA ו-SR/LST באמצעות נתוני Landsat 8 לדוגמה.

מזהה תיאור
LANDSAT/LC08/C02/T1_RT_TOA Landsat 8, ‏ Collection 2, ‏ Tier 1 + Real Time, ‏ TOA
LANDSAT/LC08/C02/T1_TOA Landsat 8, ‏ Collection 2, ‏ Tier 1 בלבד, ‏ TOA
LANDSAT/LC08/C02/T1_L2 Landsat 8, ‏ Collection 2, ‏ Tier 1 בלבד, ‏ SR ו-LST
LANDSAT/LC08/C02/T2_TOA Landsat 8, ‏ Collection 2, ‏ Tier 2 בלבד, ‏ TOA

הנתונים האלה קיימים עבור לווייני Landsat 4,‏ 5,‏ 7,‏ 8 ו-9. כדי לאחזר קולקציות של לוויינים שונים, מחליפים את 'LC08' בהגדרות הקודמות של הקולקציות במזהים מהטבלה הבאה.

מזהה תיאור
LT04 Landsat 4, ‏ Thematic Mapper‏ (TM)
LT05 Landsat 5, ‏ Thematic Mapper‏ (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 והם יוסרו מ-Data Catalog בשנת 2024.

אוסף 1: ה-USGS לא מייצר או מפיץ אותו יותר, אין לו תמיכה ב-Earth Engine והוא יוסר מ-Data Catalog בשנת 2024. כדי למנוע בקשות שנכשלו, כדאי להשתמש במדריך ההעברה כדי לעדכן את הסקריפטים, המודולים והאפליקציות של Earth Engine לאוסף 2 עד 1 ביולי 2024.

אוסף 2: האוסף הנוכחי שמיוצר על ידי USGS. זמינות מלאה ב-Earth Engine Data Catalog.

שיטות עיבוד של Landsat

ב-Earth Engine יש מגוון שיטות עיבוד ספציפיות ל-Landsat. באופן ספציפי, יש שיטות לחישוב של קרינה במדד (radiance) במדד חיישן, של השתקפות בחלק העליון של האטמוספירה (TOA), של השתקפות פני השטח (SR), של דירוג עננים ושל קומפוזיטים ללא עננים.

קרינה בחיישן והחזרה (reflectance) ב-TOA

הסצנות 'הגולמיות' ב-Earth Engine מכילות תמונות עם מספרים דיגיטליים (DNs) שמייצגים קרינה מותאמת. ההמרה של ערכי DN לקרינה במדד חיישן היא טרנספורמציה לינארית באמצעות גורמים שמאוחסנים במטא-נתונים של הסצנה (Chander et al. 2009). השיטה ee.Algorithms.Landsat.calibratedRadiance() מבצעת את ההמרה הזו. ההמרה לרפלקטיביות של TOA (או במדד) היא טרנספורמציה לינארית שמביאה בחשבון את הגובה של השמש ואת המרחק המשתנה בין כדור הארץ לשמש בהתאם לעונה. השיטה ee.Algorithms.Landsat.TOA() היא זו שמטפלת בהמרה מסוג TOA. שיטת TOA ממירה פסות תרמיות לטמפרטורת בהירות. למידע נוסף על חישוב ההחזרה ב-TOA או על טמפרטורת הבהירות, אפשר לעיין במאמר Chander et al. (2009) (או באתר הזה של USGS לגבי Landsat 8). בדוגמה הבאה מוצגת המרה מנתונים גולמיים לקרינה ולחזרה (reflectance) ב-TOA בתמונה של Landsat 8:

Code Editor‏ (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

רפלקטיביות של משטח

נתוני ההחזרה של פני השטח (SR) של Landsat זמינים ב-Earth Engine כעותק של הארכיון של USGS, אוסף 2, רמה 2. חשוב לזכור שנתוני SR של Landsat 4,‏ 5 ו-7 נוצרים באמצעות האלגוריתם LEDAPS, ואילו נתוני SR של Landsat 8 ו-9 נוצרים באמצעות האלגוריתם LaSRC. מידע על האלגוריתמים האלה ועל ההבדלים ביניהם לבין USGS

אפשר לגשת לתמונה של Landsat 8 ברמה 2 מ-USGS Collection 2 באופן הבא:

Code Editor‏ (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 הם:

Code Editor‏ (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')

ציון פשוט ב-Cloud

כדי לתת ציונים לפי הצפיפות היחסית של עננים בפיקסלים של Landsat, ‏Earth Engine מספק אלגוריתם בסיסי למתן ציונים לעננים בשיטה ee.Algorithms.Landsat.simpleCloudScore(). (פרטים על ההטמעה זמינים בסקריפט לדוגמה הזה של עורך הקוד). בדוגמה הבאה נעשה שימוש באלגוריתם למתן ציונים לעננים כדי להסתיר עננים בתמונה של Landsat 8:

Code Editor‏ (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 כדי להשוות בין התמונות עם המסכה לבין התמונות ללא המסכה. (הוראות לביצוע הפעולה הזו מפורטות בקטע Layer Manager במסמכי התיעוד של Code Editor). שימו לב שהקלט של simpleCloudScore() הוא סצנה אחת של Landsat TOA. שימו לב גם ש-simpleCloudScore() מוסיף פס שנקרא 'cloud' לתמונה הקלט. רצועת העננים מכילה את ציון העננים, בין 0 (לא מעונן) ל-100 (מעונן ביותר). בדוגמה הקודמת נעשה שימוש בסף שרירותי (20) של ציון הענן כדי להסתיר פיקסלים מעוננים. כדי להחיל את האלגוריתם הזה על פסיפס של סצנות Landsat ב-Earth Engine, מגדירים את המאפיין SENSOR_ID:

Code Editor‏ (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) הם 'TM',‏ 'ETM' ו-'OLI_TIRS', בהתאמה.

מורכב פשוט

כדי ליצור קומפוזיציות פשוטות ללא עננים של Landsat, ב-Earth Engine יש את השיטה ee.Algorithms.Landsat.simpleComposite(). בשיטה הזו בוחרים קבוצת משנה של סצנות בכל מיקום, ממירים את הנתונים לחזרה (TOA), מחילים את הדירוג הפשוט של עננים ומחשבים את החציון של הפיקסלים עם הכי פחות עננים. בדוגמה הזו נוצר מדד מורכב פשוט באמצעות פרמטרים שמוגדרים כברירת מחדל, ומשווים אותו למדד מורכב עם פרמטרים מותאמים אישית לסף של ציון הענן ולפרמטר האחוזון:

Code Editor‏ (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 כדי לקבל פלט של מספרים בוליאנים ללא שינוי קנה מידה וללא הזזה.