Skip to content

Commit

Permalink
doing only sort in post process
Browse files Browse the repository at this point in the history
  • Loading branch information
gtramonte committed Jul 17, 2024
1 parent a528242 commit 6e14a4a
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions drivers/intake_geokube/afm.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,13 @@


def postprocess_afm(dset: xr.Dataset) -> xr.Dataset:
latitude = dset['lat'].values
longitude = dset['lon'].values
dset = dset.drop('lat')
dset = dset.drop('lon')
dset = dset.drop('certainty')
return dset.expand_dims(dim={"lat": latitude, "lon": longitude}, axis=(1, 0)).sortby('time')
#latitude = dset['lat'].values
#longitude = dset['lon'].values
#dset = dset.drop('lat')
#dset = dset.drop('lon')
#dset = dset.drop('certainty')
#return dset.expand_dims(dim={"lat": latitude, "lon": longitude}, axis=(1, 0)).sortby('time')
return dset.sortby('time')


class CMCCAFMSource(GeokubeSource):
Expand Down Expand Up @@ -54,7 +55,7 @@ def __init__(

def _open_dataset(self):
self._kube = DataCube.from_xarray(
#postprocess_afm(
postprocess_afm(
open_datacube(
path=self.path,
id_pattern=self.field_id,
Expand All @@ -63,6 +64,6 @@ def _open_dataset(self):
mapping=self.mapping,
**self.xarray_kwargs,
).to_xarray()
#)
)
)
return self._kube

0 comments on commit 6e14a4a

Please sign in to comment.