Skip to content

Commit

Permalink
Changed the storage location in the data folder for the TAR file with…
Browse files Browse the repository at this point in the history
… the BT-Settl spectra
  • Loading branch information
Tomas Stolker committed Jul 31, 2020
1 parent b7325cb commit 152c60f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
7 changes: 3 additions & 4 deletions species/data/btsettl.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,22 +52,21 @@ def add_btsettl(input_path: str,
os.makedirs(input_path)

input_file = 'bt-settl.tgz'
label = '(130 MB)'

data_folder = os.path.join(input_path, 'bt-settl/')
data_file = os.path.join(data_folder, input_file)
data_file = os.path.join(input_path, input_file)

if not os.path.exists(data_folder):
os.makedirs(data_folder)

url = 'https://people.phys.ethz.ch/~ipa/tstolker/bt-settl.tgz'

if not os.path.isfile(data_file):
print(f'Downloading Bt-Settl model spectra {label}...', end='', flush=True)
print('Downloading Bt-Settl model spectra (130 MB)...', end='', flush=True)
urllib.request.urlretrieve(url, data_file)
print(' [DONE]')

print(f'Unpacking BT-Settl model spectra {label}...', end='', flush=True)
print('Unpacking BT-Settl model spectra (130 MB)...', end='', flush=True)
tar = tarfile.open(data_file)
tar.extractall(data_folder)
tar.close()
Expand Down
7 changes: 3 additions & 4 deletions species/data/btsettl_cifist.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,22 +52,21 @@ def add_btsettl(input_path: str,
os.makedirs(input_path)

input_file = 'bt-settl-cifist.tgz'
label = '(578 MB)'

data_folder = os.path.join(input_path, 'bt-settl-cifist/')
data_file = os.path.join(data_folder, input_file)
data_file = os.path.join(input_path, input_file)

if not os.path.exists(data_folder):
os.makedirs(data_folder)

url = 'https://people.phys.ethz.ch/~ipa/tstolker/bt-settl-cifist.tgz'

if not os.path.isfile(data_file):
print(f'Downloading Bt-Settl model spectra {label}...', end='', flush=True)
print('Downloading Bt-Settl model spectra (578 MB)...', end='', flush=True)
urllib.request.urlretrieve(url, data_file)
print(' [DONE]')

print(f'Unpacking BT-Settl model spectra {label}...', end='', flush=True)
print('Unpacking BT-Settl model spectra (578 MB)...', end='', flush=True)
tar = tarfile.open(data_file)
tar.extractall(data_folder)
tar.close()
Expand Down

0 comments on commit 152c60f

Please sign in to comment.