diff --git a/icepyx/__init__.py b/icepyx/__init__.py index b0cd8095d..8aba372f6 100644 --- a/icepyx/__init__.py +++ b/icepyx/__init__.py @@ -11,7 +11,6 @@ # work. warn(deprecation_msg, FutureWarning, stacklevel=2) - from _icepyx_version import version as __version__ from icepyx.core.query import GenQuery, Query diff --git a/icepyx/core/read.py b/icepyx/core/read.py index 71f84b810..aa2a5f37d 100644 --- a/icepyx/core/read.py +++ b/icepyx/core/read.py @@ -1,9 +1,9 @@ import glob import os import sys +import time # TODO Remove this at end import warnings -import earthaccess import numpy as np import xarray as xr @@ -590,8 +590,9 @@ def load(self): if file.startswith("s3"): # If path is an s3 path create an s3fs filesystem to reference the file # TODO would it be better to be able to generate an s3fs session from the Mixin? - s3 = earthaccess.get_s3fs_session(daac="NSIDC") - file = s3.open(file, "rb") + # s3 = earthaccess.get_s3fs_session(daac="NSIDC") + # file = s3.open(file, "rb") + file = file[5:] # Remove s3:// from filepath (h5coro's needed input) all_dss.append( self._build_single_file_dataset(file, groups_list) @@ -653,12 +654,13 @@ def _read_single_grp(self, file, grp_path): Xarray dataset with the specified group. """ - + print("using h5coro to read into xarray...") return xr.open_dataset( file, group=grp_path, - engine="h5netcdf", - backend_kwargs={"phony_dims": "access"}, + engine="h5coro", + credentials=self.s3login_credentials, + # backend_kwargs={"phony_dims": "access"}, ) def _build_single_file_dataset(self, file, groups_list): @@ -739,7 +741,7 @@ def _build_single_file_dataset(self, file, groups_list): wanted_groups_list = ["ancillary_data"] + sorted(wanted_groups_set) while wanted_groups_list: - # print(wanted_groups_list) + print(wanted_groups_list) grp_path = wanted_groups_list[0] wanted_groups_list = wanted_groups_list[1:] ds = self._read_single_grp(file, grp_path) @@ -770,7 +772,16 @@ def _build_single_file_dataset(self, file, groups_list): while wanted_groups_list: grp_path = wanted_groups_list[0] wanted_groups_list = wanted_groups_list[1:] + print( + "Starting group", + grp_path, + time.strftime("%Y-%m-%d %H:%M:%S", time.localtime(time.time())), + ) ds = self._read_single_grp(file, grp_path) + print( + "Finished group", + time.strftime("%Y-%m-%d %H:%M:%S", time.localtime(time.time())), + ) is2ds, ds = Read._add_vars_to_ds( is2ds, ds, grp_path, wanted_groups_tiered, wanted_dict )