Skip to content

Commit

Permalink
Merge pull request #287 from gwmod/286-bug-in-geotop-aggregate_to_ds
Browse files Browse the repository at this point in the history
286 bug in geotop aggregate to ds
  • Loading branch information
OnnoEbbens authored Nov 14, 2023
2 parents 91ad942 + e17085a commit 0452ff2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 0 additions & 1 deletion docs/examples/15_geotop.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,6 @@
"outputs": [],
"source": [
"# make sure there are no NaNs in top and botm of layers\n",
"regis = nlmod.layers.fill_top_and_bottom(regis)\n",
"regis = nlmod.read.geotop.aggregate_to_ds(gt, regis, kh=\"kh_gt\", kv=\"kv_gt\")"
]
},
Expand Down
5 changes: 4 additions & 1 deletion nlmod/read/geotop.py
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,10 @@ def aggregate_to_ds(
if "layer" in top.dims:
top = top[0].drop_vars("layer")
else:
top = ds["botm"][ilay - 1].drop_vars("layer")
if "layer" in ds["top"].dims:
top = ds["top"][ilay].drop_vars("layer")
else:
top = ds["botm"][ilay - 1].drop_vars("layer")
bot = ds["botm"][ilay].drop_vars("layer")

gt_top = (gt["z"] + 0.25).broadcast_like(gt[kh_gt])
Expand Down

0 comments on commit 0452ff2

Please sign in to comment.