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

Improve split layers ds #156

Merged
merged 34 commits into from
Apr 11, 2023
Merged

Improve split layers ds #156

merged 34 commits into from
Apr 11, 2023

Conversation

rubencalje
Copy link
Collaborator

@rubencalje rubencalje commented Mar 29, 2023

This pull request started with improving the split_layers method, but on top of that other improvements were made as well:

  • fix gdf_to_bool_da for rotated grids
  • improve refine method for rotated grids
  • improve ds_to_ugrid_nc_file
  • removes output from tests
  • adds calculate_gxg from imod, so gxg can be calculated directly on vertex grids as well
  • removes dependency of imod for the generation of the documentation

now also works for other variables
now also works for vertex grids
split_dict can contain layer names as keys, and values do not have to add up to 1 anymore
split_reindexer in attrs contains layer names now
First splitted layer gets _1 suffix
Less code
For when da is in another crs
For when grid-refinement is used
Can now also read data from "kusthoogte" and "vaklodingen"
More options to get a specific time
fixes UserWarning: Transform that is non-rectilinear or with rotation found. Unable to recalculate.
And update some documentation
Also remove imod-dependency for generation of docs
@rubencalje rubencalje marked this pull request as ready for review April 5, 2023 11:19
@rubencalje
Copy link
Collaborator Author

This pull request is ready for review. Tests fail as the server of Riviereland is offline, and remaining codacy issue can be ignored.

"# use imod's calculate_gxg method to calculate the GHG\n",
"gxg = imod.evaluate.calculate_gxg(head_structured.sel(layer=\"HLc\"))\n",
"# use nlmod's calculate_gxg method to calculate the GVG, GLG and GHG.\n",
"gxg = nlmod.evaluate.calculate_gxg(head.sel(layer=\"HLc\"))\n",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Je kan de calculate_gxg functie ook in de gwf.output module zetten.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Modified in commit 2ca61f7

@@ -206,7 +206,7 @@ def extrapolate_ds(ds, mask=None):
return ds
if mask.all():
raise (Exception("The model only contains NaNs"))
if ds.gridtype == "vertex":
if "gridtype" in ds.attrs and ds.gridtype == "vertex":
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is de eerste check niet overbodig? Als de gridtype attribute niet aanwezig is in de ds krijg je nu een error bij het tweede deel ds.gridtype == "vertex" toch?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nevermind, ik wist niet dat het tweede deel van de and niet wordt uitgevoerd als het eerste deel al False is

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 this pull request may close these issues.

2 participants