In [1]:
from obspy import read
from obspy import UTCDateTime
from obspy import read, read_inventory
from obspy.clients.fdsn import Client
In [2]:
import obspy as ob
print("# obspy version = ",ob.__version__)
# obspy version =  1.2.2
In [3]:
server_nameOUT = "scedc"
clientOUT = Client("SCEDC", timeout=600)
In [4]:
origin_time = UTCDateTime("2019-07-20T22:05:12.491000")
In [5]:
pre_tw_sec =0
tw_sec = 60
In [ ]:
 
In [6]:
starttime_tw = UTCDateTime(origin_time-pre_tw_sec)
endtime_tw = UTCDateTime(origin_time+tw_sec)
In [7]:
print("# starttime_tw = ", starttime_tw, "endtime_tw = ", endtime_tw)
# starttime_tw =  2019-07-20T22:05:12.491000Z endtime_tw =  2019-07-20T22:06:12.491000Z
In [8]:
invOUT = clientOUT.get_stations(network="ZY", station="SV*", channel="HNZ", 
                                starttime=starttime_tw, endtime=endtime_tw,
                                level="response")
In [9]:
#from obspy import read_inventory
#inv = read_inventory("https://ncedc.org/ftp/outgoing/taira/RC/stress_drop/38561631.scedc.xml")
In [10]:
print(invOUT)
Inventory created at 2021-10-26T13:53:38.000000Z
	Created by: SCEDC WEB SERVICE: fdsnws-station | version: 1.1
		    http://service.scedc.caltech.edu/fdsnws/station/1/query?net=ZY&sta=...
	Sending institution: SCEDC (SCEDC)
	Contains:
		Networks (1):
			ZY
		Stations (8):
			ZY.SV01 (SV01 Ridgecrest RAMP)
			ZY.SV02 (SV02 Ridgecrest RAMP)
			ZY.SV03 (SV03 Ridgecrest RAMP)
			ZY.SV04 (SV04 Ridgecrest RAMP)
			ZY.SV05 (SV05 Ridgecrest RAMP)
			ZY.SV06 (SV06 Ridgecrest RAMP)
			ZY.SV07 (SV07 Ridgecrest RAMP)
			ZY.SV08 (SV08 Ridgecrest RAMP)
		Channels (16):
			ZY.SV01..HNZ, ZY.SV01.CC.HNZ, ZY.SV02..HNZ, ZY.SV02.CC.HNZ, 
			ZY.SV03..HNZ, ZY.SV03.CC.HNZ, ZY.SV04..HNZ, ZY.SV04.CC.HNZ, 
			ZY.SV05..HNZ, ZY.SV05.CC.HNZ, ZY.SV06..HNZ, ZY.SV06.CC.HNZ, 
			ZY.SV07..HNZ, ZY.SV07.CC.HNZ, ZY.SV08..HNZ, ZY.SV08.CC.HNZ
In [11]:
invOUT.write("test.xml",
                format="STATIONXML")  
In [12]:
invOUT.write("test.sacpz",
                format="SACPZ")  
/Users/taira/opt/anaconda3/envs/netops/lib/python3.8/site-packages/obspy/io/sac/sacpz.py:60: UserWarning: ZY.SV01..HNZ 2019-07-10T22:23:00.000000Z has no paz. Skipping.
  warnings.warn(msg)
/Users/taira/opt/anaconda3/envs/netops/lib/python3.8/site-packages/obspy/io/sac/sacpz.py:60: UserWarning: ZY.SV01.CC.HNZ 2019-07-10T22:23:00.000000Z has no paz. Skipping.
  warnings.warn(msg)
/Users/taira/opt/anaconda3/envs/netops/lib/python3.8/site-packages/obspy/io/sac/sacpz.py:60: UserWarning: ZY.SV02..HNZ 2019-07-11T22:31:01.000000Z has no paz. Skipping.
  warnings.warn(msg)
/Users/taira/opt/anaconda3/envs/netops/lib/python3.8/site-packages/obspy/io/sac/sacpz.py:60: UserWarning: ZY.SV02.CC.HNZ 2019-07-11T22:31:01.000000Z has no paz. Skipping.
  warnings.warn(msg)
/Users/taira/opt/anaconda3/envs/netops/lib/python3.8/site-packages/obspy/io/sac/sacpz.py:60: UserWarning: ZY.SV03..HNZ 2019-07-07T17:38:05.000000Z has no paz. Skipping.
  warnings.warn(msg)
/Users/taira/opt/anaconda3/envs/netops/lib/python3.8/site-packages/obspy/io/sac/sacpz.py:60: UserWarning: ZY.SV03.CC.HNZ 2019-07-07T17:38:05.000000Z has no paz. Skipping.
  warnings.warn(msg)
/Users/taira/opt/anaconda3/envs/netops/lib/python3.8/site-packages/obspy/io/sac/sacpz.py:60: UserWarning: ZY.SV04..HNZ 2019-07-11T23:02:37.000000Z has no paz. Skipping.
  warnings.warn(msg)
/Users/taira/opt/anaconda3/envs/netops/lib/python3.8/site-packages/obspy/io/sac/sacpz.py:60: UserWarning: ZY.SV04.CC.HNZ 2019-07-11T23:02:37.000000Z has no paz. Skipping.
  warnings.warn(msg)
/Users/taira/opt/anaconda3/envs/netops/lib/python3.8/site-packages/obspy/io/sac/sacpz.py:60: UserWarning: ZY.SV05..HNZ 2019-07-07T20:03:07.000000Z has no paz. Skipping.
  warnings.warn(msg)
/Users/taira/opt/anaconda3/envs/netops/lib/python3.8/site-packages/obspy/io/sac/sacpz.py:60: UserWarning: ZY.SV05.CC.HNZ 2019-07-07T20:03:07.000000Z has no paz. Skipping.
  warnings.warn(msg)
/Users/taira/opt/anaconda3/envs/netops/lib/python3.8/site-packages/obspy/io/sac/sacpz.py:60: UserWarning: ZY.SV06..HNZ 2019-07-11T01:47:24.000000Z has no paz. Skipping.
  warnings.warn(msg)
/Users/taira/opt/anaconda3/envs/netops/lib/python3.8/site-packages/obspy/io/sac/sacpz.py:60: UserWarning: ZY.SV06.CC.HNZ 2019-07-11T01:47:24.000000Z has no paz. Skipping.
  warnings.warn(msg)
In [ ]:
 
In [ ]:
 
In [ ]: