fdsn client silently drops blockette 1001

Hi all,

I have made a discovery while querying an fdsn server using the obspy fdsn client:

If I'm using the obspy client like this:

import obspy.core
import obspy.clients.fdsn.client
client = obspy.clients.fdsn.client.Client(base_url='http://zur-sts2.ethz.ch')
starttime = obspy.core.UTCDateTime(2017,8,17)
endtime = starttime + 120
st = client.get_waveforms('CH','ZUR','','HHZ',starttime,endtime)
print st[0].stats['mseed']

The result is:

AttribDict({'record_length': 512, 'encoding': u'STEIM1', 'filesize': 30208,
u'dataquality': u'D', 'number_of_records': 59, 'byteorder': u'>'})

However, if I request the same time period using wget, store the result in a file and then read the file with "details='True'" like this:

st = obspy.core.read('/tmp/data.mseed',details=True)
print st[0].stats['mseed']

The result is as follows:

AttribDict({u'calibration_type': False, 'encoding': u'STEIM1', u'blkt1001':
AttribDict({u'timing_quality': 90}), 'record_length': 512, 'filesize':
280064, u'dataquality': u'D', 'number_of_records': 547, 'byteorder': u'>'})

Apparently, the fdsn client silently drops the blockette 1001.

Kind regards

Roman Racine

Hi Roman,

it seems that inside the FDSN client we don't use ’details=True’ when
reading the fetched MiniSEED data, and there's no switch to let the user
control this behavior. Maybe we should think about making this ’details’
switch available through a kwarg to ’Client.get_waveforms’ (and the bulk
version), or just do it by default (I don't have a strong opinion on
this matter and will leave it for others to comment/decide, feel free to
open an issue on github if you want this changed).

In any case, as an immediate workaround you could either save the
original MiniSEED data unaltered to file using "filename=...", or if you
just want to do this in memory, you can use a BytesIO object to store
the unaltered data and read it with details switched on:

from io import BytesIO
from obspy.clients.fdsn import Client
client = Client()
t1 = UTCDateTime("2010-02-27T06:30:00.000")
t2 = t1 + 5
tmp = BytesIO()
client.get_waveforms("IU", "ANMO", "00", "LHZ", t1, t2, filename=tmp)
tmp.seek(0)
st = read(tmp, format='MSEED', details=True)
print(st[0].stats.mseed)

cheers,
T