首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >雷达植被指数

雷达植被指数
EN

Stack Overflow用户
提问于 2022-10-04 18:59:55
回答 1查看 103关注 0票数 1

我想为目标roi中的雷达植被指数( RVI )创建一个时间平均值。在我的例子中:

代码语言:javascript
复制
library(tidyverse)
library(rgee)
library(sf)
ee_Initialize(drive=TRUE)

# Define a Region of interest
roi <-ee$Geometry$Point(-52.19032,-30.25413)$buffer(500)
    
# Sentinel-1 dataset into the Earth Engine’s public data archive ------------              
s1 <- ee$ImageCollection("COPERNICUS/S1_GRD")

# Radar vegetation index - RVI
 
RVI = function(img){
    img_band_selected <- image$expression(
        expression = '4*vh/(vv+vh)',
        opt_map =  list(
            'vv' = image$select('VV'),
            'vh' = image$select('VH')
        )
    )
        return(img_band_selected)
    }

s1_roi  <- s1$
   filterBounds(roi)$
   filter(ee$Filter$date(as.character(as.Date("2019-12-04")), as.character(as.Date("2020-01-03"))))$$filter(ee$Filter$listContains("transmitterReceiverPolarisation", "VV"))
$filter(ee$Filter$listContains("transmitterReceiverPolarisation","VH"))$filter(ee$Filter$eq("instrumentMode", "IW"))$
   map(RVI)

#Extract average radar vegetation index (RVI) values 
ee_mean<- ee_extract(
     x = s1_roi,
     y = RVI,
     scale = 10,
     fun = ee$Reducer$mean(),
     via = "drive"
    )
ee_mean

Error in py_call_impl(callable, dots$args, dots$keywords) : 
TypeError: 'ImageCollection' object is not callable

但是输出是不好的,几乎没有关于rgee中哨兵-1波段C的植被指数的例子。

能帮个忙吗?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2022-10-08 13:43:14

如果您在image中通过img更改了xy对象,并且纠正了ee_extract中调用的xy对象,那么您的脚本就能工作!!

代码语言:javascript
复制
library(tidyverse)
library(rgee)
library(sf)
ee_Initialize(drive=TRUE)

# Define a Region of interest
roi <-ee$Geometry$Point(-52.19032,-30.25413)$buffer(500)

# Sentinel-1 dataset into the Earth Engine’s public data archive ------------              
s1 <- ee$ImageCollection("COPERNICUS/S1_GRD")$filter(ee$Filter$listContains("transmitterReceiverPolarisation", "VV"))$filter(ee$Filter$listContains("transmitterReceiverPolarisation","VH"))$filter(ee$Filter$eq("instrumentMode", "IW"))

# Radar vegetation index - RVI

RVI = function(img){
  img_band_selected <- img$expression(
    expression = '4*vh/(vv+vh)',
    opt_map =  list(
      'vv' = img$select('VV'),
      'vh' = img$select('VH')
    )
  )
  return(img_band_selected)
}

s1_roi  <- s1$filterBounds(roi)$filter(ee$Filter$date(as.character("2019-12-04"), as.character("2020-01-03")))$map(RVI)

#Extract average radar vegetation index (RVI) values 
ee_mean<- ee_extract(
  x = s1_roi,
  y = roi,
  scale = 10,
  fun = ee$Reducer$mean(),
  via = "drive"
)
ee_mean

  S1B_IW_GRDH_1SDV_20191210T084832_20191210T084857_019300_024710_A03C_constant
1                                                                     2.426008
  S1B_IW_GRDH_1SDV_20191222T084832_20191222T084857_019475_024CA1_193D_constant
1                           

                                      2.434232
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/73952483

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档