Skip to content
Draft
Changes from all commits
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
8 changes: 4 additions & 4 deletions pyatmos/msise/spaceweather.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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):
Expand Down Expand Up @@ -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']
Expand All @@ -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
return f107A,f107,ap,aph