SCALE-Analysis
Loading...
Searching...
No Matches
Namespaces | Functions | Variables
Sonde.py File Reference

Namespaces

namespace  Sonde
 ゾンデデータ取得・描画
 

Functions

 ll2dist (lat1, lon1, lat2, lon2)
 

Variables

bool savefig = True
 
str dir_out = "./fig/"
 
bool by_target_pos = True
 
float lon0 = 139.7671248
 
float lat0 = 35.6812362
 
bool by_target_name = not by_target_pos
 
str tname = "潮岬"
 
int year = 2007
 
int month = 7
 
int day = 15
 
int hour = 9
 
 jstdatetime = datetime.datetime(year,month,day,hour)
 
 utcdatetime = jstdatetime-datetime.timedelta(hours=9)
 
str datatype0 = "hourly"
 
dict varnamedic = {"気圧(hPa)":"PRES (hPa)", "ジオポテンシャル 高度(m)" : "Z (m)" , "気温(℃)":"TEMP (℃)", "相対湿度(%)":"RH (%)", "風速(m/s)":"WSPD (m/s)","風向(°)":"WDIR (°)"}
 
str url = "https://www.data.jma.go.jp/obd/stats/etrn/upper/select/prefecture.php?year=&month=&day=&hour=&atm=&point="
 
 html = urllib.request.urlopen(url)
 
 soup = BeautifulSoup(html, 'html.parser')
 
 elements = soup.find_all('area')
 
list station_etc_list = []
 
list station_list = []
 
list station_link_list = []
 
list station_lat_list = [float(etc.split("javascript:viewPoint(")[1].split(",")[3][1:-1]) + float(etc.split("javascript:viewPoint(")[1].split(",")[4][1:-1])/60 for etc in station_etc_list]
 
list station_lon_list = [float(etc.split("javascript:viewPoint(")[1].split(",")[5][1:-1]) + float(etc.split("javascript:viewPoint(")[1].split(",")[6][1:-1])/60 for etc in station_etc_list]
 
 lat = np.array(station_lat_list)
 
 lon = np.array(station_lon_list)
 
 dist = ll2dist(lat0,lon0,lat,lon)
 
 argmin_dist = np.argmin(dist)
 
 station_index = argmin_dist
 
list station = station_list[station_index]
 
list station_link = station_link_list[station_index]
 
list lon_target = station_lon_list[station_index]
 
list lat_target = station_lat_list[station_index]
 
str datatype = datatype0 + "_usp.php?"
 
 fig
 
 ax
 
 figsize
 
 s
 
 table = pd.read_html(url)
 
 df = table[1]
 
 collist = df.columns
 
list varlist = []
 
 var = df[col].values
 
list pres = varlist[0]
 
list z = varlist[1]
 
 time_target = jstdatetime.strftime("%Y-%m-%d %H hrs")
 
 marker
 
str flabel = f"Sonde_{varnamedic[col].split(' ')[0]}_{time_target.replace(' ','_')}_lon{lon_target}_lat{lat_target}_{station}"