obspy.mseed.core.readMSEED

readMSEED(mseed_object, starttime=None, endtime=None, headonly=False, sourcename=None, reclen=None, recinfo=True, details=False, **kwargs)[source]

Reads a Mini-SEED file and returns a Stream object.

Warning

This function should NOT be called directly, it registers via the ObsPy read() function, call this instead.

Parameters:
  • mseed_object Filename or open file like object that contains the binary Mini-SEED data. Any object that provides a read() method will be considered to be a file like object.
  • starttime (UTCDateTime) Only read data samples after or at the starttime.
  • endtime (UTCDateTime) Only read data samples before or at the starttime.
  • headonly Determines whether or not to unpack the data or just read the headers.
  • sourcename (str) Sourcename has to have the structure ‘network.station.location.channel’ and can contain globbing characters. Defaults to None.
  • reclen If it is None, it will be automatically determined for every record. If it is known, just set it to the record length in bytes which will increase the reading speed slightly.
  • recinfo (bool, optional) If True the byteorder, record length and the encoding of the file will be read and stored in every Trace’s stats.mseed AttribDict. These stored attributes will also be used while writing a Mini-SEED file. Only the very first record of the file will be read and all following records are assumed to be the same. Defaults to True.
  • details (bool, optional) If True read additional information: timing quality and availability of calibration information. Note, that the traces are then also split on these additional information. Thus the number of traces in a stream will change. Details are stored in the mseed stats AttribDict of each trace. -1 specifies for both cases, that these information is not available. timing_quality specifies the timing quality from 0 to 100 [%]. calibration_type specifies the type of available calibration information: 1 == Step Calibration, 2 == Sine Calibration, 3 == Pseudo-random Calibration, 4 == Generic Calibration and -2 == Calibration Abort.

Example

>>> from obspy import read
>>> st = read("/path/to/two_channels.mseed")
>>> print(st)  
2 Trace(s) in Stream:
BW.UH3..EHE | 2010-06-20T00:00:00.279999Z - ... | 200.0 Hz, 386 samples
BW.UH3..EHZ | 2010-06-20T00:00:00.279999Z - ... | 200.0 Hz, 386 samples
>>> from obspy import UTCDateTime
>>> st = read("/path/to/test.mseed",
...           starttime=UTCDateTime("2003-05-29T02:16:00"),
...           selection="NL.*.*.?HZ")
>>> print(st)  
1 Trace(s) in Stream:
NL.HGN.00.BHZ | 2003-05-29T02:15:59.993400Z - ... | 40.0 Hz, 5629 samples

This Page