I am working with some modis LST data, and am running into the following problem:
I am running two functions on the data, which I will need to combine later. For that reason, the band names need to be the same. When I run the code below however, one output has band [LST_DAY_1km], and one has band [constant]. This obviously doesnt add up, and I am confused where the problem is coming from, given I'm using the same input data.
See code below:
// Use the expression function to generate scaled LST.
var scaledlst1 = lst.map(function (lst) {
return lst.expression(
'(lst/30)',{
'lst': lst.select('LST_Day_1km')
});
});
Map.addLayer(scaledlst1, {band:'LST_Day_1km' ,max: 1 , min: 0}, 'scaledlst1');
//
var scaledlst2 = lst.map(function (lst) {
return lst.expression(
'(2.5-(0.05*lst))',{
'lst': lst.select('LST_Day_1km')
});
});
Map.addLayer(scaledlst2, {band:'LST_Day_1km', max: 1 , min: 0}, 'scaledlst2');
Does anyone have any suggestions as to why this might be?
My next step is to take the minimum value per pixel between the two products:
//select images
var ListOfImages1 = scaledlst1.toList(scaledlst1.size())
var ListOfImages2 = scaledlst2.toList(scaledlst2.size())
var LST = ee.Image(ListOfImages1.get(0))
var LST2 = ee.Image(ListOfImages2.get(0))
//Take min value
var scaledLST = ee.ImageCollection.fromImages([LST,LST2]).min()
Map.addLayer(scaledLST, {max: 1 , min: 0}, 'Scaled LST');
Which yields the following error:
Scaled LST: Tile error: Expected a homogeneous image collection, but an image with incompatible bands was encountered: First image type: 1 bands ([LST_Day_1km]). Current image type: 1 bands ([constant]). Image ID: 1 Some bands might require explicit casts.