SCALE-Analysis
Loading...
Searching...
No Matches
Functions | Variables
Sonde Namespace Reference

ゾンデデータ取得・描画 More...

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}"
 

Detailed Description

ゾンデデータ取得・描画

指定した水平地点の近くのゾンデデータを取得し鉛直プロファイルを描画

Author
Tomoro Yanase, Team SCALE

Note

Function Documentation

◆ ll2dist()

ll2dist ( lat1,
lon1,
lat2,
lon2 )

Variable Documentation

◆ argmin_dist

argmin_dist = np.argmin(dist)

◆ ax

ax

◆ by_target_name

bool by_target_name = not by_target_pos

◆ by_target_pos

bool by_target_pos = True

◆ collist

collist = df.columns

◆ datatype

str datatype = datatype0 + "_usp.php?"

◆ datatype0

str datatype0 = "hourly"

◆ day

int day = 15

◆ df

df = table[1]

◆ dir_out

str dir_out = "./fig/"

◆ dist

dist = ll2dist(lat0,lon0,lat,lon)

◆ elements

elements = soup.find_all('area')

◆ fig

fig

◆ figsize

figsize

◆ flabel

str flabel = f"Sonde_{varnamedic[col].split(' ')[0]}_{time_target.replace(' ','_')}_lon{lon_target}_lat{lat_target}_{station}"

◆ hour

int hour = 9

◆ html

html = urllib.request.urlopen(url)

◆ jstdatetime

jstdatetime = datetime.datetime(year,month,day,hour)

◆ lat

lat = np.array(station_lat_list)

◆ lat0

float lat0 = 35.6812362

◆ lat_target

◆ lon

lon = np.array(station_lon_list)

◆ lon0

float lon0 = 139.7671248

◆ lon_target

◆ marker

marker

◆ month

int month = 7

◆ pres

list pres = varlist[0]

◆ s

s

◆ savefig

bool savefig = True

◆ soup

soup = BeautifulSoup(html, 'html.parser')

◆ station

list station = station_list[station_index]

◆ station_etc_list

list station_etc_list = []

◆ station_index

list station_index = argmin_dist

◆ station_lat_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]

◆ station_link

list station_link = station_link_list[station_index]

◆ station_link_list

list station_link_list = []

◆ station_list

list station_list = []

◆ station_lon_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]

◆ table

table = pd.read_html(url)

◆ time_target

time_target = jstdatetime.strftime("%Y-%m-%d %H hrs")

◆ tname

str tname = "潮岬"

◆ url

str url = "https://www.data.jma.go.jp/obd/stats/etrn/upper/select/prefecture.php?year=&month=&day=&hour=&atm=&point="

◆ utcdatetime

utcdatetime = jstdatetime-datetime.timedelta(hours=9)

◆ var

var = df[col].values

◆ varlist

list varlist = []

◆ varnamedic

dict varnamedic = {"気圧(hPa)":"PRES (hPa)", "ジオポテンシャル 高度(m)" : "Z (m)" , "気温(℃)":"TEMP (℃)", "相対湿度(%)":"RH (%)", "風速(m/s)":"WSPD (m/s)","風向(°)":"WDIR (°)"}

◆ year

int year = 2007

◆ z

list z = varlist[1]