Skip to content

Instantly share code, notes, and snippets.

@willrayeo
Last active May 5, 2021 11:41
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/ce53888a9e060b200e7c5e6e476a6a56 to your computer and use it in GitHub Desktop.
Save willrayeo/ce53888a9e060b200e7c5e6e476a6a56 to your computer and use it in GitHub Desktop.
# define the timestep you wish to export
timestep = flood_threshold2_step2.sel(time='2020-12-28 10:00:00', method='nearest')
# define projection
timestep_wgs84 = timestep.rio.write_crs("epsg:4326")
# write to raster
timestep_wgs84.rio.to_raster("flood_extent_20201228.tif")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment