Skip to content

Commit

Permalink
fix post process function was using wrong dataset dimensions
Browse files Browse the repository at this point in the history
  • Loading branch information
gtramonte committed Jul 19, 2024
1 parent 56fd4bb commit 04cc64b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/intake_geokube/afm.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ def postprocess_afm(ds: xr.Dataset, post_process_chunks) -> xr.Dataset:
ds = ds.drop('lon')
ds = ds.drop('certainty')
deduplicated = ds.expand_dims(dim={"latitude": latitude, "longitude": longitude}, axis=(1, 0))
for dim in ds.dims:
for dim in deduplicated.dims:
indexes = {dim: ~deduplicated.get_index(dim).duplicated(keep='first')}
deduplicated = deduplicated.isel(indexes)
return add_projection(deduplicated.sortby('time').chunk(post_process_chunks))
return add_projection(deduplicated.sortby('time').sortby('latitude').sortby('longitude').chunk(post_process_chunks))

def add_projection(dset: xr.Dataset, **kwargs) -> xr.Dataset:
"""Add projection information to the dataset"""
Expand Down

0 comments on commit 04cc64b

Please sign in to comment.