Skip to content

Commit

Permalink
enable override of grid postfixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jornbr committed Sep 27, 2024
1 parent 2e4be11 commit 065557b
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions python/pygetm/domain.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,17 @@ class Grid(_pygetm.Grid):
}
domain: "Domain"

postfixes = {
_pygetm.TGRID: "t",
_pygetm.UGRID: "u",
_pygetm.VGRID: "v",
_pygetm.XGRID: "x",
_pygetm.UUGRID: "_uu_adv",
_pygetm.VVGRID: "_vv_adv",
_pygetm.UVGRID: "_uv_adv",
_pygetm.VUGRID: "_vu_adv",
}

def __init__(
self,
domain: "Domain",
Expand All @@ -177,16 +188,7 @@ def __init__(
self.ioffset = ioffset
self.joffset = joffset
self.overlap = overlap
self.postfix = {
_pygetm.TGRID: "t",
_pygetm.UGRID: "u",
_pygetm.VGRID: "v",
_pygetm.XGRID: "x",
_pygetm.UUGRID: "_uu_adv",
_pygetm.VVGRID: "_vv_adv",
_pygetm.UVGRID: "_uv_adv",
_pygetm.VUGRID: "_vu_adv",
}[grid_type]
self.postfix = self.postfixes[grid_type]
self.ugrid: Optional[Grid] = ugrid
self.vgrid: Optional[Grid] = vgrid
self._sin_rot: Optional[np.ndarray] = None
Expand Down

0 comments on commit 065557b

Please sign in to comment.