Skip to content

Commit

Permalink
bugfix in merge on mesh
Browse files Browse the repository at this point in the history
  • Loading branch information
roeldegoede committed Mar 1, 2024
1 parent 6379e20 commit cf5ae11
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions hydromt_sfincs/workflows/merge.py
Original file line number Diff line number Diff line change
Expand Up @@ -340,9 +340,6 @@ def merge_multi_dataarrays_on_mesh(
)
uda_out = xu.UgridDataArray(da0, mesh2d)

# get extent of mesh
bbox = uda_out.ugrid.to_crs(4326).ugrid.total_bounds

# combine with next dataset
for i in range(0, len(da_list)):
merge_method = da_list[i].get("merge_method", "first")
Expand All @@ -355,6 +352,9 @@ def merge_multi_dataarrays_on_mesh(
reproj_method = da_list[i].get("reproj_method", resampling_method)
da = da_list[i].get("da")

# get extent of mesh
bbox = uda_out.ugrid.to_crs(da.raster.crs).ugrid.total_bounds

# clip before reproject
da = da.raster.clip_bbox(bbox, buffer=2)
if np.any(np.array(da.shape) <= 2):
Expand Down

0 comments on commit cf5ae11

Please sign in to comment.