Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
# 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