I want to get 1990 NDVI from Landsat5,and remove the cloud cover, so I used the code:
var addNDVI = function(image) {
var ndvi = image.normalizedDifference(['B4', 'B3']).rename('NDVI');
return image.addBands(ndvi);
};
var addFmask = function(image) {
var datamask = image.select('fmask');
var cloudMask = datamask.neq(1).and(datamask.neq(2)).and(datamask.neq(3)).and(datamask.neq(4));
return image.updateMask(cloudMask);
};
var collection2 = ee.ImageCollection('LANDSAT/LT5_L1T_TOA_FMASK')
.filterBounds(alb)
.filterDate('1991-01-01', '1991-12-31')
.select(['B3', 'B4', 'fmask'])
.map(addFmask)
.map(addNDVI).select('NDVI');
When I run this code, I got the error as below:
Error generating chart: ImageCollection.load: Use LANDSAT/LT05/C01/T1_SR instead of LANDSAT/LT5_L1T_TOA_FMASK
So, I'm wonder if there are any question to use Fmask algorithm in the Landsat5 or I need to make some correction?