Skip to content

Commit

Permalink
Updated cloud_masks_test (added 14 lines, deleted 28 lines).
Browse files Browse the repository at this point in the history
  • Loading branch information
fitoprincipe committed Mar 16, 2018
1 parent 83fed4a commit cdea27c
Showing 1 changed file with 11 additions and 25 deletions.
36 changes: 11 additions & 25 deletions cloud_masks_test
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@


var show = function(colid, cloud_prop, viz, name, func, params, cloud_percent) {
print(colid, cloud_prop, viz, name, params)
var percent = cloud_percent || 40;
var cent = Map.getCenter();
var col = ee.ImageCollection(colid)
Expand All @@ -35,35 +34,22 @@
}


var sentinel2_ = function() {
var cent = Map.getCenter();
var col = ee.ImageCollection('COPERNICUS/S2')
.filterBounds(cent)
.filterMetadata('CLOUDY_PIXEL_PERCENTAGE', 'greater_than', 40)
//.filterDate('2017-01-01', '2017-03-01')
.sort('CLOUDY_PIXEL_PERCENTAGE');

if (col.size().getInfo() !== 0) {
var img = ee.Image(col.first());
var vis = {bands:['B8', 'B12', 'B4'], min:0, max:5000}
var masked = cloud.make.sentinel2(null)(img)
Map.addLayer(masked, vis, 'Sentinel 2 masked');
Map.addLayer(img, vis, 'Sentinel 2 NOT masked', false);
Map.centerObject(img)
}
else {
print('Collection is empty')
}
};

var sentinel2 = function() {
var sentinel2 = function(options) {
var opt = options || null
show('COPERNICUS/S2', 'CLOUDY_PIXEL_PERCENTAGE',
{bands:['B8', 'B12', 'B4'], min:0, max:5000},
'SENTINEL 2', cloud.make.sentinel2, null)
'SENTINEL 2', cloud.make.sentinel2, opt)
}


var landsat8SR = function(options, name) {
var landsat8SR = function(options) {
var opt = options || null
show('LANDSAT/LC08/C01/T1_SR', 'CLOUD_COVER',
{bands:['B5', 'B7', 'B4'], min:0, max:5000},
'Landsat 8 SR', cloud.make.landsatSR, opt)
}

var landsat8SR_ = function(options, name) {
var n = name || 'Landsat 8 SR'
var cent = Map.getCenter();
var col = ee.ImageCollection('LANDSAT/LC08/C01/T1_SR')
Expand Down

0 comments on commit cdea27c

Please sign in to comment.