当前位置: 首页 > news >正文

GEE教程:利用sentinel-2数据进行ndwi和ndci指数的计算和下载

目录

简介

函数

normalizedDifference(bandNames)

Arguments:

Returns: Image

Export.image.toDrive(image, description, folder, fileNamePrefix, dimensions, region, scale, crs, crsTransform, maxPixels, shardSize, fileDimensions, skipEmptyTiles, fileFormat, formatOptions, priority)

Arguments:

代码

结果


简介

NDWI(Normalized Difference Water Index,归一化差异水体指数)和NDCI(Normalized Difference Chlorophyll Index,归一化差异叶绿素指数)都是一种利用遥感影像数据来评估特定地物或地表类型的指数。

1. 归一化差异水体指数(NDWI):
   NDWI用于识别和区分水体和陆地。它基于水体对近红外(NIR)波段和短波红外(SWIR)波段辐射的反射率差异。其计算公式为:
   NDWI = (NIR - SWIR) / (NIR + SWIR)
   其中,NIR代表近红外波段的反射率,SWIR代表短波红外波段的反射率。
   NDWI的取值范围为-1到1,较高的数值表示较多的水体存在,较低的数值表示较多的陆地存在。

2. 归一化差异叶绿素指数(NDCI):
   NDCI用于评估和监测植被的叶绿素含量和生理状态。它基于植被对近红外(NIR)波段和红色(RED)波段辐射的反射率差异。其计算公式为:
   NDCI = (NIR - RED) / (NIR + RED)
   其中,NIR代表近红外波段的反射率,RED代表红色波段的反射率。
   NDCI的取值范围为-1到1,较高的数值表示较高的叶绿素含量(通常与较茂盛的植被相关),较低的数值表示较低的叶绿素含量(通常与植被稀疏或受到胁迫的区域相关)。

这些指数可以通过遥感影像数据计算得出,并可以用于水资源管理、环境监测、植被健康评估等应用领域。

函数

normalizedDifference(bandNames)

Computes the normalized difference between two bands. If the bands to use are not specified, uses the first two bands. The normalized difference is computed as (first − second) / (first + second). Note that the returned image band name is 'nd', the input image properties are not retained in the output image, and a negative pixel value in either input band will cause the output pixel to be masked. To avoid masking negative input values, use ee.Image.expression() to compute normalized difference.

计算两个频段之间的标准化差。如果未指定要使用的频段,则使用前两个频段。标准化差计算为(第一-秒)/(第一+秒)。请注意,返回的图像频段名称为“nd”,输入图像属性不会保留在输出图像中,并且任何输入频段中的负像素值都将导致输出像素被屏蔽。为了避免掩盖负输入值,请使用ee.Image. express()来计算规格化差异。

Arguments:

this:input (Image):

The input image.

bandNames (List, default: null):

A list of names specifying the bands to use. If not specified, the first and second bands are used.

Returns: Image

Export.image.toDrive(image, descriptionfolderfileNamePrefixdimensionsregionscalecrscrsTransformmaxPixelsshardSizefileDimensionsskipEmptyTilesfileFormatformatOptionspriority)

Creates a batch task to export an Image as a raster to Drive. Tasks can be started from the Tasks tab. "crsTransform", "scale", and "dimensions" are mutually exclusive.

Arguments:

image (Image):

The image to export.

description (String, optional):

A human-readable name of the task. May contain letters, numbers, -, _ (no spaces). Defaults to "myExportImageTask".

folder (String, optional):

The Google Drive Folder that the export will reside in. Note: (a) if the folder name exists at any level, the output is written to it, (b) if duplicate folder names exist, output is written to the most recently modified folder, (c) if the folder name does not exist, a new folder will be created at the root, and (d) folder names with separators (e.g. 'path/to/file') are interpreted as literal strings, not system paths. Defaults to Drive root.

fileNamePrefix (String, optional):

The filename prefix. May contain letters, numbers, -, _ (no spaces). Defaults to the description.

dimensions (Number|String, optional):

The dimensions to use for the exported image. Takes either a single positive integer as the maximum dimension or "WIDTHxHEIGHT" where WIDTH and HEIGHT are each positive integers.

region (Geometry.LinearRing|Geometry.Polygon|String, optional):

A LinearRing, Polygon, or coordinates representing region to export. These may be specified as the Geometry objects or coordinates serialized as a string.

scale (Number, optional):

Resolution in meters per pixel. Defaults to 1000.

crs (String, optional):

CRS to use for the exported image.

crsTransform (List<Number>|String, optional):

Affine transform to use for the exported image. Requires "crs" to be defined.

maxPixels (Number, optional):

Restrict the number of pixels in the export. By default, you will see an error if the export exceeds 1e8 pixels. Setting this value explicitly allows one to raise or lower this limit.

shardSize (Number, optional):

Size in pixels of the tiles in which this image will be computed. Defaults to 256.

fileDimensions (List<Number>|Number, optional):

The dimensions in pixels of each image file, if the image is too large to fit in a single file. May specify a single number to indicate a square shape, or an array of two dimensions to indicate (width,height). Note that the image will still be clipped to the overall image dimensions. Must be a multiple of shardSize.

skipEmptyTiles (Boolean, optional):

If true, skip writing empty (i.e. fully-masked) image tiles. Defaults to false. Only supported on GeoTIFF exports.

fileFormat (String, optional):

The string file format to which the image is exported. Currently only 'GeoTIFF' and 'TFRecord' are supported, defaults to 'GeoTIFF'.

formatOptions (ImageExportFormatConfig, optional):

A dictionary of string keys to format-specific options. For 'GeoTIFF': 'cloudOptimized'

(Boolean), 'noData' (float). For 'TFRecord': see https://developers.google.com/earth-engine/guides/tfrecord#formatoptions

priority (Number, optional):

The priority of the task within the project. Higher priority tasks are scheduled sooner. Must be an integer between 0 and 9999. Defaults to 100.

代码

var cor = [-119.54665080086161,40.038023972187226]var geometry = ee.Geometry.Point(cor)var cor2 = [[-119.77142190684849,39.825295708288806],[-119.31274270762974,39.825295708288806],[-119.31274270762974,40.25006751768576],[-119.77142190684849,40.25006751768576],[-119.77142190684849,39.825295708288806]]var geometry2 = ee.Geometry.Polygon(cor2)Map.centerObject(geometry2)var sentinel = ee.ImageCollection("COPERNICUS/S2_SR_HARMONIZED")
.filterDate('2021-09-01','2021-10-01')
.filterBounds(geometry)
.filter(ee.Filter.lt('CLOUDY_PIXEL_PERCENTAGE',45))
.map(function(img){var bands = img.select('B.*').multiply(0.0001)var ndwi = bands.normalizedDifference(['B3','B8']).rename('ndwi')var thr = ndwi.gt(0.1)var ndci = bands.normalizedDifference(['B5','B4']).rename('ndci')return ndci.updateMask(thr).copyProperties(img,['system:time_start','system:time_end'])})print(sentinel)Map.addLayer(sentinel.toBands().clip(geometry2), [], 'ndci', false)var target = sentinel.filterDate('2021-09-08','2021-09-09')Map.addLayer(target.toBands().select([0]).clip(geometry2), [], 'ndci-target', false)Export.image.toDrive({image: target.mean().clip(geometry2),description: 'ndci', scale: 20, region: geometry2, maxPixels: 1e13, crs: 'EPSG:4326',folder: 'Chlorophyll'})

结果

相关文章:

GEE教程:利用sentinel-2数据进行ndwi和ndci指数的计算和下载

目录 简介 函数 normalizedDifference(bandNames) Arguments: Returns: Image Export.image.toDrive(image, description, folder, fileNamePrefix, dimensions, region, scale, crs, crsTransform, maxPixels, shardSize, fileDimensions, skipEmptyTiles, fileFormat, …...

markdown-it:将Markdown文本转换为HTML格式,展示在页面,怎么自定义里面的a标签设置为在新标签页打开

由markdown-it将文本生成html然后渲染到页面上&#xff0c;但是现在你点击里面生成好的链接只能在本标签页打开&#xff0c;怎么将其设置为在新标签打开呢&#xff1f; 安装markdown-it npm install markdown-it 使用markdown-it const mdi new MarkdownIt({html: true,l…...

linux在工作中常用命令

简介 记录在日常工作中&#xff0c;常用linux命令 查日志篇 1.统计特定内容出现的行数和次数 1.查询特定内容出现的行数 grep -c "关键词" 文件名-c:只显示匹配的行数。 2.查询特定内容出现的次数 grep -o "关键词" 文件名 | wc -l-o&#xff1a;只显示…...

828华为云征文|部署知识库问答系统 MaxKB

828华为云征文&#xff5c;部署知识库问答系统 MaxKB 一、Flexus云服务器X实例介绍1.1 云服务器介绍1.2 核心竞争力1.3 计费模式 二、Flexus云服务器X实例配置2.1 重置密码2.2 服务器连接2.3 安全组配置 三、部署 MaxKB3.1 MaxKB 介绍3.2 Docker 环境搭建3.3 MaxKB 部署3.4 Max…...

数据结构之算法复杂度

目录 前言 一、复杂度的概念 二、时间复杂度 三、大O的渐进表示法 四、空间复杂度 五、常见复杂度对比 总结 前言 本文主要讲述数据结构中的算法复杂度 一、复杂度的概念 算法在编写成可执行程序后&#xff0c;运行时需要耗费时间资源和空间(内存)资源。因此衡量一个算法的好坏…...

Python用TOPSIS熵权法重构粮食系统及期刊指标权重多属性决策MCDM研究|附数据代码...

原文链接&#xff1a;https://tecdat.cn/?p37724 在当今世界&#xff0c;粮食系统的稳定性至关重要。尽管现有的全球粮食系统在生产和分配方面表现出较高的效率&#xff0c;但仍存在大量人口遭受饥饿以及诸多粮食安全隐患。与此同时&#xff0c;在学术领域&#xff0c;准确评估…...

【例题】lanqiao4403 希尔排序模板题

插入排序每次只能将数据移动一位。 已知插入排序代码为&#xff1a; def insert_sort(a):for i in range(1,len(a)):ji-1while j>0 and a[j]>a[i]:a[j1]a[j]j-1a[j1]a[i]return a希尔排序在插入排序的基础上&#xff0c;将数据移动n/2,n/4,…,1位。 for i in range(ga…...

【C/C++】速通涉及string类的经典编程题

【C/C】速通涉及string类的经典编程题 一.字符串最后一个单词的长度代码实现&#xff1a;&#xff08;含注释&#xff09; 二.验证回文串解法一&#xff1a;代码实现&#xff1a;&#xff08;含注释&#xff09; 解法二&#xff1a;&#xff08;推荐&#xff09;1. 函数isalnum…...

MySQL:库表的基本操作

库操作 查看 查看存在哪些数据库&#xff1a; show databases;查看自己当前处于哪一个数据库&#xff1a; select database(); 由于我不处于任何一个数据库中&#xff0c;此处值为NULL 查看当前有哪些用户连接到了MySQL&#xff1a; show processlist; 创建 创建一个数据库 语…...

JS领域的AI工程利器分享

JavaScript&#xff0c;这个在网页开发中广为人知的脚本语言&#xff0c;正逐渐在AI工程领域展现出其独特的魅力。对于那些希望将大语言模型&#xff08;LLM&#xff09;融入项目的开发者来说&#xff0c;以下五个JavaScript工具将是关键资源。 1. TensorFlow.js TensorFlow.…...

2024/9/20 使用QT实现扫雷游戏

有三种难度初级6x6 中级10x10 高级16x16 完成游戏 游戏失败后&#xff0c;无法再次完成游戏&#xff0c;只能重新开始一局 对Qpushbutton进行重写 mybutton.h #ifndef MYBUTTON_H #define MYBUTTON_H #include <QObject> #include <QWidget> #include <QPus…...

09.20 C++对C的扩充以及C++中的封装、SeqList

SeqList.h #ifndef SEQLIST_H #define SEQLIST_H#include <iostream> #include<memory.h> #include<stdlib.h> #include<string.h>using namespace std;//typedef int datatype; //类型重命名 using datatype int;//封装一个顺序表 class Seq…...

Git提交类型

说明&#xff1a;Git提交类型指的是代码commit时&#xff0c;写在comment前面的标志&#xff0c;表示此次commit的提交类型&#xff0c;如下&#xff1a; Git提交类型 常见的Git提交类型有&#xff1a; feat&#xff1a;新特性、新功能或优化&#xff1b; fix&#xff1a;修复…...

C++速通LeetCode简单第18题-杨辉三角(全网唯一递归法)

全网唯一递归法&#xff1a; vector<vector<int>> generate(int numRows) {vector<int> v;vector<vector<int>>vn;if (numRows 1){v.push_back(1);vn.push_back(v);v.clear();return vn;//递归记得return}if (numRows 2){v.push_back(1);vn.p…...

Redis作为单线程模型,为什么效率高、速度快呢?

前言&#xff1a; 效率高、速度快是相较于数据库来说的&#xff08;MySQL、Orcale、SQL server&#xff09; 文章目录 一、单线程模式的工作流程二、为什么快&#xff1f; 一、单线程模式的工作流程 这里我们所说的单线程是指&#xff1a;Redis只使用一个线程&#xff0c;来处…...

人工智能——猴子摘香蕉问题

一、实验目的 求解猴子摘香蕉问题&#xff0c;根据猴子不同的位置&#xff0c;求解猴子的移动范围&#xff0c;求解对应的过程&#xff0c;针对不同的目标状态进行求解。 二、实验内容 根据场景有猴子、箱子、香蕉&#xff0c;香蕉挂天花板上。定义多种谓词描述位置、状态等…...

对ViT 中Patch Embedding理解

借鉴了这个博主的ViT Patch Embedding理解-CSDN博客&#xff0c;再加了一些理解。 就通过代码来理解吧 假设输入图像的维度为HxWxC&#xff0c;分别表示高&#xff0c;宽和通道数。 PatchEmbed 的类&#xff0c;它继承了 nn.Module&#xff0c;实现了将输入的2维图像&#…...

Redis基本命令详解

1. 基本命令 命令不区分大小写&#xff0c;而key是区分大小写的 # select 数据库间的切换 数据库共计16个 127.0.0.1:6379> select 1# dbsize 返回当前数据库的 key 的数量 127.0.0.1:6379[1]> dbsize# keys * 查看数据库所有的key 127.0.0.1:6379[1]> keys *# fl…...

Java之线程篇四

目录 volatile关键字 volatile保证内存可见性 代码示例 代码示例2-&#xff08;volatile&#xff09; volatile不保证原子性 synchronized保证内存可见性 wait()和notify() wait()方法 notify() 理解notify()和notifyAll() wait和sleep的对比 volatile关键字 volati…...

计算机毕业设计之:基于微信小程序的校园流浪猫收养系统

博主介绍&#xff1a; ✌我是阿龙&#xff0c;一名专注于Java技术领域的程序员&#xff0c;全网拥有10W粉丝。作为CSDN特邀作者、博客专家、新星计划导师&#xff0c;我在计算机毕业设计开发方面积累了丰富的经验。同时&#xff0c;我也是掘金、华为云、阿里云、InfoQ等平台…...

LeRobot ACT实战:从源码到真机部署的保姆级教程(附ALOHA复现对比)

LeRobot ACT实战&#xff1a;从源码解析到真机部署的全链路指南 在机器人控制领域&#xff0c;动作序列预测一直是核心挑战之一。传统方法往往采用单步预测模式&#xff0c;导致动作连贯性不足&#xff0c;难以应对复杂任务场景。LeRobot ACT框架通过引入动作分块&#xff08;…...

我的第一个多智能体项目踩坑实录:LangGraph连接Dify时,流式响应和错误处理怎么做?

我的第一个多智能体项目踩坑实录&#xff1a;LangGraph连接Dify时&#xff0c;流式响应和错误处理怎么做&#xff1f; 去年夏天&#xff0c;当我第一次尝试将Dify平台的多个智能体通过LangGraph串联成工作流时&#xff0c;原本以为只需要简单调用API就能完成的任务&#xff0c;…...

Pixel Dimension Fissioner开源镜像:免编译部署,支持A10/A100/V100全适配

Pixel Dimension Fissioner开源镜像&#xff1a;免编译部署&#xff0c;支持A10/A100/V100全适配 1. 工具介绍 像素语言维度裂变器(Pixel Dimension Fissioner)是一款基于MT5-Zero-Shot-Augment核心引擎构建的高端文本改写与增强工具。它通过创新的16-bit像素冒险工坊界面设计…...

BN层在神经网络中的实战应用:为什么Conv+BN+ReLU是黄金组合?

BN层在神经网络中的实战应用&#xff1a;为什么ConvBNReLU是黄金组合&#xff1f; 当你在深夜调试神经网络时&#xff0c;是否遇到过这样的场景&#xff1a;模型训练初期loss下降很快&#xff0c;但突然陷入停滞&#xff1b;或者小心翼翼地调整学习率&#xff0c;稍大就梯度爆炸…...

单片机系统抗干扰设计的10个关键工程细节

1. 单片机系统抗干扰设计的工程实践&#xff1a;10个关键细节解析 在工业现场、智能仪表、家用电器及各类嵌入式测控系统中&#xff0c;单片机已不再是实验室环境下的理想器件&#xff0c;而是长期运行于复杂电磁环境中的核心控制器。其可靠性不再仅取决于功能实现&#xff0c;…...

WarcraftHelper:让经典魔兽争霸III重获新生的现代适配工具

WarcraftHelper&#xff1a;让经典魔兽争霸III重获新生的现代适配工具 【免费下载链接】WarcraftHelper Warcraft III Helper , support 1.20e, 1.24e, 1.26a, 1.27a, 1.27b 项目地址: https://gitcode.com/gh_mirrors/wa/WarcraftHelper 问题发现&#xff1a;当经典遭遇…...

Pixel Dimension Fissioner环境配置:Windows WSL2+GPU驱动兼容性部署要点

Pixel Dimension Fissioner环境配置&#xff1a;Windows WSL2GPU驱动兼容性部署要点 1. 工具介绍 Pixel Dimension Fissioner&#xff08;像素语言维度裂变器&#xff09;是一款基于MT5-Zero-Shot-Augment核心引擎构建的文本改写与增强工具。它将传统AI工具转化为一个充满活力…...

解锁中文语义理解新范式:bge-large-zh-v1.5全场景应用指南

解锁中文语义理解新范式&#xff1a;bge-large-zh-v1.5全场景应用指南 【免费下载链接】bge-large-zh-v1.5 项目地址: https://ai.gitcode.com/hf_mirrors/ai-gitcode/bge-large-zh-v1.5 在信息爆炸的时代&#xff0c;如何让计算机真正理解中文语义&#xff1f;当你面对…...

LLVM编译优化如何提升工业控制系统实时响应性能:5大关键技术解析

LLVM编译优化如何提升工业控制系统实时响应性能&#xff1a;5大关键技术解析 【免费下载链接】llvm-project llvm-project - LLVM 项目是一个编译器和工具链技术的集合&#xff0c;用于构建中间表示(IR)、优化程序代码以及生成机器代码。 项目地址: https://gitcode.com/GitH…...

Qwen3.5-9B视觉语言基准对比:Qwen3-VL vs Qwen3.5-9B实测分析

Qwen3.5-9B视觉语言基准对比&#xff1a;Qwen3-VL vs Qwen3.5-9B实测分析 1. 模型概述与核心能力 Qwen3.5-9B是新一代多模态大模型&#xff0c;在视觉语言理解能力上实现了显著突破。相比前代Qwen3-VL模型&#xff0c;它在保持高效推理的同时&#xff0c;通过创新的架构设计提…...