Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove mask filter for natural cross sections #564

Closed
wants to merge 16 commits into from
9 changes: 0 additions & 9 deletions src/troute-network/troute/nhd_network_utilities_v02.py
Original file line number Diff line number Diff line change
Expand Up @@ -845,15 +845,6 @@ def build_refac_connections(diff_network_parameters):

# set parameter dataframe index as segment id number, sort
param_df = param_df.set_index("key").sort_index()

# get and apply domain mask
if "mask_file_path" in diff_network_parameters:
data_mask = nhd_io.read_mask(
pathlib.Path(diff_network_parameters["mask_file_path"]),
layer_string=diff_network_parameters.get("mask_layer_string", None),
)
data_mask = data_mask.set_index(data_mask.columns[0])
param_df = param_df.filter(data_mask.index, axis=0)

# There can be an externally determined terminal code -- that's this first value
terminal_codes = set()
Expand Down
6 changes: 5 additions & 1 deletion src/troute-nwm/src/nwm_routing/preprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,10 @@ def nwm_network_preprocess(
# ... dataframe returned from read_netcdf, then the code would break here.
topobathy_data = (nhd_io.read_netcdf(topobathy_file).set_index('link'))

# TODO: Request GID make comID variable an integer in their product, so
# we do not need to change variable types, here.
topobathy_data.index = topobathy_data.index.astype(int)

else:
topobathy_data = pd.DataFrame()
LOG.debug('No natural cross section topobathy data provided. Hybrid simualtion will run on compound trapezoidal geometry.')
Expand Down Expand Up @@ -478,7 +482,7 @@ def nwm_network_preprocess(
"No destination folder specified for preprocessing. Please specify preprocess_output_folder in configuration file. Aborting preprocessing routine"
)
quit()

return (
connections,
param_df,
Expand Down