本次我们将分别使用两个流程完成对MODIS影像去除云,第一个就是先去云然后再合成,第二个方式是先合成后去云,我们通常情况下一般都是先去云再合成。

本文使用的数据:

MOD09A1产品来自于MODIS Terra星,数据为经过了大气校正(如气体,气溶胶和瑞利散射)的地表光谱反射率的估计值。数据包含7个反射率波段,及2个质量波段和4个观测波段,分辨率为500米。
依据云层和太阳天顶情况,从8天中选择一个最优值作为像素值。当存在多个最优值时,选取蓝波段(band 3)最小的像素值作为8天合成的值。

名称 单位 类型 分辨率(m) 波长(nm) 比例因子 值域范围 无效值 描述信息
sur_refl_b01 -- int16 500 620~670 0.0001 -100~16000 -28672 波段1的表面反射率
sur_refl_b02 -- int16 500 841~876 0.0001 -100~16000 -28672 波段2的表面反射率
sur_refl_b03 -- int16 500 459~479 0.0001 -100~16000 -28672 波段3的表面反射率
sur_refl_b04 -- int16 500 545~565 0.0001 -100~16000 -28672 波段4的表面反射率
sur_refl_b05 -- int16 500 1230~1250 0.0001 -100~16000 -28672 波段5的表面反射率
sur_refl_b06 -- int16 500 1628~1652 0.0001 -100~16000 -28672 波段6的表面反射率
sur_refl_b07 -- int16 500 2105~2155 0.0001 -100~16000 -28672 波段7的表面反射率
sur_refl_qc_500m -- int16 -- -- -- -- 表面反射率500m波段质量控制标志
sur_refl_szen Degrees int16 -- -- 0.01 0~18000 0 太阳天顶角
sur_refl_vzen Degrees int16 -- -- 0.01 0~18000 0 视角天顶角
sur_refl_raz Degrees int16 -- -- 0.01 -18000~18000 0 相对方位角
sur_refl_state_500m -- uint16 -- -- -- -- 65535 表面反射率500m状态标志
sur_refl_day_of_year -- uint16 -- -- -- 1~366 65535 儒略日(在儒略周期内以连续的日数计算时间的计时法)
Bitmask for sur_refl_qc_500m
  • Bits 0-1: MODLAND QA bits

    • 0: Corrected product produced at ideal quality - all bands
    • 1: Corrected product produced at less than ideal quality - some or all bands
    • 2: Corrected product not produced due to cloud effects - all bands
    • 3: Corrected product not produced for other reasons - some or all bands, may be fill value (11) [Note that a value of (11) overrides a value of (01)]
  • Bit 2-5: Band 1 data quality, four bit range
    • 0: Highest quality
    • 7: Noisy detector
    • 8: Dead detector, data interpolated in L1B
    • 9: Solar zenith ≥ 86 degrees
    • 10: Solar zenith ≥ 85 and < 86 degrees
    • 11: Missing input
    • 12: Internal constant used in place of climatological data for at least one atmospheric constant
    • 13: Correction out of bounds, pixel constrained to extreme allowable value
    • 14: L1B data faulty
    • 15: Not processed due to deep ocean or clouds
  • Bits 6-9: Band 2 data quality, four bit range
    • 0: Highest quality
    • 7: Noisy detector
    • 8: Dead detector, data interpolated in L1B
    • 9: Solar zenith ≥ 86 degrees
    • 10: Solar zenith ≥ 85 and < 86 degrees
    • 11: Missing input
    • 12: Internal constant used in place of climatological data for at least one atmospheric constant
    • 13: Correction out of bounds, pixel constrained to extreme allowable value
    • 14: L1B data faulty
    • 15: Not processed due to deep ocean or clouds
  • Bits 10-13: Band 3 data quality, four bit range
    • 0: Highest quality
    • 7: Noisy detector
    • 8: Dead detector, data interpolated in L1B
    • 9: Solar zenith ≥ 86 degrees
    • 10: Solar zenith ≥ 85 and < 86 degrees
    • 11: Missing input
    • 12: Internal constant used in place of climatological data for at least one atmospheric constant
    • 13: Correction out of bounds, pixel constrained to extreme allowable value
    • 14: L1B data faulty
    • 15: Not processed due to deep ocean or clouds
  • Bits 14-17: Band 4 data quality, four bit range
    • 0: Highest quality
    • 7: Noisy detector
    • 8: Dead detector, data interpolated in L1B
    • 9: Solar zenith ≥ 86 degrees
    • 10: Solar zenith ≥ 85 and < 86 degrees
    • 11: Missing input
    • 12: Internal constant used in place of climatological data for at least one atmospheric constant
    • 13: Correction out of bounds, pixel constrained to extreme allowable value
    • 14: L1B data faulty
    • 15: Not processed due to deep ocean or clouds
  • Bits 18-21: Band 5 data quality, four bit range
    • 0: Highest quality
    • 7: Noisy detector
    • 8: Dead detector, data interpolated in L1B
    • 9: Solar zenith ≥ 86 degrees
    • 10: Solar zenith ≥ 85 and < 86 degrees
    • 11: Missing input
    • 12: Internal constant used in place of climatological data for at least one atmospheric constant
    • 13: Correction out of bounds, pixel constrained to extreme allowable value
    • 14: L1B data faulty
    • 15: Not processed due to deep ocean or clouds
  • Bits 22-25: Band 6 data quality, four bit range
    • 0: Highest quality
    • 7: Noisy detector
    • 8: Dead detector, data interpolated in L1B
    • 9: Solar zenith ≥ 86 degrees
    • 10: Solar zenith ≥ 85 and < 86 degrees
    • 11: Missing input
    • 12: Internal constant used in place of climatological data for at least one atmospheric constant
    • 13: Correction out of bounds, pixel constrained to extreme allowable value
    • 14: L1B data faulty
    • 15: Not processed due to deep ocean or clouds
  • Bits 26-29: Band 7 data quality, four bit range
    • 0: Highest quality
    • 7: Noisy detector
    • 8: Dead detector, data interpolated in L1B
    • 9: Solar zenith ≥ 86 degrees
    • 10: Solar zenith ≥ 85 and < 86 degrees
    • 11: Missing input
    • 12: Internal constant used in place of climatological data for at least one atmospheric constant
    • 13: Correction out of bounds, pixel constrained to extreme allowable value
    • 14: L1B data faulty
    • 15: Not processed due to deep ocean or clouds
  • Bit 30: Atmospheric correction performed
    • 0: No
    • 1: Yes
  • Bit 31: Adjacency correction performed
    • 0: No
    • 1: Yes
Bitmask for sur_refl_state_500m
  • Bits 0-1: Cloud state

    • 0: Clear
    • 1: Cloudy
    • 2: Mixed
    • 3: Not set, assumed clear
  • Bit 2: Cloud shadow
    • 0: No
    • 1: Yes
  • Bits 3-5: Land/water flag
    • 0: Shallow ocean
    • 1: Land
    • 2: Ocean coastlines and lake shorelines
    • 3: Shallow inland water
    • 4: Ephemeral water
    • 5: Deep inland water
    • 6: Continental/moderate ocean
    • 7: Deep ocean
  • Bits 6-7: Aerosol quantity
    • 0: Climatology
    • 1: Low
    • 2: Average
    • 3: High
  • Bits 8-9: Cirrus detected
    • 0: None
    • 1: Small
    • 2: Average
    • 3: High
  • Bit 10: Internal cloud algorithm flag
    • 0: No cloud
    • 1: Cloud
  • Bit 11: Internal fire algorithm flag
    • 0: No fire
    • 1: Fire
  • Bit 12: MOD35 snow/ice flag
    • 0: No
    • 1: Yes
  • Bit 13: Pixel is adjacent to cloud
    • 0: No
    • 1: Yes
  • Bit 14: BRDF correction performed data
    • 0: No
    • 1: Yes
  • Bit 15: Internal snow mask
    • 0: No snow
    • 1: Snow

数据属性:

date

string

影像日期

这里再次提示大家,我们如果上传自己的featureCollection想要进行筛选和裁剪影像的时候我们需要完成对矢量集合的处理,.first().geometry()来完成准换。另外,这里我们镶嵌使用的函数:

mosaic()

将影像集合融合成为一张影像Image,融合规则保留是这个影像集合中最新的有效像素值。

方法参数:

- imageCollection(ImageCollection)

ImageCollection实例。

返回值:Image

代码:

var featureCollection0 = pie.FeatureCollection('user/xg346049806/shanxibianjie').first().geometry();//这个是和GEE不同的一点,就是需要先获取一个提取bit的函数
function bitwiseExtract(value, fromBit, toBit) {if (toBit === undefined) toBit = fromBit;var maskSize = 1 + toBit - fromBit; //位数var mask = pie.Number(1 << maskSize).subtract(1); //3=11,即挑选位return value.rightShift(fromBit).bitwiseAnd(mask);
}
//如果在GEE中就可以直接使用这个函数就可以了
function cloudfree_mod09a1(image) {//提取QA波段var qa = image.select("sur_refl_state_500m");//提取云比特位var cloudState = bitwiseExtract(qa, 0, 1);//提取云阴影比特位var cloudShadowState = bitwiseExtract(qa, 2, 2);//提取卷云比特位var cirrusState = bitwiseExtract(qa, 8, 9);//叠加得到无云、无云阴影且无卷云的区域var mask = cloudState.eq(0) // Clear.and(cloudShadowState.eq(0)) // No cloud shadow.and(cirrusState.eq(0)); // No cirrusreturn image.updateMask(mask);
}//筛选影像
var imgcol_m = pie.ImageCollection("USGS/MOD09A1/006").filterDate("2019-01-01", "2019-02-01").filterBounds(featureCollection0).select(["sur_refl_b01","sur_refl_b04","sur_refl_b03","sur_refl_state_500m",]);
print("imgcol_m", imgcol_m);//(1)对影像集合先合成后去云
var raw_img_m = imgcol_m.mosaic().clip(featureCollection0);
print("raw_img_m", raw_img_m);
Map.addLayer(raw_img_m,{min: 0,max: 3500,bands: ["sur_refl_b01", "sur_refl_b04", "sur_refl_b03"],},"raw_img_m"
);
Map.centerObject(geometry0, 6);
var result = cloudfree_mod09a1(raw_img_m);
Map.addLayer(result,{min: 0,max: 3500,bands: ["sur_refl_b01", "sur_refl_b04", "sur_refl_b03"],},"result"
);
//(2)对影像集合先去云后合成
var cf_img_m = imgcol_m.map(cloudfree_mod09a1).mosaic().clip(featureCollection0);
Map.addLayer(cf_img_m,{min: 0,max: 3500,bands: ["sur_refl_b01", "sur_refl_b04", "sur_refl_b03"],},"cf_img_m"
);

对影像集合先合成后去云

result

对影像集合先去云后合成

PIE-engine 教程 ——MODIS影像去云教程(山西省为例)相关推荐

  1. PIE Engine下载高分影像|以高分一号为例

    一.前言 因为前不久用到高分数据,所以来pie上鼓捣了下.体验感一般.下载了影像之后就没怎么用了.行政区矢量边界直接用了PIE的数据集,这个功能还行吧. 二.代码部分 使用了该数据集 fCol = p ...

  2. Google Earth Engine(GEE)——利用插值方法解决影像去云后的空缺/填充/弥补方法详细讲解(拉萨区域为例)

    本篇文章重点要解决的 问题就是,很多时候我们无论是在小区域内的单景影像或者是中大尺度的影像,更或是长时间序列的影像研究中,很多情况下我们会因为云量筛选等因素,或多或少的存在影像空白而缺少值,因此如何处 ...

  3. fmask云检测 matlab_基于BP神经网络的Landsat影像去云方法

    基于 BP 神经网络的 Landsat 影像去云方法 王睿 1 , 2 ,韦春桃 1 , 3 ,马云栋 1 ,胡涛 1 [摘 要] 摘要 : 利用最优化云变换 HOT 检测云区位置,再经过云区偏移和膨 ...

  4. Google Earth Engine 下载遥感影像——以Landsat 8数据为例

    目录 1.Google Earth Engine(GEE)简介 1.1 开发环境 1.2 说明书 2.GEE账号注册 3.GEE 查询库内卫星影像以及调用 3.1 数据集Datasets 3.2 加载 ...

  5. Google Earth Engine(GEE)——Landsat8 TOA 影像去云

    上一篇文章写了如何去除Landsat 8 SR数据,这一片主要是讲一下如何去除Landsat8 TOA 影像. 除云前影像: 除云后影像: 代码: // 建立函数还是选择BQA波段 var maskL ...

  6. Google Earth Engine(GEE)——Landsat SR影像去云函数

    函数: bitwiseAnd(image2) Calculates the bitwise AND of the input values for each matched pair of bands ...

  7. 【STM32移植机智云】超详细教程#2ESP8266移植机智云教程‘代码移植’

    1.引言 本人购买了一个ESP8266的WiFi模块,想做一个物联网控制小灯的demo. 本文记录了基于机智云平台,移植代码,实现物联网小灯详细操作步骤. 并不是移植步骤很麻烦, 只是文章真的写的极其 ...

  8. GEE(1):GEE 影像去云(Sentinel-2)

    Sentinel-2 function rmCloudByQA(image) {var qa = image.select('QA60');var cloudBitMask = 1 << ...

  9. GEE学习笔记 九十二:Sentinel-2 最新去云方法总结

    关于影像去云实际上是非常复杂的算法来实现的,但是我们不是专业研究如何识别云的,所以我们采用被人已经研究好的成果来实现我们的需求就可以.在GEE如何上实现Sentinel-2去云,之前也专门提到过,这篇 ...

最新文章

  1. oracle expdp 权限不足 1031,关于expdp,impdp操作需要的权限
  2. Android开源框架——图片加载与缓存库 Picasso
  3. 杂音 pop 音的解决方法
  4. mysql explain实践
  5. 大屏做成这样,领导不重用你都难
  6. XElement.Load 需要释放吗_因为信用卡逾期还不上坐牢了,刑满释放后,还需要继续还钱吗?...
  7. java动画api_使用MMAPI播放gif动画
  8. 2019-08-12 计划与安排
  9. JVM-class文件完全解析-字段表集合
  10. 小程序授权登录,后台发送链接,得到参数。
  11. [C# 网络编程系列]:TCP编程
  12. 家庭收支记账软件Java
  13. linux 安装mantis,在Ubuntu 18.04系统上安装Mantis Bug Tracker[MantisBT]
  14. 一款好用的bi报表软件,让你站在Excel的肩膀上
  15. Pr 入门教程如何创建动作序列?
  16. 微软跟投,估值31.5亿美元的光量子计算公司刚刚完成4.5亿美元融资
  17. 解决微信小程序内下载视频失败wx.saveVideoToPhotosAlbum :fail invalid video
  18. Excel通过单独选中每列可以实现每隔1列插入1列
  19. 计算机配置好坏怎么看,怎么看电脑配置,电脑配置好坏信息一目了然-腾讯电脑管家...
  20. 如何利用百度经验引流?百度经验精准引流的方法

热门文章

  1. Codeup 小白鼠排队
  2. 佟年计算机科学,亲爱的热爱的:吴白初见佟年眼神有深意,原来他们早就遇见过...
  3. web课程设计网页规划与设计 基于HTML+CSS美食网站设计与实现(6个页面)
  4. matlab中nabisect函数,数值分析在MATLAB中的实现(M函数文件)
  5. Unity3D UI多元素布局
  6. oracle--函数COALESCE
  7. 【史上最全App开发知识分享】如何从零开始成为app开发专家?
  8. docker images 保存导入导出、容器导入导出
  9. 史上最美女程序员:手写代码把人类送上月球
  10. mysql c dll_libmysql_c.dll,下载,简介,描述,修复,等相关问题一站搞定_DLL之家