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

support nearest-neighbour in in lake rating curve tables (hq) #419

Open
shartgring opened this issue May 18, 2024 · 0 comments
Open

support nearest-neighbour in in lake rating curve tables (hq) #419

shartgring opened this issue May 18, 2024 · 0 comments

Comments

@shartgring
Copy link
Collaborator

Feature type

Adding new functionality

Improvement Description

Currently, lake outflow dtermined by a rating curve table (hq) uses linear interpolation. A nearest-neighbour approach would be of added value when a discrete outflow regime is defined (in clear 'steps', see for example this image: https://wiki.bluemodel.org/images/d/de/Theorie_Abb5.gif).

Implementation Description

The outflow is calculated in:

if lake.outflowfunc[i] == 1
            outflow =
                interpolate_linear(lake.waterlevel[i], lake.hq[i].H, lake.hq[i].Q[:, doy])
            outflow = min(outflow, storage_input)

Would it be possible to replace interpolate_linear by a generic calculate_lake_outflow function which get assigned during initialization of the lake? Depending on the model configuration, interpolation or nearest neighbour can be used. This could be set either as a setting in the [model] section (preserving backward compatibility) or through an extra layer in the staticmaps (much larger impact on existing models)

Additional Context

Good to note: this behaviour is also possible in the current situation with linear interpolation by defining extra lines in the hq-table to 'force' this discrete behaviour. Still, it might be interesting to consider the support of a nearest-neighbour approach, especially when this functionality is used to simulate reservoirs using the lake module. Also consider the discussion in #353

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant