0

I want to rescale the Landsat-8 SR image using the rescale factor in the documentation, which is 0.0001 for each band. I assume that the original values are DN values, and after rescaling I can get reflectance values (Is it right?). After applying the rescaling factor the image only shows 0 values. I am also using a .int16() to keep it as an integer, but it does not work. It seems that I am missing some steps in this process.

This is the code:

// Landsat 8 - Image
var image = ee.Image("LANDSAT/LC08/C01/T1_SR/LC08_016039_20190107");

// Rescale image
var rescale = image.divide(10000).int16()

//RGB color palette
var rgbVis = {
  min: 0,
  max: 2000,
  bands: ['B4', 'B3', 'B2'],
};
var rgbVis2 = {
  min: 0,
  max: 0.2,
  bands: ['B4', 'B3', 'B2'],
};

// Add to map
Map.centerObject(rescale)
Map.addLayer(image, rgbVis, 'Original');
Map.addLayer(rescale, rgbVis, 'Rescaled');

Link to the code editor: https://code.earthengine.google.com/abb6f59a90864368dd462e3267072834

1

You can examine individual pixel values in the Earth Engine Code Editor by selecting the Inspector tab in the top right, and then clicking somewhere on the map. This shows us:

Pixels
  Original: Image (12 bands)
    B1: 115
    B2: 111
    B3: 69
    B4: 12
    B5: -9
    B6: 9
    B7: 9
    B10: 2896
    B11: 2885
    sr_aerosol: 68
    pixel_qa: 324
    radsat_qa: 0
  Rescaled: Image (12 bands)
    B1: 0
    B2: 0
    B3: 0
    B4: 0
    B5: 0
    B6: 0
    B7: 0
    B10: 0
    B11: 0
    sr_aerosol: 0
    pixel_qa: 0
    radsat_qa: 0

Dividing 115 by 10000 produces a value of 0.0115, and converting that to integer rounds it down to 0. You must not convert to integer if you want a useful result. So, delete the .int16().

Then, there appears to be a simple typo in your script: you wrote

Map.addLayer(rescale, rgbVis, 'Rescaled');

but you need to use your rgbVis2 instead for this layer.

Putting it all together, this displays the Original and Rescaled images equivalently:

var image = ee.Image("LANDSAT/LC08/C01/T1_SR/LC08_016039_20190107");
var rescale = image.divide(10000);
var rgbVis = {
  min: 0,
  max: 2000,
  bands: ['B4', 'B3', 'B2'],
};
var rgbVis2 = {
  min: 0,
  max: 0.2,
  bands: ['B4', 'B3', 'B2'],
};
Map.centerObject(rescale);
Map.addLayer(image, rgbVis, 'Original');
Map.addLayer(rescale, rgbVis2, 'Rescaled');

https://code.earthengine.google.com/def15e97fb2485a64308c5294c015a2b

Note: I am not familiar with the proper interpretation of Landsat images; this answer is entirely based on general principles of using Earth Engine.

1
  • Thank you Kevin. That worked! However, I still believe these values are not real reflectance values, they are very low and some bands have negative values, before and after scaling. It seems these values are stil DN values and not reflectance as the documentation says. This is a thread where Rodrigo Principe briefly explained about this behaviour on Landsat 8 Raw scenes (LANDSAT/LC08/C01/T1), which is similar to what I see on this collection (LANDSAT/LC08/C01/T1_SR): gis.stackexchange.com/questions/304180/…. – Luis Lizcano Sep 8 '20 at 13:57

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.