00:49:33 西藏日喀則市 M4.8, 30.46N 87.76E, 深度 11Km, 距離台灣3381Km, 波速=3381/12/60=4.7Km/s, 低於一般波速, 因此特別紀錄之
最大訊號 Mw=4.4 發生於:2018-10-23 01:02:11
Mw>=3.9 持續時間: 2018-10-23 01:02:11 ~ 2018-10-23 01:10:01
Mw>=4.2 持續時間: 2018-10-23 01:02:11 ~ 2018-10-23 01:02:16
2018年10月22日 星期一
2018年10月15日 星期一
2018.10.01~10.15 RMT訊號
10/03 13時, 15時, 無對應地震
10/04 10時起, 康芮颱風靠近, 東北角連續訊號
10/08 11~13時, 疑為13:45日本硫磺島M4.9臨震訊號
10/08 13:45日本硫磺島M4.9, 造成東北方強烈訊號, 可能與10/10 17:43宜蘭M4.4有關
10/15 5~7時, 可能與07:33 印尼M4.3有關
10/15 15~20時, 未出震
原始圖檔在此下載
10/04 10時起, 康芮颱風靠近, 東北角連續訊號
10/08 11~13時, 疑為13:45日本硫磺島M4.9臨震訊號
10/08 13:45日本硫磺島M4.9, 造成東北方強烈訊號, 可能與10/10 17:43宜蘭M4.4有關
10/15 5~7時, 可能與07:33 印尼M4.3有關
10/15 15~20時, 未出震
原始圖檔在此下載
[Python] 從中央氣象局下載地震活動彙整列表
氣象局網站的 地震活動彙整 列表, 檢視網頁內容, 真正資料網頁連結為 https://scweb.cwb.gov.tw/Page.aspx/?ItemId=20&loc=tw&adv=1, 因為是ASP網頁, 所以需先取出ASP的傳遞參數, 資料表格之 class 為 datalist4, 使用 BeautifulSoup 即可取出表格內容
|
# -*- coding: utf-8 -*-
"""
Created on Sun Oct 15 11:53:25 2018
@author: ghosty
@Program: cwbweb_list.py
@Prupose: download quake data from CWB
web source: https://www.cwb.gov.tw/V7/earthquake/rtd_eq.htm
"""
import requests
from bs4 import BeautifulSoup
#import dateutil
def downloadCWBweb(year,month):
url =
'https://scweb.cwb.gov.tw/Page.aspx/?ItemId=20&loc=tw&adv=1'
agent = 'Mozilla/5.0 (Windows NT 6.3; WOW64; rv:34.0) Gecko/20100101
Firefox/34.0'
headers = {'Content-type': 'application/x-www-form-urlencoded',
'Accept':
'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
'User-Agent': agent}
payload = {
'__VIEWSTATE':'',
'__VIEWSTATEGENERATOR':'',
'__VIEWSTATEENCRYPTED':'',
'__EVENTVALIDATION':'',
'ctl03_ddlYear':'',
'ctl03_ddlMonth':'',
'ctl03_btnSearch':''
}
response1 = requests.post(url)
if response1.status_code !=
requests.codes.ok:
print("CWB requesr fail")
return
soup = BeautifulSoup(response1.text, "lxml")
payload['__VIEWSTATE']=soup.find('input',id='__VIEWSTATE')['value']
payload['__VIEWSTATEGENERATOR']=soup.find('input',id='__VIEWSTATEGENERATOR')['value']
payload['__VIEWSTATEENCRYPTE']=soup.find('input',id='__VIEWSTATEENCRYPTED')['value']
payload['__EVENTVALIDATION']=soup.find('input',id='__EVENTVALIDATION')['value']
payload['ctl03$ddlYear']="{:4d}".format(year)
payload['ctl03$ddlMonth']="{:0>2d}".format(month)
payload['ctl03$btnSearch']=''
response2 = requests.post(url,data=payload, headers=headers)
soup2 = BeautifulSoup(response2.text, "lxml")
table = soup2.find('table', attrs={'class':'datalist4'})
rows = table.find_all('tr')
quakeData = []
for row in rows:
cols = row.find_all('td')
cols = [item.text.strip() for item in cols]
if (len(cols)>0): #skip empty row
quakeData.append([item for item
in cols if item]) # Get rid of empty values
return quakeData
quakeData = downloadCWBweb(2018,8)
for data in quakeData:
print(data)
|
2018年10月14日 星期日
啟用地震資料自動匯入比對系統
為了避免人工失誤與主觀因素, 從USGS下載資料, 自動匯入動態圖檔的功能, 已經啟用. 這個功能是先從USGS下載所有地理位置資料, 將英文地名翻譯成中文, 建立一個地理字典來做的, 由於常發生的位置很固定, 所以字典的數量並不多, 目前只建立約1000筆資料, 未來可以慢慢加強. 產生的資訊會根據方位來顯示, 總共有12個方向,每個方位只顯示震度最大的那一個. 根據經驗, 排除距離太遠且震度太小的地震:
之前以訊號尋找對應出震的方式, 無法看出遠方地震的影響程度, 現在不論有無訊號皆會顯示, 可看出該地點於該時間的影響程度有多少.
(1)距離>3000且震度<4.5
(2)距離>6000且震度<5
(3)距離>9000且震度<6
(4(前一個小時地震時間與小時開始的時間秒數差>距離/6的秒數 (合理的波速)
(4(前一個小時地震時間與小時開始的時間秒數差>距離/6的秒數 (合理的波速)
之前以訊號尋找對應出震的方式, 無法看出遠方地震的影響程度, 現在不論有無訊號皆會顯示, 可看出該地點於該時間的影響程度有多少.
2018年10月7日 星期日
[Python] 從USGS下載地震資料
為了分析地震地點的地理名稱, 使用Python語言, 從USGS下載地震資料存成文字檔. 因 USGS 使用逗點作為分隔, 因此這裡使用 $ 錢號來做輸出資料區隔, 以避免資料混淆, 亦可匯入 excel 進行整理. 輸出資料有兩個欄位, 第一個是原始地震資料來源, 第二個是擷取的地點名稱, 打算做連續地點關聯性分析, 以及加上自動翻譯為中文, 作為資料與動畫分析時自動匯入使用
|
# -*- coding: utf-8 -*-
"""
Created on Sun Oct 7 11:53:25 2018
@author: ghosty
@Program: usus_location_list.py
@Prupose: download USGS data and analyze
the quake location name for
(1) location relation analysis
(2) translation from English to Traditional Chinese, used for AI
analysis tool development
"""
import csv
import requests
import os.path
import datetime
#import dateutil
from dateutil.relativedelta import
relativedelta
#init global variables
locFileName = 'usgs_loc.txt'
locationList=[]
quakeList=[]
#
def downloadUSGS(starttime, endtime,
minmagnitude, maxmagnitude):
#,latitude=121.1,longitude=23.5,maxradiuskm=20000):
url = 'http://earthquake.usgs.gov/fdsnws/event/1/query'
query = {
'format': 'csv',
'starttime': starttime,
'endtime': endtime,
'minmagnitude': '5',
'eventtype':'earthquake'
}
response = requests.get(url, params=query)
if response.status_code !=
requests.codes.ok:
print("USGS requesr fail")
return
#print("encoding: %s" % response.encoding)
quakeList = list(csv.reader(response.text.split('\n'), delimiter=','))
header=quakeList[0]
#time,latitude,longitude,depth,mag,magType,nst,gap,dmin,rms,net,id,updated,place,type,horizontalError,depthError,magError,magNst,status,locationSource,magSource
quakeList.pop(0) #remove header line
print('USGS download #',len(quakeList))
return quakeList, header
def addLocation(quakeData):
for quake in quakeData:
#print('quake:',quake)
if (len(quake)==0): #skip null record
continue
quakeTime = quake[0]
quakeLatitude = quake[1]
quakeLongitude = quake[2]
quakeDepth = quake[3]
quakeMag = quake[4]
quakeMagType = quake[5]
quakePlace = quake[13]
#print(quakeTime, quakeLatitude, quakeLongitude, quakeDepth, quakeMag,
quakeMagType, quakePlace)
locs = quakePlace.split(',')
#print(locs) #debug for 2013-02-01
for loc in locs:
try:
ofPos = loc.find(" of
") #do not usr 'of' only to
prevent error
if (ofPos>0):
loc=loc[ofPos+4:]
#loc.replace("the
","")
loc.replace("the
","")
#loc.strip() #remove space,
strip() fail to use
while (loc[0]==' '):
loc=loc[1:]
if (loc not in locationList):
quake = '{0} {1} {2} {3}
{4} {5} {6}'.format(quakeTime, quakeLatitude, quakeLongitude, quakeDepth,
quakeMag, quakeMagType, quakePlace)
print("Add
[",loc, '] from [',quake,']')
quakeList.append(quake)
locationList.append(loc)
#print(len(quakeList),len(locationList))
except:
#source data error
print('parse fail:
',quakeTime, quakeLatitude, quakeLongitude, quakeDepth, quakeMag,
quakeMagType, quakePlace)
def saveLocation(locationList,
locFileName):
#print(len(locationList))
print("export ",len(locationList)," locations")
with open(locFileName, 'w') as locfile:
for i in
range(len(locationList)):
locfile.write('\"'+str(quakeList[i]) + '\"$\"' +
str(locationList[i]) + '\"\n')
def loadLocation(locationList,
locFileName):
if (os.path.exists(locFileName)):
with open (locFileName, 'r') as locfile:
for line in locfile:
quakeData =
line.strip().split('$')
quakeList.append(quakeData[0].strip('\"'))
locationList.append(quakeData[1].strip('\"'))
print("import
",len(locationList)," locations")
#------main()--------
# Load processed location data
loadLocation(locationList,
locFileName)
#for all date
dt1 = datetime.date(1900, 1, 1)
#end_dt =
datetime.date(2000, 1, 31)
end_dt =
datetime.date.today()
while (dt1<end_dt): # in
daterange(start_dt, end_dt):
"""
# if there are too many records at one download, reduce the download
period
if (dt1 < datetime.date(2018, 1, 1)):
delta_dt = relativedelta(years=1)
else:
delta_dt =
relativedelta(months=1)
"""
delta_dt = relativedelta(years=1)
dt2 = dt1 + delta_dt
print("\nProcessing...",dt1.strftime("%Y-%m-%d"),"~",dt2.strftime("%Y-%m-%d"))
quakeDATA, header = downloadUSGS(dt1, dt2, 4.0, 10)
addLocation(quakeDATA)
dt1 = dt2
#save processed result
saveLocation(locationList, locFileName)
|
訂閱:
文章 (Atom)


