How to mask the cyan (flooded urban area) using the sentinel-1/flood_mapping

Hi all,

Could you please give me help to mask the cyan (flooded urban area) in using the script of S1 flood detection ? (Flood Mapping With Sentinel-1 Script)

The code only give a script for masking the red pixel with a threshold of 0.05, but I am very interested in the cyan (potentienl flooded urban area), want to know how to mask it?

// ************************************
// mask creation
// var dout = outbe - outdu;
// return [dout > 0.05 ? 1 : 0]
// ************************************

I am a freshmen in using sentinelhub and have no idea about how to adress it, hope can get your help, many thanks!

Jiangchao

Hi @qiujch24 ,

The cyan parts are represented by the variable outdu in the script. So you could mask them out with the following:

if (outdu > threshold){
  // Make a mask if you need it later
  var cyanMask = 1
  // Return black instead of cyan (removing values for the cyan pixels)
  return [0,0,0]
 }
// Return the other pixels as normal
return [outbe,outdu,outdu]

As you can see there is an undefined variable called threshold in the snippet above: you will have to experiement with the value that suits you. Around 0.3 seems to work for the example script, but you might want to fine-tune it to match what you are looking for.