#source activate the environment of obspy and enter Python source activate obspy python
#Initialize a client project from obspy.clients.fdsn import Client client=Client("IRIS")
#Show currently avaliable providers from obspy.clients.fdsn.header import URL_MAPPINGS for key in sorted(URL_MAPPINGS.keys()): print("{0:<7} {1}".format(key, URL_MAPPINGS[key])) #Note: It's vital importrant to do indent properly,or errors will happened just like this: expected an indented block
#Next, the basic usage of getting event_waveform_data will be showed #At the first of all, i really need to know what i want to do very clearly #Nowthen, My needs are list below: #(1)Event: around 2010-02-27 06:45 (UTC) in New Mexico, ANMO. 120 minutes of the "LHZ" channel #(2)Network: GSN, global seismograph networks, IU #Results are returned as stream objects from obspy import UTCDateTime t = UTCDateTime("2010-02-27T06:45:00.000") st = client.get_waveforms("IU","ANMO","00","LHZ",t,t+120*60) st.plot()
#get_events starttime = UTCDateTime("2009-08-27") endtime = UTCDateTime("2010-02-27") cat=client.get_events(starttime=starttime,endtime=endtime,minmagnitude=6,catalog="ISC") print(cat) #or, you want to see all event during the given time range #print(cat.__str__(print_all=True)) cat.plot()