简体   繁体   English

在 Google Earth Engine 中构建图像波段的数学方程式

[英]Constructing a Mathematical Equation for Image Bands in Google Earth Engine

I am struggling with an equation, getting some syntax error in it, The equation is following: formula: (K2 / ln ((K1/TOA_band10)+1)) - 273.15我正在努力处理一个方程式,其中出现一些语法错误,方程式如下:公式: (K2 / ln ((K1/TOA_band10)+1)) - 273.15

I am trying to do operation on image bands, but not being able to construct the right code.我正在尝试对图像波段进行操作,但无法构建正确的代码。 I have used this instead:我用这个代替:

var BT = band_10.expression((1329.2405*1.0/((799.0284*1.0/TOA_B10)+1).log10())-273.15)

But it did not work.但它没有用。

A general hint about constructing an equation in earth engine - javascript.关于在 Earth Engine 中构建方程式的一般提示 - javascript。

You're in the right direction.你是在正确的方向。 You have to include the map property of expression() .您必须包含expression()map属性。 It defines the variables you can use inside your expression.它定义了您可以在表达式中使用的变量。 Then with some minor tweaks to the actual expression, it works fine:然后对实际表达式进行一些小的调整,它工作正常:

var BT = ee.Image().expression(
  '(K2 / log((K1 / TOA_band10) + 1)) - 273.15',
  {
    K1: 799.02841,
    K2: 1329.24051,
    TOA_band10: someImage
  }
)

https://code.earthengine.google.com/e5cf09e87ddf51ec27a00b8ed4695ce4 https://code.earthengine.google.com/e5cf09e87ddf51ec27a00b8ed4695ce4

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM