Skip to content

Commit

Permalink
debug
Browse files Browse the repository at this point in the history
  • Loading branch information
konstntokas committed Nov 26, 2024
1 parent feb0f4d commit ed962cd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
5 changes: 2 additions & 3 deletions xcube_stac/accessor.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,11 @@ def open_data(
"The parameter tile_size is set to (1024, 1024), which is the "
"native chunk size of the jp2 files in the Sentinel-2 archive."
)
file_path = f"{access_params["root"]}/{access_params["fs_path"]}"
if is_valid_ml_data_type(data_type) or opener_id.split(":")[0] == "mldataset":
return Jp2MultiLevelDataset(file_path, **open_params)
return Jp2MultiLevelDataset(access_params["fs_path"], **open_params)
else:
return rioxarray.open_rasterio(
file_path,
access_params["fs_path"],
chunks=dict(x=1024, y=1024),
band_as_variable=True,
)
Expand Down
6 changes: 3 additions & 3 deletions xcube_stac/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -416,10 +416,10 @@ def get_data_access_params(self, item: pystac.Item, **open_params) -> dict:
for asset_name in asset_names:
protocol = "file"
href_components = item.assets[asset_name].href.split("/")
root = href_components[1]
instrument = href_components[2]
root = ""
instrument = href_components[4]
format_id = MAP_CDSE_COLLECTION_FORMAT[instrument]
fs_path = "/".join(href_components[2:])
fs_path = "/".join(href_components)
storage_options = {}
data_access_params[asset_name] = dict(
name=asset_name,
Expand Down

0 comments on commit ed962cd

Please sign in to comment.