Skip to content

Instantly share code, notes, and snippets.

@willrayeo
Created May 4, 2021 13:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save willrayeo/263a49dd34113c2d26d8c0d59ecde6c4 to your computer and use it in GitHub Desktop.
Save willrayeo/263a49dd34113c2d26d8c0d59ecde6c4 to your computer and use it in GitHub Desktop.
flood_sum = s1_cube.flooded.sum(dim="time")
flood_count = s1_cube.flooded.count(dim="time")
flood_average = flood_sum/flood_count
flood_sum.attrs['long_name']='flood_sum'
flood_sum.attrs['units']='nounits'
s1_cube['flood_sum']= flood_sum
flood_average.attrs['long_name']='flood_average'
flood_average.attrs['units']='nounits'
s1_cube['flood_average']= flood_average
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment