Geographic Information Systems Asked by GEEnewbie on February 2, 2021
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));
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});
Answered by Kevin Reid on February 2, 2021
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP