1

I need to get a reasonable Sentinel 2 Surface reflectance using Google Earth Engine, I tried but the values are between 10000 - 0

var ReflectTimeSeries = ui.Chart.image.seriesByRegion({
  imageCollection: temps2013,
  regions: westernRegions,
  reducer: ee.Reducer.mean(),
  scale: 1,
  xProperty: 'system:time_start',
  seriesProperty: 'label'
});

ReflectTimeSeries.setChartType('LineChart');
ReflectTimeSeries.setOptions({
  title: 'Sentinel 2 band values at three points near Potsdam City',
  hAxis: {
    title: 'Time Series'
  },
  vAxis: {
    title: 'Reflectance (intensity)',
    Divide : 10000
  },
  lineWidth: 1,
  pointSize: 4,
  series: {
    0: {color: COLOR.PARK},
    1: {color: COLOR.FARM},
    2: {color: COLOR.URBAN}
  }
});
2

if you go through the documentation for Sentinel-2 MSI: MultiSpectral Instrument, Level-2A, it will show you that the bands have been scaled. There is scale of each band mentioned but for most of the standard bands that you want to work with it is 0.0001

so if you want red, green and blue bands you can essentially select those bands and rescale them using multiplication with scale.

var scaled = sentinel2image.select(['B4','B3','B2']).multiply(0.0001)

Of course you could divide by 10000 as well but I prefer multiply because then I can use the numbers mentioned in the documentation without having to do the mental math however easy that may be.

Now, as you want to apply this to all the images in the imagecollection you can use the map function in a similar way. However, for graphs you want to preserve the properties of the image, especially the system:time_start. For this you will need to copy the properties of original image onto the new rescaled image using copyProperties function.

var rescale = function(image){
  var rescaledImage = image.multiply(0.0001);
  return rescaledImage.copyProperties(image, image.propertyNames());
}

s2 = s2.map(rescale)

A working example can be seen here

  • 1
    But multiply() is not available for imageCollection, you need to use map(). How you keep metadata with this? system:time_start must be preserved for graphical purposes – aldo_tapia Jun 3 at 16:53
  • you can preserve the original image details within the map by using copyProperties. I will edit my answer to incorporate that. – Nishanta Khanal Jun 3 at 17:13
  • yes, now your answer is complete. Well done – aldo_tapia Jun 3 at 18:42
-1

If you want reflectance value, then you need to do the atmospheric correction using Sen2cor to change DN value to reflectance value. I think (0 - 10000) value is DN value.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.