Created
May 4, 2021 10:41
-
-
Save willrayeo/d16883edbef5ac8dce62938176ca775a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# assign all pixels equal or smaller than -20 a value of 1 and preserve the values of pixels | |
step1 = s1_cube.VV_dB.where(s1_cube.VV_dB >= -20, 1) | |
# assign all other pixels a value of 0. | |
flooded = step1.where(step1 == 1, 0) | |
flooded.attrs['long_name']='flooded' | |
flooded.attrs['units']='nounits' | |
s1_cube['flooded']= flooded |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment