Skip to content

Commit

Permalink
log final stream number
Browse files Browse the repository at this point in the history
  • Loading branch information
rileyhales committed Dec 21, 2023
1 parent 3605f14 commit c0443bf
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
10 changes: 10 additions & 0 deletions run_5_global_geometry.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import geopandas as gpd
import pandas as pd
import glob
import os
import natsort


gpq = natsort.natsorted(glob.glob('/Volumes/T9Hales4TB/geoglows2/tdxhydro-inputs/*/*geoparquet'))
gdf = pd.concat([gpd.read_parquet(g).simplify() for g in gpq])
print(gpq)
2 changes: 2 additions & 0 deletions tdxhydrorapid/inputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,8 @@ def rapid_master_files(streams_gpq: str,
sgdf.loc[sgdf[id_field].isin(list(nx.ancestors(G, term_node)) + [term_node, ]), 'TerminalLink'] = term_node
sgdf['TerminalLink'] = sgdf['TerminalLink'].astype(int)

logger.info(f'Final Stream Count: {sgdf.shape[0]}')

if cache_geometry:
logger.info('\tWriting altered geometry to geopackage')
region_number = sgdf['TDXHydroRegion'].values[0]
Expand Down

0 comments on commit c0443bf

Please sign in to comment.