0

I am very new to using GEE and only using for one unit I'm currently doing (only using for two months and I have no coding experience). I am trying to calculate the land surface temperature estimate and I found a code from E. Lacerda but the only thing is that I get an error saying "band_to_toa.expression is not a function in toa_radiance(), line 938 ..." I've spent past few hours trying to get my way around this by googling but nothing was useful for me. I'm really not sure what to do at this point and really trying to get this done asap for due dates.

Here's the link to my script https://code.earthengine.google.com/14a01e61105994465263d252f0c501a1

var raw = ee.ImageCollection("LANDSAT/LC08/C01/T1_TOA") 
  .filterDate ('2016-01-01', '2016-12-31');

var surf_temp = function(image) {
  var geet = require('users/elacerda/geet:geet');
  var new_toa_radiance = geet.toa_radiance(raw, 11);
  var brightness = geet.brightness_temp_l8c(new_toa_radiance, true);
  var ndvi = geet.ndvi_l8(brightness);
  var veg = geet.prop_veg(ndvi);
  var lse = geet.surface_emissivity(veg);
  var surface = geet.surface_temperature_oli(lse);
  var lst = surface.select('LST');
  var img = lst
  return img;

};
Map.addLayer(raw.map(surf_temp));
1
  • Welcome to GIS SE! We're a little different from other sites; this isn't a discussion forum but a Q&A site. Please check out our short tour to learn about our focussed Q&A format. Please do not include chit chat like greetings, statements of appreciation/thanks, etc - see meta.stackexchange.com/questions/2950/…
    – PolyGeo
    Nov 11, 2020 at 8:43

1 Answer 1

0

There is no call to Image.expression in your code, so it must be in users/elacerda/geet:geet. (When you're asking a question, please try to make sure that you're showing the problematic code in your question, not just referenced from it.)

We can guess that the problem is that you're not supplying the right type of object, so the method is not found, and indeed if I change

var new_toa_radiance = geet.toa_radiance(raw, 11);

to

var new_toa_radiance = geet.toa_radiance(image, 11);

then there is no error. Whether that computes what you want, I don't know.

You'll also need to set visualization parameters so the image isn't displayed as all black:

Map.addLayer(raw.map(surf_temp), {min: -115, max: -113});
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.