Sentinel-2: Cloud Probability

COPERNICUS/S2_CLOUD_PROBABILITY
資料集可用性
2015-06-27T00:00:00Z–2025-06-18T05:46:39Z
資料集供應器
Earth Engine 程式碼片段
ee.ImageCollection("COPERNICUS/S2_CLOUD_PROBABILITY")
重訪間隔
5 天
標記
雲端 哥白尼克斯 esa eu msi radiance 衛星影像 Sentinel
sentinelhub

說明

使用 sentinel2-cloud-detector 程式庫 (使用 LightGBM) 建立 S2 雲層機率。在套用梯度提升基礎演算法之前,所有頻帶都會使用雙線性內插方式升採至 10 公尺解析度。產生的 0..1 浮點機率會縮放至 0..100,並儲存為 UINT8。缺少任何或所有頻帶的區域會遭到遮蔽。數值越高,越有可能是雲或高反光表面 (例如屋頂或雪地)。

Sentinel-2 是寬幅、高解析度、多光譜影像拍攝任務,可支援哥白尼土地監測研究,包括監測植被、土壤和水覆蓋率,以及內陸水道和沿海區域的觀測。

您可以在 COPERNICUS/S2_SR_HARMONIZED 集合中找到第 2 層資料。您可以在 COPERNICUS/S2_HARMONIZED 集合中找到第 1 級別資料。這些集合中的資產可提供其他中繼資料。

請參閱這份教學課程,瞭解如何套用雲端遮罩。

頻帶

頻帶

名稱 最小值 最大值 像素大小 說明
probability 0 100 10 公尺

像素有雲的機率。

使用條款

使用條款

使用 Sentinel 資料時,請遵守《哥白尼 Sentinel 資料條款及細則》。

使用 Earth Engine 探索

程式碼編輯器 (JavaScript)

var s2Sr = ee.ImageCollection('COPERNICUS/S2_SR_HARMONIZED');
var s2Clouds = ee.ImageCollection('COPERNICUS/S2_CLOUD_PROBABILITY');

var START_DATE = ee.Date('2019-01-01');
var END_DATE = ee.Date('2019-03-01');
var MAX_CLOUD_PROBABILITY = 65;
var region =
    ee.Geometry.Rectangle({coords: [-76.5, 2.0, -74, 4.0], geodesic: false});
Map.setCenter(-75, 3, 12);

function maskClouds(img) {
  var clouds = ee.Image(img.get('cloud_mask')).select('probability');
  var isNotCloud = clouds.lt(MAX_CLOUD_PROBABILITY);
  return img.updateMask(isNotCloud);
}

// The masks for the 10m bands sometimes do not exclude bad data at
// scene edges, so we apply masks from the 20m and 60m bands as well.
// Example asset that needs this operation:
// COPERNICUS/S2_CLOUD_PROBABILITY/20190301T000239_20190301T000238_T55GDP
function maskEdges(s2_img) {
  return s2_img.updateMask(
      s2_img.select('B8A').mask().updateMask(s2_img.select('B9').mask()));
}

// Filter input collections by desired data range and region.
var criteria = ee.Filter.and(
    ee.Filter.bounds(region), ee.Filter.date(START_DATE, END_DATE));
s2Sr = s2Sr.filter(criteria).map(maskEdges);
s2Clouds = s2Clouds.filter(criteria);

// Join S2 SR with cloud probability dataset to add cloud mask.
var s2SrWithCloudMask = ee.Join.saveFirst('cloud_mask').apply({
  primary: s2Sr,
  secondary: s2Clouds,
  condition:
      ee.Filter.equals({leftField: 'system:index', rightField: 'system:index'})
});

var s2CloudMasked =
    ee.ImageCollection(s2SrWithCloudMask).map(maskClouds).median();
var rgbVis = {min: 0, max: 3000, bands: ['B4', 'B3', 'B2']};

Map.addLayer(
    s2CloudMasked, rgbVis, 'S2 SR masked at ' + MAX_CLOUD_PROBABILITY + '%',
    true);
在程式碼編輯器中開啟