I'm fairly new in Google Earth Engine and JavaScript. I'm trying to convert Landsat8 DN to TOA reflectance using GEE using a function.
// Load a raw Landsat scene and display it.
var image = ee.Image('LANDSAT/LC08/C01/T1/LC08_116050_20130425');
Map.centerObject(image, 10);
Map.addLayer(image, {bands: ['B4', 'B3', 'B2'], min: 6000, max: 12000},
'raw');
// Compute the toa_radiance using an expression.
var toa = image.expression(
'(ML*QCAL)+AL', {
'ML': ee.Image(ee.Number(image.get('RADIANCE_MULT_BAND_1'))),
'AL': ee.Image(ee.Number(image.get('RADIANCE_ADD_BAND_1'))),
'QCAL': ee.Image(255.0)
});
print('Radiance: ', toa);
Map.centerObject(image, 9);
Map.addLayer(L, {min: -1, max: 255});
After loading running the script, I get a black image. What might probably be wrong?