In [1]:
Copied!
import rioxarray as rxr
import geopandas as gpd
import matplotlib.pyplot as plt
from streamkit import flow_accumulation_workflow, delineate_subbasins
import rioxarray as rxr
import geopandas as gpd
import matplotlib.pyplot as plt
from streamkit import flow_accumulation_workflow, delineate_subbasins
OMP: Info #276: omp_set_nested routine deprecated, please use omp_set_max_active_levels instead.
In [2]:
Copied!
streams = rxr.open_rasterio("data/sample_streams.tif", masked=True).squeeze()
dem = rxr.open_rasterio("data/sample_dem.tif", masked=True).squeeze()
streams = rxr.open_rasterio("data/sample_streams.tif", masked=True).squeeze()
dem = rxr.open_rasterio("data/sample_dem.tif", masked=True).squeeze()
In [3]:
Copied!
conditioned_dem, flow_directions, flow_accumulation = flow_accumulation_workflow(dem)
conditioned_dem, flow_directions, flow_accumulation = flow_accumulation_workflow(dem)
In [4]:
Copied!
subbasins = delineate_subbasins(streams, flow_directions, flow_accumulation)
subbasins = delineate_subbasins(streams, flow_directions, flow_accumulation)
In [5]:
Copied!
fig, ax = plt.subplots()
conditioned_dem.plot(ax=ax)
subbasins.plot(ax=ax, alpha=0.3)
fig, ax = plt.subplots()
conditioned_dem.plot(ax=ax)
subbasins.plot(ax=ax, alpha=0.3)
Out[5]:
<matplotlib.collections.QuadMesh at 0x16384ab10>