I downloaded a composite using code given below, but all values are not looking like surface reflectance values (0..1), but range from 200 to 700, for example (like raw data digital numbers). Or am I wrong with such justification?
// Define AOI
var region = ee.Geometry.Polygon(
[[[29.78, 51.42],
[29.78, 51.13],
[30.61, 51.13],
[30.61, 51.42]]], null, false);
/**
* Function to mask clouds based on the pixel_qa band of Landsat 8 SR data.
* @param {ee.Image} image input Landsat 8 SR image
* @return {ee.Image} cloudmasked Landsat 8 image
*/
function maskL8sr(image) {
// Bits 3 and 5 are cloud shadow and cloud, respectively.
var cloudShadowBitMask = (1 << 3);
var cloudsBitMask = (1 << 5);
// Get the pixel QA band.
var qa = image.select('pixel_qa');
// Both flags should be set to zero, indicating clear conditions.
var mask = qa.bitwiseAnd(cloudShadowBitMask).eq(0)
.and(qa.bitwiseAnd(cloudsBitMask).eq(0));
return image.updateMask(mask);
}
var collection_2017 = ee.ImageCollection('LANDSAT/LC08/C01/T1_SR')
.filterBounds(region)
.filterDate('2017-05-20', '2017-09-20')
.map(maskL8sr);
Export.image.toDrive({
image: collection_2017.mean().clip(region),
description: 'Landsat_Chernobyl_2017',
region:region,
scale: 30,
crs: 'EPSG:32636'});
And how to specify cloud masking threshold? I have a function in this code but I am not sure how it masks clouds.