Getting waveform data

Hello obs-py community,

I’m not a seismologist by background, so please forgive some of my naivety!

I’ve been trying to download some waveforms associated with some stations, and as far as I can gather from the docs, this should work:

from obspy.clients.fdsn import Client
from obspy.core import UTCDateTime
client = Client(“ORFEUS”)

t1 = UTCDateTime(2018, 10, 11, 17, 15, 22, 497918)
t2 = UTCDateTime(2018, 10, 18, 17, 15, 22, 497918)

r = client.get_waveforms(‘Z3’,‘A089A’, ‘’,’’,t1,t2, attach_response=True)

However, this returns an error:

Traceback (most recent call last):
File “”, line 1, in
File “/Users/chris/.local/share/virtualenvs/arch-NdiSQAf2/lib/python3.7/site-packages/obspy/clients/fdsn/client.py”, line 830, in get_waveforms
data_stream = self._download(url, use_gzip=False)
File “/Users/chris/.local/share/virtualenvs/arch-NdiSQAf2/lib/python3.7/site-packages/obspy/clients/fdsn/client.py”, line 1382, in _download
raise_on_error(code, data)
File “/Users/chris/.local/share/virtualenvs/arch-NdiSQAf2/lib/python3.7/site-packages/obspy/clients/fdsn/client.py”, line 1706, in raise_on_error
server_info)
obspy.clients.fdsn.header.FDSNNoDataException: No data available for request.
Detailed response of server:

(note that the ‘detailed response of server’ is null!)

I thought that this network/station combination was valid because if I run

for n in client.get_stations(): print(b)

I get


Network Z3 (AlpArray Seismic Network (AASN) temporary component)

Stations (66):

Z3.A089A (Nesovice, Czech Republic)

A couple of things confused me that might be contributing to errors I’m probably making:

  • Client.get_stations() appears to return instances of the Network class, rather than instance of the Station class:

type(client.get_stations()[0])

<class ‘obspy.core.inventory.network.Network’>

which itself contains an iterable containing instances of Station:

type(client.get_stations()[0][0])

<class ‘obspy.core.inventory.station.Station’>

  • The channels metadata doesn’t seem to be available for the calls I’m trying. For example, this only returns empty lists:

for s in client.get_stations():

for n in s: print(n.channels)

and printing an arbitrary channel doesn’t reveal the channel info either, despite all the other metadata being printed:

print(client.get_stations()[0][0])
Station E064 (La Canada de Mira)
Station Code: E064
Channel Count: None/None (Selected/Total)
2009-07-19T15:25:47.000000Z - 2010-10-19T10:55:00.000000Z
Access: open
Latitude: 39.66, Longitude: -1.46, Elevation: 935.0 m
Available Channels:

  • is it possible to list the available channels? Valid channels just seem to a string value - are these defined as constants anywhere?

Any hints as to things I’m doing wrong (or links to docs to help my understanding) would be gratefully received!

Cheers
Chris

Hi Chris,

AlpArray waveform data is restricted, you need appropriate credentials. You need to get in touch with the AlpArray people, but if your affiliation/institute is not part of the AlpArray project you might not be able to get the data.
(Station metadata is not restricted, thats why you got those)

cheers,
T

Hi Tobias,

Ah, thanks! How do I find out datasets my institution has access to - can I do this programmatically? (and is authentication just IP based or is there a gateway system?)

Cheers
Chris

You can exclude restricted stations like this (if the metadata correctly specify the restriction status):

inv = client.get_stations(network='Z3', includerestricted=False)

This will throw an error because no data matches.

Network/Station objects have an ".restricted_status" attribute if you fetch all station data.

I don't think there's an IP filter but you do need credentials for AlpArray, like I already said.

T

Thanks - that’s very helpful!

I still see channels(0) when iterating through networks (and stations), even when I use ‘includerestricted=False’; e.g. the last result I get from running for s in client.get_stations(includerestricted=False): print(s) is:

Network VI (SIL Icelandic national seismic network)

Station Count: None/None (Selected/Total)

1990-10-10T00:00:00.000000Z - –

Access: open

Contains:

Stations (6):

VI.ADA (VI-ADA)

VI.ASB (VI-ASB)

VI.FAG (VI-FAG)

VI.GIL (VI-GIL)

VI.GOD (VI-GOD)

VI.SKR (VI-SKR)

Channels (0):

and from running

for s in client.get_stations(includerestricted=False):

for n in s: print(n)

Station SKR (VI-SKR)

Station Code: SKR

Channel Count: None/None (Selected/Total)

1996-10-02T00:00:00.000000Z -

Access: open

Latitude: 64.56, Longitude: -18.39, Elevation: 858.0 m

Available Channels:

is this expected behaviour, or should the list of channels be listed in the metadata?

Chris

One can request station information at various hierarchical “levels” to reduce data load. The default level is “station” thus there will be no channel-level information in the requested metadata. Adding level="channel" to the get_stations() call will also request the aforementioned extra information. An even more detailed level is “response”.

Cheers!

Lion