Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unzip hdf5 files into one directory instead of many #63

Merged
merged 2 commits into from
Jun 8, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion icepyx/core/granules.py
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,10 @@ def download(self, verbose, path, session=None, restart=False):
# #Note: extract the dataset to save it locally
# if extract is True:
with zipfile.ZipFile(io.BytesIO(zip_response.content)) as z:
z.extractall(path)
for zfile in z.filelist:
# Remove the subfolder name from the filepath
zfile.filename = os.path.basename(zfile.filename)
z.extract(member=zfile, path=path)

# update the current finished order id and save to file
with open(downid_fn,'w') as fid:
Expand Down