Skip to content

Commit 948517d

Browse files
committed
fix: mask_output fvd aggregation
If a output_parameters->stream_output->mask_output file was configured, the flows, velocities, and depths written to disk are an erroneous mixture of flows, velocities, and depths. For example, the flow field for a given feature_id contains values for a mixture of aggregated flows, velocities, and depths. Not the expected flows. This patch corrects this behavior so the expected aggregated flows _and_ depths are written. However, I am not certain that velocities are correctly aggregated. I observed NAN values returned for aggregated velocities. The `optimized_v_data` subroutine needs to be checked to ensure velocity values are correctly aggregated.
1 parent 12a8eae commit 948517d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/troute-network/troute/nhd_io.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2336,6 +2336,9 @@ def optimized_agg(merge_flowveldepth_reset):
23362336
all_nex_data['Type'] = 'nex'
23372337
# Set the new 'Type' column as an index
23382338
all_nex_data = all_nex_data.set_index('Type', append=True)
2339+
2340+
# Reindex to (n, f), (n, v), (n, d), ...
2341+
all_nex_data = all_nex_data.reindex(flowveldepth.columns, axis=1)
23392342

23402343
else:
23412344
all_nex_data = pd.DataFrame()

0 commit comments

Comments
 (0)