Sentinel-2: Cloud Probability

COPERNICUS/S2_CLOUD_PROBABILITY
資料集可用性
2015-06-27T00:00:00Z–2025-10-04T00:06:09Z
資料集供應來源
Earth Engine 程式碼片段
ee.ImageCollection("COPERNICUS/S2_CLOUD_PROBABILITY")
重新造訪間隔
5 天
標記
cloud copernicus esa eu msi radiance satellite-imagery sentinel
sentinelhub

說明

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

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

第 2 級資料位於 COPERNICUS/S2_SR_HARMONIZED 集合中。第 1B 級資料位於 COPERNICUS/S2_HARMONIZED 集合中。這些集合中的資產會提供額外中繼資料。

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

頻帶

頻帶

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

像素多雲的機率。

使用條款

使用條款

使用 Sentinel 資料時,須遵守《Copernicus Sentinel Data Terms and Conditions》。

使用 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);
在程式碼編輯器中開啟