I'm trying to download a Sentinel-2 OSAVI time-series from GEE. My workflow is as follows:
// Load Sentinel-2 ImageCollection
var s2RawData = ee.ImageCollection("COPERNICUS/S2_SR")
.filterDate('2018-09-01', '2018-09-10')
.filterBounds(geometry);
// Generate 'clear_sky' Sentinel-2 images using SCL.
var s2ClearSky = function(image) {
var scl = image.select('SCL');
var clearSkyPixels = scl.eq(4).or(scl.eq(5)).or(scl.eq(6)).or(scl.eq(11));
return image.updateMask(clearSkyPixels);
};
var s2Data = s2RawData.map(s2ClearSky);
// Compute OSAVI.
var addSpectralIndices = function(image){
// Sentinel-2 bands
var s2Bands =
{'BLUE': image.select('B2').divide(10000),
'GREEN': image.select('B3').divide(10000),
'RED': image.select('B4').divide(10000),
'NIR': image.select('B8').divide(10000),
'SWIR1': image.select('B11').divide(10000),
'SWIR2': image.select('B12').divide(10000)};
// OSAVI equation
var osavi = image.expression('(NIR-RED)/(NIR+RED+0.16)*(1+0.16)', s2Bands).rename('OSAVI');
// Add spectral index
var newBands = ee.Image([osavi]);
return image.addBands(newBands);
};
var s2DataSi = s2Data.map(addSpectralIndices);
// Select OSAVI band
var s2DataIn = s2DataSi.select(['OSAVI']);
// Create Sentinel-2 stack
var s2DataCube = s2DataIn.toBands();
print(s2DataCube);
// Download stack to drive
Export.image.toDrive({
image: s2DataCube,
description: 'S2_OSAVI_TS_test2',
region: geometry,
fileFormat: 'GeoTIFF',
scale: 10
});
However, when I open my image into ArcMap I get an empty image with NA values.