Update spaceweather.py

solve the issue that download fails for spaceweather file on windows platform.
This commit is contained in:
Chunxiao Li 2020-05-26 20:43:40 +08:00 committed by GitHub
parent 410daa4def
commit bb27aeada6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -16,7 +16,8 @@ get_sw - Extract the space weather data
import numpy as np
from datetime import datetime,timedelta
from os import getenv,path,makedirs,remove
from os import path,makedirs,remove
from pathlib import Path
from urllib.request import urlretrieve
# =================== download and update sw data =================== #
@ -48,7 +49,7 @@ def download_sw(direc=None):
'''
if direc is None:
home = getenv('HOME')
home = str(Path.home())
direc = home + '/src/sw-data/'
swfile = direc + 'SW-All.txt'