s1_gee.js 2.3 KB
/* -----------------------------------------------------------------------------------------------------------------------
Sentinel 1 download from Google Earth Engine
Author: Michel Le Page, CESBIO/IRD 
Version: 0.1, Feb. 2016

First you have to ask Google an access to Google Earth Engine, they should give you access within 1 or 2 days.
then you create your javascript code with https://code.earthengine.google.com

The first thing is to choose the area to download: use the polygon tool to draw the area you are interested in.
it will create a new object in the code called "geometry"

Click on run.

It will create a graph in the console and several tasks.
Run each of those tasks manually, and it will save the images on your google drive.
Finally, download the files from google drive to your computer.

The exported files are georeferenced subsets of each S1 image in GeoTIFF at 20m spatial resolution. The three bands are VH, VV and angle.
The projection in this code is  EPSG:4326 (geographic lat-lon), you can look for other projections at http://spatialreference.org/

A CSV table resuming what has been selected is also created.

----------------------------------------------------------------------------------------------------------------------- */

var start = new Date("02/05/2015");		// The first date
var end = new Date(Date.now());			// The last date

var s1 = ee.ImageCollection('COPERNICUS/S1_GRD')		// The product to download. It is the same technique for landsat L8T
      .filterDate(start, end)
      //.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'))
      .filterBounds(geometry);

var count = s1.size().getInfo();

for (var i = 0; i < count ; i++) {
  var img = ee.Image(s1.toList(1, i).get(0));
  var geom = img.geometry().getInfo();
  Export.image(img, img.get('system:index').getInfo(), {
    'scale': 20,
    'crs': 'EPSG:4326',
    'region': geometry.toGeoJSONString()
});
}

Export.table(s1,'Sentinel1_csv');

print(Chart.image.seriesByRegion(s1, geometry, ee.Reducer.mean(),'VH')
.setOptions({title: 'VH mean value over time on R3'}));?