Refactor TabulatedRatingCurve / time
updating
#1976
Labels
tech-debt
Improvements related to technical debt
TabulatedRatingCurve / time
updating
#1976
TabulatedRatingCurve and Subgrid are the two LinearInterpolations that can be updated over time. For both we currently only support instantaneous updates.
TabulatedRatingCurve was done first in #165, and the unprocessed time table is read during initialization, after which the callback (
update_tabulated_rating_curve!
) searches the sorted table for the right data. From this a LinearInterpolation is created which is put into the model struct. This callback runs each time new data appears, which is precomputed.The Subgrid update from #1975 was done differently, which is more in line with the way we update the other dynamic data. We process the tables into interpolation objects at initialization time, then use these to lookup the right data at runtime. Note that there is a double lookup. First we use the subgrid ID and time to look up what the h(h) is, and then use that to look up the h.
We should probably refactor
TabulatedRatingCurve / time
handling to be more likeBasin / subgrid_time
. One thing to consider is that this setup only supports instantaneous updating of relations. For now there is no need yet to support gradually changing relations over time, though there were reports of convergence issues isQ(h)
relations get changed a lot over time, so eventually we may need time-smoothing in addition to #1919. It would need to work with a different number of data points in the LinearInterpolation over time, and DataInterpolations.jl is currently restricted to 1D.The text was updated successfully, but these errors were encountered: