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

nudged value added in return #644

Merged
merged 1 commit into from
Sep 12, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 29 additions & 1 deletion src/troute-routing/troute/routing/fast_reach/mc_reach.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -748,4 +748,32 @@ cpdef object compute_network_structured(
#do the same for the upstream_array
output_upstream = np.asarray(upstream_array[:,1:,:], dtype='float32')
#return np.asarray(data_idx, dtype=np.intp), np.asarray(flowveldepth.base.reshape(flowveldepth.shape[0], -1), dtype='float32')
return np.asarray(data_idx, dtype=np.intp)[fill_index_mask], output.reshape(output.shape[0], -1)[fill_index_mask], 0, (np.asarray([data_idx[usgs_position_i] for usgs_position_i in usgs_positions]), np.asarray(lastobs_times), np.asarray(lastobs_values)), (usgs_idx, usgs_update_time-((timestep-1)*dt), usgs_prev_persisted_ouflow, usgs_prev_persistence_index, usgs_persistence_update_time-((timestep-1)*dt)), (usace_idx, usace_update_time-((timestep-1)*dt), usace_prev_persisted_ouflow, usace_prev_persistence_index, usace_persistence_update_time-((timestep-1)*dt)), output_upstream.reshape(output.shape[0], -1)[fill_index_mask], (rfc_idx, rfc_update_time-((timestep-1)*dt), rfc_timeseries_idx)
return (
np.asarray(data_idx, dtype=np.intp)[fill_index_mask],
output.reshape(output.shape[0], -1)[fill_index_mask],
0,
(
np.asarray([data_idx[usgs_position_i] for usgs_position_i in usgs_positions]),
np.asarray(lastobs_times),
np.asarray(lastobs_values)
),
(
usgs_idx,
usgs_update_time-((timestep-1)*dt),
usgs_prev_persisted_ouflow,
usgs_prev_persistence_index,
usgs_persistence_update_time-((timestep-1)*dt)
),
(
usace_idx, usace_update_time-((timestep-1)*dt),
usace_prev_persisted_ouflow,
usace_prev_persistence_index,
usace_persistence_update_time-((timestep-1)*dt)
),
output_upstream.reshape(output.shape[0], -1)[fill_index_mask],
(
rfc_idx, rfc_update_time-((timestep-1)*dt),
rfc_timeseries_idx
),
np.asarray(nudge)
)