// Applies scaling factors. function applyScaleFactors(image) { var opticalBands = image.select('SR_B.').multiply(0.0000275).add(-0.2); // var thermalBands = image.select('ST_B.*').multiply(0.00341802).add(149.0); return image.addBands(opticalBands, null, true) // .addBands(thermalBands, null, true); }
// reomove cloud for Landsat-8 function cloudRemoval(image) { // var cloudShadowBitMask = (1 < var cloudsBitMask = (1 < var qa = image.select('QA_PIXEL'); var mask = qa.bitwiseAnd(cloudShadowBitMask).eq(0) .and(qa.bitwiseAnd(cloudsBitMask).eq(0)); //var mask2 = image.select("blue").gt(0.2); return image.updateMask(mask) //.updateMask(mask2.not()) .toDouble() .copyProperties(image) .copyProperties(image, ["system:time_start"]); }
// Assign a common name to the sensor-specific bands. var LC9_BANDS = ['SR_B2','SR_B3','SR_B4','SR_B5','SR_B6','SR_B7','QA_PIXEL']; //Landsat 9 var LC8_BANDS = ['SR_B2','SR_B3','SR_B4','SR_B5','SR_B6','SR_B7','QA_PIXEL']; //Landsat 8 var LC7_BANDS = ['SR_B1','SR_B2','SR_B3', 'SR_B4','SR_B5','SR_B7','QA_PIXEL']; //Landsat 7 var LC5_BANDS = ['SR_B1','SR_B2','SR_B3', 'SR_B4','SR_B5','SR_B7','QA_PIXEL']; //Llandsat 5 var S2_BANDS = ['B2','B3','B4','B8','B11','B12']; // Sentinel-2 var STD_NAMES = ['blue', 'green', 'red', 'nir', 'swir1', 'swir2','QA_PIXEL'];