1 / 56

Monitoraggio Geodetico e Telerilevamento EarthEngine exercizes

Monitoraggio Geodetico e Telerilevamento EarthEngine exercizes. Carla Braitenberg Dip. Matematica e Geoscienze Universita’ di Trieste berg@units.it Tel. 339 8290713 Tel. Assistente Dr. Nagy: 040 5582257. Please follow the next scripts. https://code.earthengine.google.com/

hazela
Download Presentation

Monitoraggio Geodetico e Telerilevamento EarthEngine exercizes

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Monitoraggio Geodetico e Telerilevamento EarthEngine exercizes Carla Braitenberg Dip. Matematica e Geoscienze Universita’ di Trieste berg@units.it Tel. 339 8290713 Tel. Assistente Dr. Nagy: 040 5582257

  2. Please follow the next scripts • https://code.earthengine.google.com/ • Javascript Reference: https://www.w3schools.com/js/js_math.asp

  3. Script 00 introduction to scripter language Furthercomments to thisintroduction: https://developers.google.com/earth-engine/tutorial_js_01 • // String objects can also start and end with double quotes. • // But don't mix and match them. • varmy_other_variable = "I am also a string"; • // Statements should end in a semi-colon, or the editor complains. • var test = 'I feel incomplete...' • // Parentheses are used to pass parameters to functions. • print('This string will print in the Console tab.'); • // Square brackets are used for selecting items within a list. • // The zero index refers to the first item in the list. • varmy_list = ['eggplant', 'apple', 'wheat']; • print(my_list[0]); • varthe_answer=42; • // Curly brackets (or braces) can be used to define dictionaries (key:value pairs) • varmy_dict = {'food':'bread', 'color':'red', 'number':the_answer}; • // Square brackets can be used to access dictionary items by key. • print(my_dict['number']); • print(my_dict['color']); • // Or you can use the dot notation to get the same result. • print(my_dict.color); • // Functions can be defined as a way to reuse code and make it easier to read • varmy_hello_function = function(string) { • return 'Hello ' + string + '!'; • }; • print(my_hello_function('world'));

  4. Script 00-Continues introduction to scripter language • // define sum and multiplication in function • varmy_sum_function = function(s1,s2) { • var t3=[s1+s2, s1*s2] • return t3; • }; • print(my_sum_function(2,3)); Access other possible numericaloperations: Createobject of type number in ee: var s1=1.3 var t5 = ee.Number(s1) Call the methodcos whichyoufind in the documentation Docs for the objectee.Number: var t6 = t5.cos() Equivalent: Var t6=ee.Number(s1).cos() Equivalent- basic Javascript instructions (seeJavascript guide): Var t6=Math.cos(s1)

  5. 01 Scriptvarsrtm=ee.Image("USGS/SRTMGL1_003");Map.addLayer(srtm, {min:0, max:3000});// Get a list of all metadata properties.var properties = srtm.propertyNames();print('Metadata properties: ', properties); // ee.List of metadata properties// Get a specific metadata property.var d = srtm.get('date_range');print('daterange: ', d); var p = srtm.get('title');print('title: ', p);

  6. 02 script • // Using mathematical functions • // Functions can be defined as a way to reuse code and make it easier to read • varmy_hello_function = function(string) { • return 'Hello ' + string + '!'; • }; • print(my_hello_function('world')); • // define sum and multiplication in function • varmy_sum_function = function(s1,s2) { • var t3=[s1+s2, s1*s2] • return t3 • }; • print(my_sum_function (4,5)) • // define sum and multiplication in function • varmy_sum_function = function(s1,s2) { • var t4= s1+s2 • var t3 =s1*s2 • var t5 = ee.Number(s1) • var t6 = t5.cos() • return [t3,t4,t6]; • }; • vartg = my_sum_function(2,3); • print(tg) • // useful sometimes: get present date: • var d = new Date(); • print(d)

  7. Script 03 • varsrtm=ee.Image("USGS/SRTMGL1_003");var slope = ee.Terrain.slope(srtm); • Map.addLayer(srtm, {min:0, max:3000}, 'DEM'); • Map.addLayer(slope, {min:0, max:10}, 'slope'); ee.Terrain.slope(): Calculates slope in degrees from a terrain DEM. The local gradient is computed using the 4-connected neighbors of each pixel, so missing values will occur around the edges of an image. Arguments: input (Image):An elevation image, in meters. Returns: Image

  8. Script 03 continues • varsrtm = ee.Image("USGS/SRTMGL1_003"); • // we compute the slope explicitly • // Compute the image gradient in the X and Y directions. • varxyGrad = srtm.gradient(); • // Compute the magnitude of the gradient. • var gradient =( xyGrad.select('x').pow(2) • .add(xyGrad.select('y').pow(2))).sqrt(); • // Compute slope angle in radians • var slope1 = gradient.atan(); • // Compute the slope angle in degrees using an expression. • varslopedeg = slope1.expression( • '180*1.0/3.1415926535*sl', { • 'sl': slope1 • }); • // Compute the direction of the gradient in radians • var direction = xyGrad.select('y').atan2(xyGrad.select('x')); • // Display the results. • Map.setCenter(12, 45, 10); • Map.addLayer(direction, {min: -2, max: 2, format: 'png'}, 'direction'); • Map.addLayer(gradient, {min:-0.01, max: 0.02, format: 'png'}, 'gradient'); • Map.addLayer(slopedeg, {min:0, max: 10, format: 'png'}, 'slope1');

  9. Script 04 • var landsat8 = ee.ImageCollection("LANDSAT/LC8_L1T_TOA"); • var images = landsat8.filterDate('2015-04-01', '2015-04-06'); • Map.addLayer(images); Dettagli sulla missione Landsat Vedi documentazione della NASA https://landsat.gsfc.nasa.gov/landsat-data-continuity-mission/ Esempi di immagini a diverse bande di frequenza: https://landsat.gsfc.nasa.gov/landsat-8/landsat-8-bands/

  10. Landsat8 - summary • Landsat 8 launched on February 11, 2013, from Vandenberg Air Force Base, California, on an Atlas-V 401 rocket, with the extended payload fairing
 (EPF) from United Launch Alliance, LLC. The Landsat 8 satellite payload consists of two science instruments—the Operational Land Imager (OLI) and the Thermal Infrared Sensor (TIRS). These two sensors provide seasonal coverage of the global landmass at a spatial resolution of 30 meters (visible, NIR, SWIR); 100 meters (thermal); and 15 meters (panchromatic). • Landsat 8 instruments represent an evolutionary advance in technology. OLI improves on past Landsat sensors. OLI is a push-broom sensor with a four-mirror telescope and 12-bit quantization. OLI collects data for visible, near infrared, and short wave infrared spectral bands as well as a panchromatic band. It has a five-year design life. The graphic below compares the OLI spectral bands to Landsat 7′s ETM+ bands. OLI provides two new spectral bands, the coastal band (band 1) and a cirrus cloud band (band 9),

  11. Comparison of spectral bands of Landsat 8 and Landsat 7

  12. Landsat 1 • Landsat 1 • Launch Date: July 23, 1972 • Status: expired, January 6, 1978 • Sensors: RBV, MSS • Altitude: nominally 900 km • Inclination: 99.2° • Orbit: polar, sun-synchronous • Equatorial Crossing Time: nominally 9:42 AM mean local time (descending node) • Period of Revolution : 103 minutes; ~14 orbits/day • Repeat Coverage : 18 days

  13. Script 04 • var landsat8 = ee.ImageCollection("LANDSAT/LC8_L1T_TOA"); • var images = landsat8.filterDate('2015-04-01', '2015-04-06'); • Map.addLayer(images); Per esercizio: variare i periodi temporali Consultare le proprieta’ del database Landsat8. Caricare un altro database, per esempio sentinel 2 o landsat 7. Confrontare con le proprieta’ di landsat 7. Attenzione a scegliere le date opportune avendo controllato la copertura sulla documentazione. Begin 2 may 2018.

  14. Script 04-continua var landsat8 = ee.ImageCollection("LANDSAT/LC8_L1T_TOA"); var images = landsat8.filterDate('2015-04-01', '2015-04-06'); Map.addLayer(images); Ispezionare le proprieta’ della figura in scala di grigi nel menu “Inspector” Nell’imagine sono sovrapposte tutte le bande facenti parte della collezione. Nel prossimo script selezioniamo le bande del visibile e dell’infrarosso.

  15. Script 05 var landsat8 =ee.ImageCollection("LANDSAT/LC8_L1T_TOA"); varrgb_viz = {min:0, max:0.3, bands:['R','G','B']}; var rgb_viz1 = {min:0, max:0.3, bands:['B','G','R']}; var images = landsat8.select(['B2','B3','B4','B5'], ['B','G','R','N']); images = images.filterDate('2015-04-01', '2015-04-06'); Map.addLayer(images, rgb_viz, 'True Color'); Map.addLayer(images, rgb_viz1, 'False Color');

  16. Script 6 Median var landsat8 = ee.ImageCollection("LANDSAT/LC8_L1T_TOA"); varrgb_viz = {min:0, max:0.3, bands:['R','G','B']}; var images = landsat8.select(['B2','B3','B4','B5'], ['B','G','R','N']); images = images.filterDate('2015-04-01', '2015-10-06'); Map.addLayer(images, rgb_viz, 'True Color'); Map.addLayer(images.median(), rgb_viz, 'True Color median'); Nexttomedian, youhavealso: mode and mean. Median: Middle value separating the greater and lesser halves of a data set Mode: Most frequent value in a data set Mean: Sum ofvaluesof a data set dividedbynumberofvalues

  17. Script 7 Sentinel var sentinel2 =ee.ImageCollection("COPERNICUS/S2"); var landsat8 = ee.ImageCollection("LANDSAT/LC8_L1T_TOA"); varrgb_viz = {min:0, max:0.3, bands:['R','G','B']}; var rgb_viz2 = {min:0, max:2000, bands:['R','G','B']}; var images = landsat8.select(['B2','B3','B4','B5'], ['B','G','R','N']); var images2 = sentinel2.select(['B2','B3','B4','B5'], ['B','G','R','N']); images = images.filterDate('2016-05-01', '2016-05-06'); images2 = images2.filterDate('2016-01-26', '2016-04-28'); Map.addLayer(images, rgb_viz, 'True Color'); Map.addLayer(images2, rgb_viz2, 'True Color sentinel'); Map.addLayer(images.median(), rgb_viz, 'True Color median');

  18. Script 7 Sentinel- filter on location var landsat8 = ee.ImageCollection("LANDSAT/LC8_L1T_TOA"); var s2 = ee.ImageCollection("COPERNICUS/S2"); var geometry = /* color: 0000ff */ee.Geometry.Point([13, 45.5]); // // Landsat 8 // var images = landsat8.select(['B2','B3','B4','B5'], ['B','G','R','N']); // varrgb_viz = {min:0, max:0.3, bands:['R','G','B']}; // Sentinel 2 var images = s2.select(['B2','B3','B4','B8'], ['B','G','R','N']); varrgb_viz = {min:0, max:2000, bands:['R','G','B']}; images = images.filterDate('2015-08-01', '2015-12-11'); images = images.filterBounds(geometry); var sample = ee.Image(images.first()); Map.addLayer(sample, rgb_viz, 'sample'); Map.addLayer(images.median(), rgb_viz, 'True Color median');

  19. Script 8 sentinel Min-max • var s2toa =ee.ImageCollection("COPERNICUS/S2"); • varrgb_viz = {min:0, max:2000, bands:['R','G','B']}; • var s2 = s2toa.select(['B2','B3','B4','B5'], ['B','G','R','N']) • .filterDate('2016-01-26', '2016-04-28'); • print(s2.size()); • Map.addLayer(s2, rgb_viz, 'RGB'); • Map.addLayer(s2.max(), rgb_viz, 'max'); • Map.addLayer(s2.min(), rgb_viz, 'min');

  20. Script 9 NDVI • var s2toa =ee.ImageCollection("COPERNICUS/S2"); • varrgb_viz = {min:0, max:2000, bands:['R','G','B']}; • var s2 = s2toa.select(['B2','B3','B4','B5'], ['B','G','R','N']) • .filterDate('2016-01-26', '2016-04-28'); • print(s2.size()); • Map.addLayer(s2, rgb_viz, 'RGB', false); • var image = s2.min(); • Map.addLayer(image, rgb_viz, 'image'); • varndvi = image.normalizedDifference(['N', 'R']); • varndwi_viz = {min:-0.2, max:0.2, palette:'black,green'}; • Map.addLayer(ndvi, ndwi_viz, 'NDVI'); end 3 may 2018. NDVI=(NIR-Red)/(NIR+Red) NormalizedDifferencevegetationIndex

  21. Script 10 sediment identification Example from Caribbean Sea. The problem is to identify the sediment input from the River and detect the seasonal changes of the size and form of the sediment cloud. This is done from multispectral Landsat images. var landsat8 = ee.ImageCollection("LANDSAT/LC08/C01/T1_SR"); var landsat7 = ee.ImageCollection("LANDSAT/LE07/C01/T1_SR"); //var landsat8 = ee.ImageCollection("LANDSAT/LC8_L1T_TOA"), // landsat7 = ee.ImageCollection("LANDSAT/LE7_L1T_TOA"); varrgb_viz = {min:0, max:1500, bands:['R','G','B']}; var rgb_viz1 = {min:0, max:1500, bands:['B','G','N']}; var images = landsat8.select(['B2','B3','B5','B4'], ['B','G','N','R']); var images7 = landsat7.select(['B1','B2','B4','B3'], ['B','G','N','R']); var geometry = /* color: 0000ff */ee.Geometry.Point([-75, 11]); images = images.filterDate('2015-04-01', '2015-04-06'); images = images.filterBounds(geometry); images7 = images7.filterDate('2000-04-01', '2000-12-30'); images7 = images7.filterBounds(geometry); Map.addLayer(images, rgb_viz, 'True Color L8'); Map.addLayer(images, rgb_viz1, 'False Color L8'); Map.addLayer(images7, rgb_viz, 'True Color L7'); Map.addLayer(images7, rgb_viz1, 'False Color L7'); Begin 9 may 2018.

  22. False color image compared to true image Landsat 8 (april 2015

  23. Landsat 7 April 2000

  24. sediment identification by histogram analysis The histograms were generated in Earth Engine for the Caribbean Sea. The near infrared level is similar, the B,G,R levels are higher where sediments are suspended in water. B R G N Water with sediments Water without sediments

  25. Distinction of water covered areas from land areas • Modifying the bands used for the false images we can distinguish water covered areas better from land areas. • This can be accomplished by using the bands N and either one of B,G,R.

  26. Calculate the difference between the two dates • Operations: select Landsat 7 and landsat 8 as in previous excersize, apply a reducer to obtain two single images, then calculate the difference between the two images. At last map the difference image, taking care of the muchsmallervalues, so you must adjust the color-scale accordingly.

  27. var landsat8 = ee.ImageCollection("LANDSAT/LC08/C01/T1_SR"); var landsat7 = ee.ImageCollection("LANDSAT/LE07/C01/T1_SR"); //var landsat8 = ee.ImageCollection("LANDSAT/LC8_L1T_TOA"); //landsat7 = ee.ImageCollection("LANDSAT/LE7_L1T_TOA"); varrgb_viz = {min:0, max:1500, bands:['R','G','B']}; var rgb_viz1 = {min:0, max:1500, bands:['B','G','N']}; var images = landsat8.select(['B2','B3','B5','B4'], ['B','G','N','R']); var images7 = landsat7.select(['B1','B2','B4','B3'], ['B','G','N','R']); var geometry = /* color: 0000ff */ee.Geometry.Point([-75, 11]); images = images.filterDate('2015-04-01', '2015-04-06'); images = images.filterBounds(geometry); images7 = images7.filterDate('2000-04-01', '2000-12-30'); images7 = images7.filterBounds(geometry); varimagesmin = images.min(); var images7min = images7.min(); // calculate normalized difference index between blue and near infrared. Image collection must be reduced before. varndvi = imagesmin.normalizedDifference(['B', 'N']); varndwi_viz = {min:-0.4, max:0.4, palette:'black,green'}; // calculate difference between situation in 2015 and 2000. You must reduce image collection before. var diff = imagesmin.subtract(images7min); Map.setCenter(-75,11, 10); Map.addLayer(diff, {bands: ['B', 'G', 'N'], min: -500, max: 500}, 'difference'); Map.addLayer(ndvi, ndwi_viz, 'ndvi'); Map.addLayer(images, rgb_viz, 'True Color L8','false'); Map.addLayer(images, rgb_viz1, 'False Color L8','false'); Map.addLayer(images7, rgb_viz, 'True Color L7','false'); Map.addLayer(images7, rgb_viz1, 'False Color L7','false');

  28. Difference in false colors. Purple area in oceanicmarks the change in suspendedsedimentdensity

  29. Script 11 Distinguish water from land covered areas var landsat8 =ee.ImageCollection("LANDSAT/LC8_L1T_TOA"); varrgb_viz = {min:0, max:0.3, bands:['R','G','B']}; var rgb_viz1 = {min:0, max:0.3, bands:['B5','B6','B7']}; var images = landsat8.select(['B2','B3','B5','B4'], ['B','G','N','R']); varimages_water = landsat8.select(['B5','B6','B7']); var geometry = ee.Geometry.MultiPoint([12, 45,14,46]); images = images.filterDate('2015-04-01', '2015-04-30'); images = images.filterBounds(geometry); images_water = images_water.filterDate('2015-04-01', '2015-04-30'); images_water = images_water.filterBounds(geometry); Map.addLayer(images, rgb_viz, 'True Color L8'); Map.addLayer(images_water.min(), rgb_viz1, 'False Color L8');

  30. Laguna Grado- false colors Landsat8

  31. Script 12 Birth of an Island • Between September and October 2013 in the Red Sea an Island was born. This can be well seen in the Landsat 8 images. To enhance the signal we display both the true color and the false color image before and after the appearance of the island. • The approximate coordinate of the area of interest is the following: Long 42.1367,15.0960 • Reference: http://www.nature.com/ncomms/2015/150526/ncomms8104/pdf/ncomms8104.pdf

  32. var landsat8 =ee.ImageCollection("LANDSAT/LC8_L1T_TOA"), geometry = /* color: ffc82d */ee.Geometry.Point([42.136688232421875, 15.095991084505304]); • varrgb_viz = {min:0, max:0.3, bands:['R','G','B']}; • var rgb_viz1 = {min:0, max:0.3, bands:['B5','B6','B7']}; • var images = landsat8.select(['B2','B3','B5','B4'], ['B','G','N','R']); • var images1 = landsat8.select(['B2','B3','B5','B4'], ['B','G','N','R']); • varimages_water = landsat8.select(['B5','B6','B7']); • var images_water1 = landsat8.select(['B5','B6','B7']); • var geometry = ee.Geometry.Point([42,15]); • images1 = images1.filterDate('2013-04-01', '2013-07-01'); • images1 = images1.filterBounds(geometry); • images = images.filterDate('2013-11-1', '2013-12-30'); • images = images.filterBounds(geometry); • images_water1 = images_water1.filterDate('2013-08-01', '2013-09-11'); • images_water1 = images_water1.filterBounds(geometry); • images_water = images_water.filterDate('2013-11-1', '2013-12-30'); • images_water = images_water.filterBounds(geometry); • Map.addLayer(images1.min(), rgb_viz, 'before'); • Map.addLayer(images.min(), rgb_viz, 'after'); • Map.addLayer(images_water1, rgb_viz1, 'False Color before'); • Map.addLayer(images_water, rgb_viz1, 'False Color after');

  33. Island birth in Red Sea BEFORE AFTER images.filterDate('2013-11-1', '2013-12-30'); images1.filterDate('2013-04-01', '2013-07-01'); Landsat 8. Bands 'B5','B6','B7

  34. Script 13 • Select images defined by a boundary. Adapt boundary to your needs. Change coordinates of map-center accordingly. • Here the boundary is a geometric form.

  35. Script 13 • // Filteranimagecollectionby date and regiontomake a • // median pixel composite. • // • // Seealso: ClippedComposite, whichcrops the output image • // insteadoffiltering the input collection. • // Filtertoonly include imageswithin the colorado and utahboundaries. • varpolygon = ee.Geometry.Polygon([[ • [-109.05, 37.0], [-102.05, 37.0], [-102.05, 41.0], // colorado • [-109.05, 41.0], [-111.05, 41.0], [-111.05, 42.0], // utah • [-114.05, 42.0], [-114.05, 37.0], [-109.05, 37.0]]]); • // Create a Landsat 7 composite forSpringof 2000, and filterby • // the boundsof the FeatureCollection. • varcollection = ee.ImageCollection('LE7_L1T') • .filterDate('2000-04-01', '2000-07-01') • .filterBounds(polygon); • // Select the median pixel. • varmedian = collection.median(); • // Select the red, green and bluebands. • varresult = median.select('B3', 'B2', 'B1'); • Map.addLayer(result, {gain: '1.4, 1.4, 1.1'}); • Map.setCenter(-110, 40, 5);

  36. Script 14 Create a feature collection and average values. • Create a Polygon and a rectangle. • In the intersectionof the twochange the color on the map.

  37. Script 14 Rectangle and Triangle • // ExampleofFeatureCollection.reduceToImage() • // Define a featurecollectionwith a valuewewanttoaverage. • varfc = newee.FeatureCollection([ • ee.Feature( • ee.Geometry.Rectangle( • -122.4550, 37.8035, • -122.4781, 37.7935), • {'value': 0}), • ee.Feature( • ee.Geometry.Polygon([ • [-122.4427, 37.8027], • [-122.4587, 37.7987], • [-122.4440, 37.7934]]), • {'value': 1}) • ]); • // Reduce the collectiontoanimage, whereeach pixel • // is the meanof the 'value' property in allfeatures • // intersectingthat pixel. • varimage_reduced = fc.reduceToImage(['value'], 'mean'); • Map.setCenter(-122.4561, 37.7983, 14); • Map.addLayer(image_reduced, { • min: 0, • max: 1, • palette: ['008800', '00FF00']});

  38. Script 16 - Cycle through Landsat Images over the same spot • Scope is to select landsat images through time on the same spot, using the first image of successive Landsat missions

  39. Script 16 - Cycle through Landsat Images over the same spot • // Compare MSS imagesfrom L1 through L5 • varsfPoint = ee.Geometry.Point(-122.223, 37.892); • Map.setCenter(-122.223, 37.892, 10); //varsfPoint = ee.Geometry.Point(13.,45.3); thisforimagescenteredcloseto Trieste //Map.setCenter(13,45.3, 10); • for (var i = 1; i <= 5; ++i) { • varcollection = ee.ImageCollection('LM' + i + '_L1T'); • varimage = ee.Image(collection.filterBounds(sfPoint).first()); • vartoa = ee.Algorithms.Landsat.TOA(image); • var date = ee.Date(image.get('system:time_start')).format('MMM yyyy'); • varbands = (i <= 3) ? ['B6', 'B5', 'B4'] : ['B2', 'B3', 'B1']; • // Thisisoneof the rare placeswhereweneedtousegetInfo() in the • // middle of a script, sincelayernamesmustbe client-side strings. • varlabel = 'Landsat' + i + ' (' + date.getInfo() + ')'; • Map.addLayer(toa, {bands: bands, min: 0, max: 0.4}, label); • }

  40. Script 16b- as before with display time variation on chart • // Compare MSS images from L1 through L5 • var sfPoint = ee.Geometry.Point(-122.223, 37.892); • Map.setCenter(-122.223, 37.892, 10); • //var sfPoint = ee.Geometry.Point(13.,45.3); this for images centered close to Trieste • //Map.setCenter(13,45.3, 10); • for (var i = 1; i <= 5; ++i) { • var collection = ee.ImageCollection('LM' + i + '_L1T'); • var image = ee.Image(collection.filterBounds(sfPoint).first()); • var toa = ee.Algorithms.Landsat.TOA(image); • var date = ee.Date(image.get('system:time_start')).format('MMM yyyy'); • var bands = (i <= 3) ? ['B6', 'B5', 'B4'] : ['B2', 'B3', 'B1']; • // This is one of the rare places where we need to use getInfo() in the • // middle of a script, since layer names must be client-side strings. • var label = 'Landsat' + i + ' (' + date.getInfo() + ')'; • Map.addLayer(toa, {bands: bands, min: 0, max: 0.4}, label); • if (i < 3) { • print(Chart.image.series(collection.select('B6'), sfPoint)); • } else { • print(Chart.image.series(collection.select('B3'), sfPoint)); • } • }

  41. Some explanations of script 16 for (var i = 1; i <= 5; ++i) { // thistorepeat the followinglines 5 times. varcollection = ee.ImageCollection('LM' + i + '_L1T'); //thistochangenameofcollection varimage = ee.Image(collection.filterBounds(sfPoint).first()); vartoa = ee.Algorithms.Landsat.TOA(image); // apply a correctiontothese crude images. TOA is top of Atmosphere var date = ee.Date(image.get('system:time_start')).format('MMM yyyy'); //find date of the selectedimage varbands = (i <= 3) ? ['B6', 'B5', 'B4'] : ['B2', 'B3', 'B1']; //forlandsat 1 to 3, usebands B6,B5;B4, else use B3,B2,B1 (seenextpagefordocu on landsat1) // Thisisoneof the rare placeswhereweneedtousegetInfo() in the // middle of a script, sincelayernamesmustbe client-side strings. varlabel = 'Landsat' + i + ' (' + date.getInfo() + ')'; //prepare the label including the date Map.addLayer(toa, {bands: bands, min: 0, max: 0.4}, label); }

  42. Landsat1 documentation • Multispectral Scanner (MSS) • 80-meter ground resolution in four spectral bands: • Band 4 Visible green (0.5 to 0.6 µm) • Band 5 Visible red (0.6 to 0.7 µm) • Band 6 Near-Infrared (0.7 to 0.8 µm) • Band 7 Near-Infrared (0.8 to 1.1 µm) • Six detectors for each spectral band provided six scan lines on each active scan • Ground Sampling Interval (pixel size): 57 x 79 m

  43. The bandsof the MSS sensor on Landsat 1-5 • https://landsat.usgs.gov/what-are-band-designations-landsat-satellites

  44. Script 17 Trend of lithtime- find areas that have expanded the most • Checkdefinitionof the imagecollection: ImageCollection IDNOAA/DMSP-OLS/NIGHTTIME_LIGHTS • Itgivesyearlystablelighttimeneartogloballybetween 1992 and 2014 from the analysisof satellite thermalinfraredimaging. It can beusedtocalculate the linear trend of the intensityof night time. Foreach pixel a linearfunctionisfitted, definedby the slope and intercept. In earthengine the twoquantities are termed “scale” and “offset” and are feededintotwoimagebands. These can bemappedeachsingularlyby a grey-toneimage, or together in the color imageof the script.

  45. Script 17 Compute trend of lightime globally. • // Compute the trend ofnighttimelightsfrom DMSP. • // Add a band containingimage date asyearssince 1991. • functioncreateTimeBand(img) { • varyear = ee.Date(img.get('system:time_start')).get('year').subtract(1991); • returnee.Image(year).byte().addBands(img); • } • // Fit a linear trend to the nighttimelightscollection. • varcollection = ee.ImageCollection('NOAA/DMSP-OLS/NIGHTTIME_LIGHTS') • .select('stable_lights') • .map(createTimeBand); • varfit = collection.reduce(ee.Reducer.linearFit()); • // Display a single image • Map.setCenter(30, 45, 4); • Map.addLayer(ee.Image(collection.select('stable_lights').first()), • {min: 0, max: 63}, • 'stablelights first asset'); • // Display trend in red/blue, brightness in green. • Map.addLayer(fit, • {min: 0, max: [0.18, 20, -0.18], bands: ['scale', 'offset', 'scale']}, • 'stablelights trend');

  46. Some examples presented at the EGU 2017 in vienna. • https://medium.com/google-earth/a-golden-age-for-earth-observation-f8b281cec4b7 • Exercize: write the scripts for these examples.

  47. Projects of students for final exam year 2016 Ermes zoccolan: ultimi 20 anni su ghiacciai delle Alpi Nicola bruzzese: indice NDVI per osservare i parchi urbani nelle grandi citta’= isole di calore Riccardo minetto: Analisi termica di zona da definire Rudy Conte: indice NDVI nella valle dell’Indo in Pakistan, area desertica Marco Bartola: presenza di metano in Adriatico, se possibile. Oppure Espansione della cementificazione Giulia Areggi: analisi termica in zona vulcanica Gaia Travan: Analisi multispettrale laghi per inquinamento Elisa Venturini: analisi dei sedimenti del Volga in Mar Caspio. Oppure slope analisi di topografia SRTM in area alpina. Andrea Geniram: variazione di paesaggio in zone colpite da incendi.

  48. Script 18 Sentinel 1- RADAR imaging • The exercize proposes to map the SAR image of a selected area exploiting the full polarizations available inSentinel1. The script selects a pedemunt area of the South eastern Alps, in an active seismic area, with active reverse faulting at the transition between Friuli basin and the Pedemountains. The area hosts the temporary gas storage and extraction of Susegana. • http://rete-collalto.crs.inogs.it/

  49. // Load the Sentinel-1 ImageCollection. • var sentinel1 = ee.ImageCollection('COPERNICUS/S1_GRD'); • var geometry = ee.Geometry.Point([12.19,45.97]); • // Filter by metadata properties. • varvh = sentinel1 • // Filter to get images with VV and VH dual polarization. • .filter(ee.Filter.listContains('transmitterReceiverPolarisation', 'VV')) • .filter(ee.Filter.listContains('transmitterReceiverPolarisation', 'VH')) • // Filter to get images collected in interferometric wide swath mode. • .filter(ee.Filter.eq('instrumentMode', 'IW')); • // Filter to get images from different look angles. • varvhAscending = vh.filter(ee.Filter.eq('orbitProperties_pass', 'ASCENDING')); • varvhDescending = vh.filter(ee.Filter.eq('orbitProperties_pass', 'DESCENDING')); • // Create a composite from means at different polarizations and look angles. • //var composite = ee.Image.cat([ • // vhAscending.select('VH').mean(), • // ee.ImageCollection(vhAscending.select('VV').merge(vhDescending.select('VV'))).mean(), • // vhDescending.select('VH').mean() • //]).focal_median(); • var composite = ee.Image.cat([ • vhAscending.select('VH').mean(), • vhAscending.select('VV').mean(), • vhDescending.select('VH').mean() • ]).focal_median(); • // next as example to select one single polarisation • varVVasc = vhAscending.select('VV').mean(); • varVHasc = vhAscending.select('VH').mean(); • // Display as a composite of polarization and backscattering characteristics. • Map.addLayer(composite, {min: [-25, -20, -25], max: [0, 10, 0]}, 'composite'); • // Display the senglepolarisation • Map.addLayer(VVasc, {min: -25, max: 0}, 'VVasc'); • Map.addLayer(VHasc, {min: -25, max: 0}, 'VHasc'); • Map.centerObject(geometry, 11);

  50. SAR VV polarization ascending pass

More Related