I was trying to retrieving chlorophyll-a levels using Landsat9. After processed it using this function :
//Clorophyll-a Levels
// Coefficients
var a0= 0.341
var a1= -3.001
var a2= 2.811
var a3= -2.041
var a4= 0.0400
function R(img){
return img.expression(
'log10(blue/green)',
{
'blue': img.select('B2'),
'green': img.select('B3')
});
}
var Ratio = citra.map(R)
function chlor(img){
return img.expression(
'10**(a0+a1*R+a2*R**2+a3*R**3)+a4',
{
'a0': a0,
'a1': a1,
'a2': a2,
'a3': a3,
'a4': a4,
'R': Ratio
})
}
var chl = citra.map(chlor)
var ChlVisPar = {min:0.4,max:1.5,palette:['blue','lime','yellow','orange','red']}
Map.addLayer(chl,ChlVisPar,'Chlor-a')
I cant visualize using the Map.addLayer(chla,ChlVisPar,'Chlor-a')
and I got messages:
Layer error: Image.pow, argument 'image1': Invalid type.
Expected type: Image.
Actual type: ImageCollection.
How do I solve this?
chl.first()
or usechl.get(index)
. Or make an aggregation (e.g.chl.median()
). If you want to show every image in the collection as a layer you can use an approach such as this answer but map over indices up to the collection length, rather than the year.