2020-02-10

Sentinel-2 image 武漢火神山醫院 GEE sample code

/**
 * Function to mask clouds using the Sentinel-2 QA band
 * @param {ee.Image} image Sentinel-2 image
 * @return {ee.Image} cloud masked Sentinel-2 image
 */
function maskS2clouds(image) {
  var qa = image.select('QA60');

  // Bits 10 and 11 are clouds and cirrus, respectively.
  var cloudBitMask = 1 << 10;
  var cirrusBitMask = 1 << 11;

  // Both flags should be set to zero, indicating clear conditions.
  var mask = qa.bitwiseAnd(cloudBitMask).eq(0)
      .and(qa.bitwiseAnd(cirrusBitMask).eq(0));

  return image.updateMask(mask).divide(10000);
}

// Map the function over one year of data and take the median.
// Load Sentinel-2 TOA reflectance data.
var dataset = ee.ImageCollection('COPERNICUS/S2')
                  .filterDate('2020-02-04', '2020-02-05')
                  // Pre-filter to get less cloudy granules.
                  .filter(ee.Filter.lt('CLOUDY_PIXEL_PERCENTAGE', 40))
                  .map(maskS2clouds);

var rgbVis = {
  min: 0.0,
  max: 0.3,
  bands: ['B4', 'B3', 'B2'],
};

Map.setCenter(114.084915,30.5275156, 16);
Map.addLayer(dataset.median(), rgbVis, 'RGB');

Q80 和 Q90

  "Q80" 和 "Q90" 是與水位(水流量)相關的術語,通常用於水文學和水資源管理領域。這些術語涉及在不同的情境下對水位和水流量進行推估和應用。 1. Q80 和 Q90 定義:    - Q80:在某段特定的時間內,80% 的時間水...