using headonly flag in readMSEED()

hello,

I don't fully understand the meaning of the "headonly" flag for the
readMSEED function :

http://docs.obspy.org/packages/autogen/obspy.mseed.core.readMSEED.html#obspy.mseed.core.readMSEED

- what informations am I going to miss if I set headonly to True ?
(e.g : if I have many Traces in a single file, am I going to get the
metadata for all traces anyway ?)

- may I expect an positive impact on performance when setting headonly
to True ?

- is it mutually exclusive with the quality boolean flag ?

thanks
Tom

Hi Tom,

I don't fully understand the meaning of the "headonly" flag for
the readMSEED function :

http://docs.obspy.org/packages/autogen/obspy.mseed.core.readMSEED.html#obspy.mseed.core.readMSEED

- what informations am I going to miss if I set headonly to True
? (e.g : if I have many Traces in a single file, am I going to get
the metadata for all traces anyway ?)

headonly will omit the actual data - it will load only meta data

# just preparing a sample file

from obspy.core import read st=read() st.write('out.mseed',
format='MSEED')

# here we go with headonly=False (default)

st = read('out.mseed') st[0].stats

Stats({'network': 'BW', '_format': 'MSEED', 'mseed': ...

st[0].data

array([ 0. , 0.00694644, 0.07597424, ...

# headonly=True

st = read('out.mseed', headonly=True) st[0].stats

Stats({'network': 'BW', '_format': 'MSEED', 'mseed': ...

st[0].data

array([], dtype=float64)

- may I expect an positive impact on performance when setting
headonly to True ?

yes if you only interested into meta data

%timeit st=read('out.mseed', headonly=True)

1000 loops, best of 3: 1.98 ms per loop

%timeit st=read('out.mseed', headonly=False)

100 loops, best of 3: 2.82 ms per loop

- is it mutually exclusive with the quality boolean flag ?

yes - although it isn't a very nice exception which is raised

hi Robert
understood -- thanks for the quick answer
cheers
Tom