Using the script available in this forum (belowlink), I tried for terrain correction (flattening) of Sentinel 1 images

Getting local incidence angle from Sentinel-1 GRD image collection in Google Earth Engine

Here is my working script.


Unfortunately, why the resulted gamma0dB is all white?

Could someone look at above link and solve it?

I really want to return terrain corrected (flattened) gamma0dB.

1 Answer 1


You can calculate gamma0 like this:

function toGamma0(image) {
  var gamma0 = image.expression('i - 10 * log10(cos(angle * pi / 180))', {
    i: image.select(['VV', 'VH']),
    angle: image.select('angle'),
    pi: Math.PI
  return image.addBands(gamma0, null, true)  


  • Your problem isn't gamma0 related. The terrain correction script expects images from COPERNICUS/S1_GRD, not COPERNICUS/S1_GRD_FLOAT. I'm curious why you're using the terrain correction script just to return gamma0 without actually doing any terrain correction. In any case, this should work for you: code.earthengine.google.com/f7aa86f93f119c3c7f89c0e2668fdfe1 Commented Mar 19, 2020 at 9:51
  • What was returned in the original terrain correction function you linked to in your question. code.earthengine.google.com/6c3fcaa8fbaff069c46389128b2ffc7c Commented Mar 19, 2020 at 9:59
  • select(['VV', 'VH', 'slope_1', 'slope_2'], ['VV', 'VH', 'layover', 'shadow']) selects 4 bands, 'VV', 'VH', 'slope_1', 'slope_2', and renames them to 'VV', 'VH', 'layover', 'shadow'. Btw, you might want to layover and shadow to mask your image. Commented Mar 19, 2020 at 10:44
  • Let us continue this discussion in chat.
    – mk1
    Commented Mar 19, 2020 at 11:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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