# Getting waveform data

**URL:** https://discourse.obspy.org/t/getting-waveform-data/803
**Category:** Users Mailing List Archive
**Tags:** archive
**Created:** [October 25, 2018, 7:52pm UTC](https://discourse.obspy.org/t/getting-waveform-data/803 "2018-10-25T19:52:08Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Chris\_Wood](https://discourse.obspy.org/letter_avatar_proxy/v4/letter/c/a6a055/32.png) [@Chris\_Wood](https://discourse.obspy.org/u/Chris_Wood)
#### Post date: [October 25, 2018, 7:52pm UTC](https://discourse.obspy.org/t/getting-waveform-data/803/1 "2018-10-25T19:52:08Z")

</div>

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

---

<div class="post-metadata">

### Author: ![megies](https://discourse.obspy.org/user_avatar/discourse.obspy.org/megies/32/9_2.png) [@megies](https://discourse.obspy.org/u/megies)
#### Post date: [October 26, 2018, 8:10am UTC](https://discourse.obspy.org/t/getting-waveform-data/803/2 "2018-10-26T08:10:24Z")

</div>

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

---

<div class="post-metadata">

### Author: ![Chris\_Wood](https://discourse.obspy.org/letter_avatar_proxy/v4/letter/c/a6a055/32.png) [@Chris\_Wood](https://discourse.obspy.org/u/Chris_Wood)
#### Post date: [October 26, 2018, 8:14am UTC](https://discourse.obspy.org/t/getting-waveform-data/803/3 "2018-10-26T08:14:51Z")

</div>

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

---

<div class="post-metadata">

### Author: ![megies](https://discourse.obspy.org/user_avatar/discourse.obspy.org/megies/32/9_2.png) [@megies](https://discourse.obspy.org/u/megies)
#### Post date: [October 26, 2018, 8:25am UTC](https://discourse.obspy.org/t/getting-waveform-data/803/4 "2018-10-26T08:25:11Z")

</div>

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

---

<div class="post-metadata">

### Author: ![Chris\_Wood](https://discourse.obspy.org/letter_avatar_proxy/v4/letter/c/a6a055/32.png) [@Chris\_Wood](https://discourse.obspy.org/u/Chris_Wood)
#### Post date: [October 26, 2018, 9:26am UTC](https://discourse.obspy.org/t/getting-waveform-data/803/5 "2018-10-26T09:26:03Z")

</div>

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

---

<div class="post-metadata">

### Author: ![LionKrischer](https://discourse.obspy.org/user_avatar/discourse.obspy.org/lionkrischer/32/219_2.png) [@LionKrischer](https://discourse.obspy.org/u/LionKrischer)
#### Post date: [October 30, 2018, 11:47am UTC](https://discourse.obspy.org/t/getting-waveform-data/803/6 "2018-10-30T11:47:17Z")

</div>

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
