Sentinel数据S2_SR_HARMONIZED连续云掩膜+中位数合成

在GEE中实现时,发现简单的QA60是无法去云的,最近S2地表反射率数据集又进行了更新,原有的属性集也进行了变化,现在的SR数据集名称是"S2_SR_HARMONIZED"。那么:

要想得到研究区无云的图像,可以参考执行以下几个步骤,

  1. 遥感图像中筛选云占比不超过10%的图像

    // 加载Sentinel-2 L2A图像

    var s2 = ee.ImageCollection('COPERNICUS/S2_SR_HARMONIZED')

    .filterDate('2021-09-01', '2021-10-31')

    .filter(ee.Filter.lt('CLOUDY_PIXEL_PERCENTAGE',10))

    .filterBounds(basin_shp);

  2. QA60云掩膜

    // 第一次云掩膜:使用QA60

    function maskS2clouds(image) {

    var qa = image.select('QA60');

    var cloudBitMask = 1 << 10;

    var cirrusBitMask = 1 << 11;

    var mask = qa.bitwiseAnd(cloudBitMask).eq(0)

    .and(qa.bitwiseAnd(cirrusBitMask).eq(0));

    return image.updateMask(mask);

    }

    var s2_masked = s2.map(maskS2clouds);

  3. SCL在最新的S2_SR_HARMONIZED产品中是存在的,判断云和云阴影

    //SCL Cloud mask

    function maskS2cloudsSCL(image) {

    var scl = image.select('SCL');

    // 去除云(8)和云阴影(9)

    var mask = scl.neq(8).and(scl.neq(9));

    return image.updateMask(mask);

    }

    var s2_masked = s2_masked.map(maskS2cloudsSCL);

  4. 继续用像元云概率进行判断,要求每个像元是云的概率小于10%

    // MSK_CLDPRB Mask(Sen2Cor 云概率),可直接用阈值掩膜,云概率低于 10% 保留:

    function maskCloudProb(image) {

    var prob = image.select('MSK_CLDPRB');

    return image.updateMask(prob.lt(10)); // 云概率低于 20% 保留

    }

    var s2_masked = s2_masked.map(maskCloudProb);

    最后中位数合成,避免反射率高值影响图像像元整体性。

    var s2_max = s2_masked.median();

相关推荐
南屿欣风1 天前
Sentinel 资源异常处理优先级笔记
spring boot·笔记·sentinel
lllsure4 天前
Alibaba Sentinel
微服务·sentinel
梵得儿SHI5 天前
SpringCloud 核心组件精讲:Sentinel 熔断限流全攻略-流量控制、熔断降级、热点参数限流(含 Dashboard 部署 + 项目集成实操)
java·spring cloud·sentinel·熔断降级·热点参数限流·微服务流量控制
oMcLin5 天前
如何在 RHEL 8 服务器上配置并调优 Redis Sentinel 高可用集群,确保数据一致性
服务器·redis·sentinel
机灵猫9 天前
守卫系统的最后一道防线:深入 Sentinel 限流降级与熔断机制(对比 Hystrix)
java·hystrix·sentinel
weixin_439706259 天前
spring boot+nacos+gateway+sentinel的简单例子
spring boot·gateway·sentinel
墨白曦煜11 天前
微服务容错设计:Sentinel 全局异常处理与 Feign 降级策略的边界权衡
微服务·架构·sentinel
没有bug.的程序员11 天前
Spring Cloud Gateway 架构与执行流程:从原理到性能优化的深度探索
微服务·云原生·eureka·性能优化·架构·sentinel·服务发现
杜子不疼.11 天前
Spring Cloud 微服务实战:Nacos+Sentinel+Gateway 核心组件详解
spring cloud·微服务·sentinel
enjoy编程13 天前
Spring Boot 4 如何使用Sentinel进行限流-II【基于Sentinel Spring MVC Adapter实现】
spring boot·spring·sentinel·服务限流·webmvc·servlet 6.x