GeoNet / fdsn

FDSN Web Services
MIT License
17 stars 15 forks source link

user support request from Jamie Gurney #167

Closed JonoHanson closed 5 years ago

JonoHanson commented 5 years ago

Jamie emailed the GeoNet archive with

From: UK EQ ukeq_bulletin@yahoo.com Sent: Thursday, 10 January 2019 10:38 AM To: info@geonet.org.nz Subject: Seismic Waveform Data Query - ObsPy

Hi there,

I am using ObsPy & FDSN clients to access waveform data from your seismograph stations. I have found the real-time stations using the IRIS client (ODZ, RPZ, KHZ, QRZ, BFZ, BKZ, HIZ, URZ & OUZ) & I am aware of the archive client GEONET (allows access to all the seismometers as long as the data is more than 7 days old).

I have read & also been told twice by John Ristau that there is a way to access near real-time data via 'service-nrt.geonet.org.nz'. Evidently this is not a URL & ObsPy does not recognise it as valid client URL. I am quite inexperienced with all of this (I'm having to self teach myself between my Bachelors & hopefully future Masters degrees) & therefore am uncertain how to rectify the issue so that I can access the entirety of the last 8 days of seismic data & not just the 9 stations accessible via IRIS. Would you be able to advise on a solution?

Kind regards, Jamie Gurney

@UKEQ_Bulletin

If it is of any help, my current ObsPy code is as follows:

Plot and filter waveforms received from FDSN clients

Base URL Ruhr-Universität base_url='https://ariadne.geophysik.ruhr-uni-bochum.de/'

import numpy as np import matplotlib.pyplot as plt from obspy.clients.fdsn import Client client = Client("GEONET") from obspy import UTCDateTime t = UTCDateTime("2019-01-02T13:49:38.000") t2 = UTCDateTime("2019-01-02T13:50:23.000") st = client.get_waveforms("NZ", "GRZ", "*", "HHZ", t, t2) st.plot() tr = st[0] tr_filt = tr.copy() tr_filt.filter("bandpass", freqmin=1.0, freqmax=5.0, corners=4, zerophase=False)

tr_filt.filter("highpass", freq=5.0, corners=2, zerophase=True)

t = np.arange(0, tr.stats.npts / tr.stats.sampling_rate, tr.stats.delta)

plt.subplot(211)

plt.plot(t, tr.data, 'k')

plt.ylabel('Raw Data')

plt.subplot(212) plt.plot(t, tr_filt.data, 'k') plt.ylabel('Filtered (1.0-5.0 Hz)') plt.xlabel('Time [s]') plt.suptitle(tr.stats.starttime) plt.show()

JonoHanson commented 5 years ago

I answered with

Hello Jamie,

We provide data for the most recent 8 days through our FDSN-near real time client, about which information can be found here

https://www.geonet.org.nz/data/tools/FDSN

And I think your problem will be solved is you take a look at some of the worked python examples available on there at

https://github.com/GeoNet/fdsn/tree/master/examples

and specifically the following dataselect tutorial

https://github.com/GeoNet/fdsn/blob/master/examples/GeoNet_FDSN_demo_dataselect.ipynb

I hope that helps, and please get back in touch if you continue having difficulties.

Cheers,

Jonathan