Skip to content

Commit

Permalink
first tiff changes
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexDo1 committed Oct 18, 2023
1 parent 57bd0f0 commit cdd41cd
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions metacatalog/ext/io/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ class IOExtensionInterface(MetacatalogExtensionInterface):
an interface class can be defined for each Entry and data-source,
data-type and metadata-specific operations can be executed from
a common interface.
"""
READER = dict(
internal={
Expand Down
16 changes: 16 additions & 0 deletions metacatalog/ext/io/reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,4 +114,20 @@ def read_from_local_netcdf(entry, datasource, **kwargs):
data = xr.open_mfdataset(f"{fname}/*", engine=engine)

return data


def read_from_local_tiff(entry, datasource, **kwargs):
# check validity
assert Entry.is_valid(entry)

# get the filename
fname = datasource.path

# check if fname is a folder
if os.path.isdir(fname):
# get all files in the folder
fnames = glob.glob(f"{fname}/*")
else:
# get the filename
fnames = [fname]

0 comments on commit cdd41cd

Please sign in to comment.