Skip to content

Commit

Permalink
adding pattern handling for filters
Browse files Browse the repository at this point in the history
  • Loading branch information
gtramonte committed Jul 25, 2024
1 parent 00bf6a3 commit b5dea5c
Showing 1 changed file with 30 additions and 13 deletions.
43 changes: 30 additions & 13 deletions drivers/intake_geokube/afm.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,18 +69,35 @@ def __init__(
super(CMCCAFMSource, self).__init__(metadata=metadata)

def _open_dataset(self):
self._kube = DataCube.from_xarray(
postprocess_afm(
open_datacube(
path=self.path,
id_pattern=self.field_id,
metadata_caching=self.metadata_caching,
metadata_cache_path=self.metadata_cache_path,
mapping=self.mapping,
**self.xarray_kwargs,
# preprocess=self.preprocess
).to_xarray(),
self.postprocess_chunk
if self.pattern is None:
self._kube = DataCube.from_xarray(
postprocess_afm(
open_datacube(
path=self.path,
id_pattern=self.field_id,
metadata_caching=self.metadata_caching,
metadata_cache_path=self.metadata_cache_path,
mapping=self.mapping,
**self.xarray_kwargs,
# preprocess=self.preprocess
).to_xarray(),
self.postprocess_chunk
)
)
else:
self._kube = DataCube.from_xarray(
postprocess_afm(
open_dataset(
path=self.path,
pattern=self.pattern,
id_pattern=self.field_id,
metadata_caching=self.metadata_caching,
metadata_cache_path=self.metadata_cache_path,
mapping=self.mapping,
**self.xarray_kwargs,
# preprocess=self.preprocess
).to_xarray(),
self.postprocess_chunk
)
)
)
return self._kube

0 comments on commit b5dea5c

Please sign in to comment.