美文网首页遥感
GEEMODIS数据质量波段应用

GEEMODIS数据质量波段应用

作者: 赤豆冰棍 | 来源:发表于2019-01-05 02:46 被阅读0次

MODIS质量控制数据应用

主要功能

使用MODIS的QA波段来进行云区掩膜,深海区域掩膜

代码

// Extract MODIS QA information from the "state_1km" QA band
// and use it to mask out cloudy and deep ocean areas.
//
// QA Band information is available at:
// https://lpdaac.usgs.gov/products/modis_products_table/mod09ga
// Table 1: 1-kilometer State QA Descriptions (16-bit)


/**
 * Returns an image containing just the specified QA bits.
 *
 * Args:
 *   image - The QA Image to get bits from.
 *   start - The first bit position, 0-based.
 *   end   - The last bit position, inclusive.
 *   name  - A name for the output image.
 */
var getQABits = function(image, start, end, newName) {
    // Compute the bits we need to extract.
    var pattern = 0;
    for (var i = start; i <= end; i++) {
       pattern += Math.pow(2, i);
    }
    return image.select([0], [newName])
                  .bitwiseAnd(pattern)
                  .rightShift(start);
};

// Reference a single MODIS MOD09GA image.
var image = ee.Image('MODIS/006/MOD09GA/2012_10_11');

// Select the QA band
var QA = image.select('state_1km');

// Get the cloud_state bits and find cloudy areas.
var cloud = getQABits(QA, 0, 1, 'cloud_state')
                    .expression("b(0) == 1 || b(0) == 2");

// Get the land_water_flag bits.
var landWaterFlag = getQABits(QA, 3, 5, 'land_water_flag');

// Create a mask that filters out deep ocean and cloudy areas.
var mask = landWaterFlag.neq(7).and(cloud.not());

// Add a map layer with the deep ocean and clouds areas masked out.
Map.addLayer(image.updateMask(mask),
  {
    bands: ['sur_refl_b01', 'sur_refl_b04', 'sur_refl_b03'],
    min: -100,
    max: 2000
  }, 'MOD09GA 143'
);

// Add a semi-transparent map layer that displays the clouds.
Map.addLayer(
    cloud.updateMask(cloud),
    {palette: 'FFFFFF', opacity: 0.8},
    'clouds'
);

步骤分析

  1. 定义函数getQABits
  2. 创建ee对象,获取MODIS数据
  3. 选择QA波段
  4. 获取云区
  5. 获取陆地水域区域
  6. 合并云区和水域区域
  7. 添加原始数据图层
  8. 添加一个显示云区域的图层

主要方法

定义了一个函数getQABits(image, start, end, newName),以下两个方法是在函数中使用的:

  1. ee.Image.bitwiseAnd()
    Calculates the bitwise AND of the input values for each matched pair of bands in image1 and image2. If either image1 or image2 has only 1 band, then it is used against all the bands in the other image. If the images have the same number of bands, but not the same names, they're used pairwise in the natural order. The output bands are named for the longer of the two inputs, or if they're equal in length, in image1's order. The type of the output pixels is the union of the input types.
    Arguments:
    this:image1 (Image):
    The image from which the left operand bands are taken.
    image2 (Image):
    The image from which the right operand bands are taken.
    Returns: Image

计算输入影像的位"与"操作。
输入参数:
输入影像对象1,输入影像对象2

  1. ee.Image.rightShift()
    Calculates the signed right shift of v1 by v2 bits for each matched pair of bands in image1 and image2. If either image1 or image2 has only 1 band, then it is used against all the bands in the other image. If the images have the same number of bands, but not the same names, they're used pairwise in the natural order. The output bands are named for the longer of the two inputs, or if they're equal in length, in image1's order. The type of the output pixels is the union of the input types.
    Arguments:
    this:image1 (Image):
    The image from which the left operand bands are taken.
    image2 (Image):
    The image from which the right operand bands are taken.
    Returns: Image

相关文章

  • GEEMODIS数据质量波段应用

    MODIS质量控制数据应用 主要功能 使用MODIS的QA波段来进行云区掩膜,深海区域掩膜 代码 步骤分析 定义函...

  • 强烈推荐一个你从未见过的动态在线SPC产品

    当前大数据非常火,但质量大数据应用依然没有很大的应用成功案例,而虽然说质量人很熟悉传统的质量工具,但在实际应用层面...

  • Python GDAL实现MODIS栅格遥感影像数据读取并基于质

      本文介绍基于Python中GDAL模块,实现MODIS遥感影像数据的读取、计算,并基于质量控制QC波段进行图像...

  • Enterprise Data At HUAWEI(六)

    基于PDCA的数据质量管理框架 什么是数据质量 华为数据质量指“数据满足应用的可信程度”,有以下6个维度 完整性:...

  • R-多波段GeoTiff文件如何输出为多个单波段Tiff文件?如

    目录 0.问题导入 1.示例数据 2.导入示例数据 3.多波段数据可视化(图1) 4.多波段数据输出为多个单波段(...

  • 天文学随记

    恒星,恒星参数,质量最重要,核反应取决于质量, 波场由长到短,射电波段,微波和红外光浦,走向短波,全波段光谱。 ...

  • 栅格数据属性表

    1.多波段栅格数据没有属性表。 2.单波段栅格数据,若值为浮点型,无属性表。 3.单波段栅格,如果是整型栅格且没有...

  • 数据质量管理概述

    数据质量管理:对数据从计划、获取、存储、共享、维护、应用、消亡生命周期的每个阶段可能引发的各类数据质量问题,进行识...

  • 数据质量检查工具

    应用场景常用场景是将数据引接到数仓,对数据质量进行检查。 主要功能(1)数据质量检查规则提供质量规则:空值检查、重...

  • 单细胞分析:质控实操(五)

    1. 学习目标 构建质量控制指标并评估数据质量 适当的应用过滤器去除低质量的细胞 2. 过滤目标 过滤数据以仅包含...

网友评论

    本文标题:GEEMODIS数据质量波段应用

    本文链接:https://www.haomeiwen.com/subject/nvvcrqtx.html