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'})

结果

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.xdnf.cn/news/1541390.html

如若内容造成侵权/违法违规/事实不符,请联系一条长河网进行投诉反馈,一经查实,立即删除!

相关文章

2024年双十一不容错过的好物分享,最值得买的几款超值单品

2024的“双11”购物狂欢节即将要拉开帷幕&#xff0c;大家有没有物色到心仪的好物呢&#xff1f;平时看中的某一件商品&#xff0c;总想着在最低价时入手&#xff0c;毫无疑问双十一就是最佳时机&#xff0c;毕竟各大电商平台都会推出优惠活动。为此我也特意整理了一份数码好物…

【YOLO目标检测学生课堂行为数据集】共4266张、已标注txt格式、有训练好的yolov5的模型

目录 说明图片示例 说明 数据集格式&#xff1a;YOLO格式 图片数量&#xff1a;4266 标注数量(txt文件个数)&#xff1a;4266 标注类别数&#xff1a;3 标注类别名称&#xff1a;hand、read、write 数据集下载&#xff1a;学生课堂行为数据集 图片示例 数据集图片&#…

耳夹式耳机值得买吗?揭秘耳夹式耳机六大避坑指南!

耳夹式耳机值得买吗&#xff1f;这是很多人的疑问&#xff0c;但是夹耳式耳机火起来跟当下人们对健康运动的需求密不可分&#xff0c;入耳式耳机照顾了听音需求就很难兼顾环境音&#xff0c;还有耳部健康和佩戴舒适度等等&#xff0c;而运动时半入耳式耳机又容易掉&#xff0c;…

2024年华为杯研赛(D题)数学建模竞赛解题思路|完整代码论文集合

我是Tina表姐&#xff0c;毕业于中国人民大学&#xff0c;对数学建模的热爱让我在这一领域深耕多年。我的建模思路已经帮助了百余位学习者和参赛者在数学建模的道路上取得了显著的进步和成就。现在&#xff0c;我将这份宝贵的经验和知识凝练成一份全面的解题思路与代码论文集合…

详解c++:new和delete

文章目录 前言一、new和mallocnew的用法&#xff08;爽点&#xff09;自动构造 delete和freedelete的用法&#xff08;爽点&#xff09; 提醒 前言 提示&#xff1a;这里可以添加本文要记录的大概内容&#xff1a; 在C中&#xff0c;new 和 delete 是两个非常重要的操作符&am…

0921VGG网络实现

深度学习之VGG网络搭建 1.VGG动机2.VGG架构3.代码4.结论1.VGG动机 随着卷积网络在计算机视觉领域的快速发展,越来越多的研究人员开始通过改变模型的网络结构在提高在图像识别任务中的精度,例如使用更小的卷积核和步长[2]。基于类似的想法,论文作者提出可以尝试通过改变卷积…

FLUX.1+ComfyUI部署与使用:图像合成技术的新高度

✨ Blog’s 主页: 白乐天_ξ( ✿&#xff1e;◡❛) &#x1f308; 个人Motto&#xff1a;他强任他强&#xff0c;清风拂山冈&#xff01; &#x1f4ab; 欢迎来到我的学习笔记&#xff01; FLUX.1的版本 FLUX.1是由黑森林实验室&#xff08;[Black Forest Labs](https://bla…

进程分析工具Process Explorer使用

进程分析工具Process Explorer使用 Process Explorer让使用者能了解看不到的在后台执行的处理程序&#xff0c;能显示目前已经载入哪些模块&#xff0c;分别是正在被哪些程序使用着&#xff0c;还可显示这些程序所调用的DLL进程&#xff0c;以及他们所打开的句柄。Process Expl…

ORCDA仿真功能_PS_PISC,显示窗口小,模板工程,光标,查看值

1 开启PS_PICE仿真功能 1 新建 2 可以选择已有模板工程 3 创建模板工程 2 进行仿真 1 设置仿真时间 2 可以用光标测量不同曲线位置的信息&#xff08;如电压&#xff09; 1 光标&#xff0c;可以测量不同点的电压 2 Trace&#xff08;测量功率&#xff09;&#xff0c;加…

探索《越南语翻译通》App:高效语言学习的利器

在当今这个全球化的世界里&#xff0c;语言学习变得越来越重要。随着科技的发展&#xff0c;我们有了更多便捷的工具来帮助我们学习新的语言。今天&#xff0c;我们来探索一款名为《越南语翻译通》的App&#xff0c;它正逐渐成为语言学习者的新宠。 《越南语翻译通》App的特点…

VMware虚拟机密码忘记了怎么办

1.首先&#xff0c;启动系统&#xff0c;进入开机界面&#xff0c;在界面中按“e”进入编辑界面 2.进入编辑界面&#xff0c;使用键盘上的上下键把光标往下移动&#xff0c;找到以““Linux16”开头内容所在的行数”&#xff0c;在行的最后面输入&#xff08;最好把前面的语言改…

Fabric:布匹纺织缺陷检测数据集(猫脸码客 第195期)

布匹数据集在纺织工业中的应用与探索&#xff1a;从布匹检索到纹理检测 引言 在快速发展的纺织工业中&#xff0c;信息技术的深度融合正逐步推动产业向智能化、精细化转型。其中&#xff0c;布匹数据集作为连接传统制造与数字技术的桥梁&#xff0c;其在布匹检索、纹理检测等…

CVE-2024-46101

前言 自己挖的第一个CVE~ 喜提critical 这里简单说一下。 漏洞简介 GDidees CMS < 3.9.1 的版本&#xff0c;存在一个任意文件上传漏洞。允许登录后的攻击者上传webshell获得网站的权限。 影响版本&#xff1a; GDidees CMS < 3.9.1 &#xff08;其它的我没测。。&am…

Python入门:数据类型、控制流与函数详解

如果你正在学习Python&#xff0c;那么你需要的话可以&#xff0c;点击这里&#x1f449;Python重磅福利&#xff1a;入门&进阶全套学习资料、电子书、软件包、项目源码等等免费分享&#xff01; Python作为一种广泛使用的高级编程语言&#xff0c;以其简洁的语法、丰富的库…

进程间的通信3-信号量

信号量 1.资源竞争 资源竞争 : 当多个进程同时访问共享资源时&#xff0c;会产生资源竞争&#xff0c;最终最导致数据混乱临界资源 : 不允许同时有多个进程访问的资源&#xff0c;包括硬件资源(CPU、内存、存储器以及其他外围设备)与软件资源(共享代码段、共享数据结构)临界区…

【项目管理进阶】风险问题

前言 各位盆友&#xff0c;你们期待的项目管理进阶系列有新的消息&#xff0c;请注意查收&#xff0c;并反馈哦~ 在参加项目的过程中&#xff0c;你是否面临或参加过类似如下的场面&#xff1a; 为了立项&#xff0c;先调研市场、技术、社会、组织内部的现状为了科学的管理项目…

2024年中国研究生数学建模竞赛C题数据驱动下磁性元件的磁芯损耗建模 思路讲解

第一题是非常经典的机器学习分类过程, 首先第一步,我们需要做可视化分析。通过一些统计学方法来分析磁通密度的分布特征以及不同波形的一个形态特征,那这里可以通过绘制一些例如核密度估计图,双变量影响关系图,描述性统计等等, 其次,第二步,我们需要去构建特征筛选。…

安科瑞产品在银行智慧用电监测平台的设计与应用

01前言 随着科技发展&#xff0c;电力供应日益充分&#xff0c;电气设备日益增多&#xff0c;电力在带来光明和效率同时&#xff0c;也带来火灾危害。据应急管理部消防救援局统计[1]&#xff0c;2020年全国共接报火灾25.2万起&#xff0c;电气类原因继续强力影响火灾走势&…

漏洞——CVE简介

1、什么是CVE CVE (Common Vulnerabilities and Exposures)&#xff08;常见漏洞与暴露&#xff09;是一个标准化的命名系统&#xff0c;用于识别和描述公开披露的网络安全漏洞。CVE 的目的是为漏洞提供唯一的标识符&#xff0c;使安全专家、软件供应商和用户能够统一参考和讨…

Java+Spring Cloud +UniApp 智慧工地源码,用户PC端、移动端数据同步,支持多端展示

数字化给各行各业所带来的改变&#xff0c;在早些年间突出自动这一流程。但随着科技的发展&#xff0c;让人们也愈发了解可视化操作所带来的优势。智慧工地的诞生&#xff0c;相当于为建筑施工带来了一套较为完整的数字化流程&#xff0c;能够完善施工环节中的各部分内容。接下…