Skip to content

Commit

Permalink
STY: remove gzip
Browse files Browse the repository at this point in the history
  • Loading branch information
jklenzing committed Oct 30, 2023
1 parent ebe4d53 commit e2ad89f
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions pysatNASA/instruments/methods/cdaweb.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
"""

import datetime as dt
import gzip
import numpy as np
import os
import pandas as pds
Expand Down Expand Up @@ -600,7 +599,7 @@ def get_file(remote_file, data_path, fname, temp_path=None, zip_method=None):
temp_path : str
Path to temporary directory. (Default=None)
zip_method : str
The method used to zip the file. Supports 'gzip', 'zip', and None.
The method used to zip the file. Supports 'zip' and None.
If None, downloads files directly. (default=None)
"""
Expand All @@ -617,13 +616,7 @@ def get_file(remote_file, data_path, fname, temp_path=None, zip_method=None):
open_f.write(remote_file)

# Unzip and move the files from the temporary directory.
if zip_method == 'gzip':
local_fname = os.path.join(data_path, fname).replace('.gz', '')
with gzip.open(dl_fname) as open_zip:
with open(local_fname, 'wb') as open_f:
open_f.write(open_zip.read())

elif zip_method == 'zip':
if zip_method == 'zip':
with zipfile.ZipFile(dl_fname, 'r') as open_zip:
open_zip.extractall(data_path)

Expand Down

0 comments on commit e2ad89f

Please sign in to comment.