天然地震
OBSpy教程之Client
获取不同Client的url
1 | from obspy.clients.fdsn import Client |
| Client_abbr | base_url |
|---|---|
| BGR | http://eida.bgr.de |
| EMSC | http://www.seismicportal.eu |
| ETH | http://eida.ethz.ch |
| GEONET | http://service.geonet.org.nz |
| GFZ | http://geofon.gfz-potsdam.de |
| ICGC | http://ws.icgc.cat |
| INGV | http://webservices.ingv.it |
| IPGP | http://ws.ipgp.fr |
| IRIS | http://service.iris.edu |
| ISC | http://isc-mirror.iris.washington.edu |
| KNMI | http://rdsa.knmi.nl |
| KOERI | http://eida.koeri.boun.edu.tr |
| LMU | http://erde.geophysik.uni-muenchen.de |
| NCEDC | http://service.ncedc.org |
| NIEP | http://eida-sc3.infp.ro |
| NOA | http://eida.gein.noa.gr |
| ODC | http://www.orfeus-eu.org |
| ORFEUS | http://www.orfeus-eu.org |
| RASPISHAKE | http://fdsnws.raspberryshakedata.com |
| RESIF | http://ws.resif.fr |
| SCEDC | http://service.scedc.caltech.edu |
| TEXNET | http://rtserve.beg.utexas.edu |
| UIB-NORSAR | http://eida.geo.uib.no |
| USGS | http://earthquake.usgs.gov |
| USP | http://sismo.iag.usp.br |
在地图上显示network中的台站位置
1 | c = Client("IRIS") |

根据日期获取指定台站数据并按天分割
当需要下载指定台站、指定日期范围内的地震数据时,可以使用以下代码。1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24import obspy
from obspy.clients.fdsn.mass_downloader import RectangularDomain, Restrictions, MassDownloader
from obspy import UTCDateTime
domain = RectangularDomain(minlatitude=-90,
maxlatitude=90,
minlongitude=-180,
maxlongitude=180)
restrictions = Restrictions(starttime=UTCDateTime(2020, 7, 20),
endtime=UTCDateTime(2020, 7, 22),
chunklength_in_sec=86400,
network="II",
station="KDAK",
location="*",
channel="*",
reject_channels_with_gaps=False,
minimum_length=0.0,
minimum_interstation_distance_in_m=100.0)
mdl = MassDownloader()# providers=["IRIS"]
mdl.download(domain,
restrictions,
mseed_storage="./data/KDAK/waveforms",
stationxml_storage="./data/KDAK/stations")
以上代码中,下载了从starttime到endtime范围内,网络II、台站KDAK的所有通道数据,并将其截取为每个文件86400s长度(即一天)