Concerning “Landsat 5’s cloud mask and pixel quality assessment” in Google Earth Engine

I need assistance for solving a problem with Landsat 5 surface reflectance image’s cloud mask.

I am new to this tool/programming and want to try this tool to process cloud mask. Through the provided open source code in the web page of Goole Earth Engine, the processing code is composed as below.

However, I would like to request help to debug this error message “Error: Invalid argument: ‘image’ must be of type Image.”

var cloudy_scene = ee.Image('LANDSAT/LT5_SR/LT5*************');



// Load a Landsat 5 image collection.
var collection = ee.ImageCollection("LANDSAT/LT5_SR")

// Filter to get a geometry representing an export region.

// Filter to get the years/months/days of data.
.filterDate('1993-01-01', '1993-03-01')  // filter to your favorite period

// Sort the collection in chronological order.
.sort('system:time_start', true);

//Details for cfmask

var masked ={  
    return image.updateMask(['cfmask']).neq(4))

// Apply the mask to the image and display the result.
Map.addLayer(masked, {}, 'masked');

var geometry = ee.Geometry.Rectangle([***.***,**.***,***.***,**.***]);

//export the image, specifying scale and region.
    image: masked,
    description: 'ImageToDrive',
    scale: 30,
    region: geometry

Leave a Reply

Your email address will not be published. Required fields are marked *