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

dataarray arguments for DRN, RIV package #214

Closed
tomvansteijn opened this issue Aug 2, 2023 · 2 comments · Fixed by #249
Closed

dataarray arguments for DRN, RIV package #214

tomvansteijn opened this issue Aug 2, 2023 · 2 comments · Fixed by #249
Assignees

Comments

@tomvansteijn
Copy link

The gwf.drn function allow one to enter a string or a xr.DataArray for the arguments elev and cond, according to the docs. However it seems that the coordinates are not respected when using DataArray's. The function da_to_reclist does handle a list of floats, it seems, but does not use the coordinates in the DataArray to index conform the model dataset. Thus rivers or drains may appear upside down or mirrored in the package data and in the model results.

The same may hold for the RIV or GHB packages.

@OnnoEbbens
Copy link
Collaborator

Yes I see the da_to_reclist does not take into account the coordinates of a DataArray. I assume this error occurs when you have ascending y-coordinates in the DataArray. Is that correct? In the previous versions we had some checks for this but they may be removed. I think the best way to handle this is to add some checks for this and maybe correct it. For now a quick fix would be to make sure the y-coordinates in your DataArray are in descending order.

@tomvansteijn
Copy link
Author

Yes indeed I had y-coordinates in ascending order. It is also possible to reindex the dataarray using the coordinates of the model dataset. In this way any mismatch between the model coordinates and the seperately provided dataarrays will become apparent.

@dbrakenhoff dbrakenhoff self-assigned this Aug 24, 2023
dbrakenhoff added a commit that referenced this issue Aug 25, 2023
- add RIV pkg #97
- fix mask checks in bc pkgs #213
- add check on dataarray coords #214
@dbrakenhoff dbrakenhoff linked a pull request Aug 25, 2023 that will close this issue
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

Successfully merging a pull request may close this issue.

3 participants