0

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

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.

Daniel Wiell
  • 253
  • 2
  • 5
  • What about it didn't work? What was expected and what actually happened? Can you give a high-level description of what you're trying to achieve for those who aren't as familiar with your problem as you are? – rainbow.gekota Nov 30 '22 at 05:21

1 Answers1

0

You're in the right direction. You have to include the map property of expression(). 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

Daniel Wiell
  • 253
  • 2
  • 5