Update spaceweather.py
solve the issue that download fails for spaceweather file on windows platform.
This commit is contained in:
		
							parent
							
								
									410daa4def
								
							
						
					
					
						commit
						bb27aeada6
					
				| @ -16,7 +16,8 @@ get_sw      - Extract the space weather data | |||||||
| 
 | 
 | ||||||
| import numpy as np | import numpy as np | ||||||
| from datetime import datetime,timedelta | 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 | from urllib.request import urlretrieve | ||||||
| 
 | 
 | ||||||
| # =================== download and update sw data  =================== # | # =================== download and update sw data  =================== # | ||||||
| @ -48,7 +49,7 @@ def download_sw(direc=None): | |||||||
|     ''' |     ''' | ||||||
|      |      | ||||||
|     if direc is None: |     if direc is None: | ||||||
|         home = getenv('HOME') |         home = str(Path.home()) | ||||||
|         direc = home + '/src/sw-data/' |         direc = home + '/src/sw-data/' | ||||||
|      |      | ||||||
|     swfile = direc + 'SW-All.txt' |     swfile = direc + 'SW-All.txt' | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user