diff --git a/pyatmos/msise/spaceweather.py b/pyatmos/msise/spaceweather.py index 034dcf2..809e054 100644 --- a/pyatmos/msise/spaceweather.py +++ b/pyatmos/msise/spaceweather.py @@ -6,7 +6,7 @@ from ..utils.try_download import wget_download -def download_sw_nrlmsise00(direc=None): +def download_sw_nrlmsise00(direc=None, url = 'https://celestrak.com/spacedata/SW-All.csv'): ''' Download or update the space weather data from www.celestrak.com @@ -29,7 +29,7 @@ def download_sw_nrlmsise00(direc=None): direc = home + '/src/sw-data/' swfile = direc + 'SW-All.csv' - url = 'https://www.celestrak.com/SpaceData/SW-All.csv' + if not path.exists(direc): makedirs(direc) if not path.exists(swfile): @@ -104,7 +104,7 @@ def get_sw(sw_df,t_ymd,hour): f107A,f107,ap = sw_df.iloc[j]['F10.7_OBS_CENTER81'],sw_df.iloc[j+1]['F10.7_OBS'],sw_df.iloc[j]['AP_AVG'] aph_tmp_b0 = sw_df.iloc[j]['AP1':'AP8'] i = int(np.floor_divide(hour,3)) - ap_c = aph_tmp_b0[i] + ap_c = aph_tmp_b0[f'AP{i+1}'] aph_tmp_b1 = sw_df.iloc[j+1]['AP1':'AP8'] aph_tmp_b2 = sw_df.iloc[j+2]['AP1':'AP8'] aph_tmp_b3 = sw_df.iloc[j+3]['AP1':'AP8'] @@ -114,4 +114,4 @@ def get_sw(sw_df,t_ymd,hour): aph_1233 = np.average(aph_tmp[apc_index+4:apc_index+12]) aph_3657 = np.average(aph_tmp[apc_index+12:apc_index+20]) aph = np.hstack((ap,aph_c369,aph_1233,aph_3657)) - return f107A,f107,ap,aph \ No newline at end of file + return f107A,f107,ap,aph