Skip to content

Commit

Permalink
feat: add scale and yoffset args to synthetic topography function
Browse files Browse the repository at this point in the history
  • Loading branch information
mdtanker committed May 7, 2024
1 parent ce88f1a commit 4801f33
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/invert4geom/synthetic.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ def synthetic_topography_simple(
spacing: float,
region: tuple[float, float, float, float],
registration: str = "g",
scale: float = 1,
yoffset: float = 0,
) -> xr.Dataset:
"""
Create a synthetic topography dataset with a few features.
Expand All @@ -72,6 +74,10 @@ def synthetic_topography_simple(
bounding edges of the grid in meters in format (xmin, xmax, ymin, ymax)
registration : str, optional
grid registration type, either "g" for gridline or "p" for pixel, by default "g"
scale : float, optional
value to scale the topography by, by default 1
yoffset : float, optional
value to offset the topography by, by default 0
Returns
-------
Expand Down Expand Up @@ -169,7 +175,11 @@ def synthetic_topography_simple(

topo = sum(features)

topo = topo + 1200
topo += 1200

topo = topo * scale

topo += yoffset

return vd.make_xarray_grid(
(x, y),
Expand Down

0 comments on commit 4801f33

Please sign in to comment.