A Python tool to download ground motion from PEER NGA database.
Make sure that you have installed Chrome.
-
Install Python package
$ pip install selenium $ pip install selenium-wire $ pip install requests
-
Download Chrome driver
Go to the document of selenium for more details.
driverPath = 'your chrome driver path'
web = PeerNGA(driverPath)
web.signIn('your_email', 'ypur_password')
Options: 'NGA West2', 'NGA East'
web.enterDB('NGA West2')
settings = {
'RSNs': '',
'Event Name': '',
'Station Name': '',
'Fault Type': '',
'Magnitude': '',
'R_JB': '',
'R_rup': '',
'Vs30': '',
'D5-95': '',
'Pulse': '',
'Max No. Records': ''
}
Fault Type options:
1 - All Types(Default)
2 - Strike Slip (SS)
3 - Normal/Oblique
4 - Reverse/Oblique
5 - SS+Normal
6 - SS+Reverse
7 - Normal+Reverse
Pulse options:
1 - Any Record(Default)
2 - ONLY Pulse-like Records
3 - NO Pulse-like Records
web.search(settings=settings)
web.download(saveDir)
import os
from PeerNGA import PeerNGA
if __name__ == '__main__':
settings = {
'RSNs': '1'
}
saveDir = os.path.join(os.getcwd(), 'data')
web = PeerNGA()
web.signIn('email', 'password')
web.enterDB('NGA West2')
web.search(settings=settings)
web.download(saveDir)
web.close()