We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9ae3b4e commit f786056Copy full SHA for f786056
sarsen/scene.py
@@ -82,7 +82,7 @@ def transform_dem_3d(
82
return dem_3d_crs
83
84
85
-def upsample(
+def upsample_coords(
86
data: xr.DataArray, dtype: str | None = None, **factors: int
87
) -> xr.DataArray:
88
coords = {}
@@ -93,6 +93,13 @@ def upsample(
93
stop = coord[-1].values + coord_delta / 2 - coord_delta / factor / 2
94
values = np.linspace(start, stop, num=coord.size * factor, dtype=dtype)
95
coords[dim] = values
96
+ return coords
97
+
98
99
+def upsample(
100
+ data: xr.DataArray, dtype: str | None = None, **factors: int
101
+) -> xr.DataArray:
102
+ coords = upsample_coords(data, dtype, **factors)
103
return data.interp(coords, kwargs={"fill_value": "extrapolate"})
104
105
0 commit comments