-
Notifications
You must be signed in to change notification settings - Fork 11
River Network form
Rose Pearson edited this page Dec 13, 2022
·
6 revisions
The River Bed estimation process relies on a river network that contains relational information relating reaches to each other and flow and friction information per reach.
The river environment classification networks published in Aotearoa New Zealand were used to inform the expected form of a network file. These can be read in as a geopandas.GeoDataFrame
with columns including:
- reach ID - this is unique to each reach
- catchment area - the upstream catchment area
- to_node - the upstream network 'node' associated with the reach
- from_node - the downstream network 'node' associate with the reach
A reach friction and flow value is also expected for each reach. These should be added to the networks as additional columns. Where:
- flow - the mean annual flow per reach
- friction - the Manning's n friction per reach.
Code for cleaning up REC1 and also combining it with a CSV of flows and frictions and reach ids.
rec1 = geopandas.read_file(r"path\to\rec1.shp")
flow_and_friction = pandas.read_csv(r"path\to\bathy_dn1.csv.gz")
network_flow_and_friction = rec1[rec1['NZREACH'].isin(flow_and_friction['nzreach'])]
network_flow_and_friction = network_flow_and_friction.drop(columns=['LENGTH','CLIMATE', 'GEOLOGY', 'DISTSEA','SHAPE_LENG', 'ORDER1', 'PS_FLOW', 'LC_NATIVE', 'LC_EXOTIC','LC_TUSSOCK', 'LC_SCRUB', 'LC_PASTURE', 'LC_WATER', 'LC_URBAN','PAST_BEEF', 'PAST_DAIRY', 'PAST_DEER', 'PAST_DRY', 'PAST_GRAZE','PAST_SHEEP', 'PAST_MIXED', 'APATITE', 'LC_DRAIN1', 'LC_DRAIN2', 'LC_DRAIN3', 'LC_DRAIN4', 'LC_DRAIN5', 'LC_DRAIN', 'RAIN', 'SLOPE', 'flow_lps', 'Flow_T'])
network_flow_and_friction = network_flow_and_friction .astype({'NZREACH': 'int64'})
network_flow_and_friction = network_flow_and_friction .sort_values(by=['NZREACH'])
network_flow_and_friction = network_flow_and_friction .reset_index(drop=True)
flow_and_friction = flow_and_friction.sort_values(by=['nzreach'])
flow_and_friction = flow_and_friction.reset_index(drop=True)
network_flow_and_friction [['nzreach', 'n', 'flow']] = flow_and_friction
network_flow_and_friction ['NZREACH']==network_flow_and_friction ['nzreach']
network_flow_and_friction =network_flow_and_friction .to_crs(2193)
network_flow_and_friction .to_file('path\to\rec1_flow_and_friction.shp')