Skip to content

Commit

Permalink
check spatial coordinates in resample
Browse files Browse the repository at this point in the history
  • Loading branch information
ValentinaHutter committed Dec 9, 2024
1 parent 2ce855e commit 468790e
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions openeo_processes_dask/process_implementations/cubes/resample.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,15 +187,17 @@ def align_arrays(a, b, res):

x_data = resampled_data[resampled_data.openeo.x_dim[0]].values
x_target = target[target.openeo.x_dim[0]].values
resampled_data[resampled_data.openeo.x_dim[0]] = align_arrays(
x_target, x_data, target_resolution
)
if not (x_data == x_target).all():
resampled_data[resampled_data.openeo.x_dim[0]] = align_arrays(
x_target, x_data, target_resolution
)

y_data = resampled_data[resampled_data.openeo.y_dim[0]].values
y_target = target[target.openeo.y_dim[0]].values
resampled_data[resampled_data.openeo.y_dim[0]] = align_arrays(
y_target, y_data, target_resolution
)
if not (y_data == y_target).all():
resampled_data[resampled_data.openeo.y_dim[0]] = align_arrays(
y_target, y_data, target_resolution
)

return resampled_data

Expand Down

0 comments on commit 468790e

Please sign in to comment.