1# -*- coding: utf-8 -*- 2""" 3obspy.io.seisan - SEISAN read support for ObsPy 4=============================================== 5 6The obspy.io.seisan package contains methods in order to read seismogram 7files in the SEISAN format. 8 9:copyright: 10 The ObsPy Development Team (devs@obspy.org) 11:license: 12 GNU Lesser General Public License, Version 3 13 (https://www.gnu.org/copyleft/lesser.html) 14 15Reading 16------- 17Importing SEISAN files is done similar to reading any other waveform data 18format within ObsPy by using the :func:`~obspy.core.stream.read()` method of 19the :mod:`obspy.core` module. Example seismogram files may be found at 20https://examples.obspy.org. 21 22>>> from obspy import read 23>>> st = read("/path/to/2001-01-13-1742-24S.KONO__004") 24>>> st # doctest: +ELLIPSIS 25<obspy.core.stream.Stream object at 0x...> 26>>> print(st) # doctest: +ELLIPSIS 274 Trace(s) in Stream: 28.KONO.0.B0Z | 2001-01-13T17:45:01.999000Z - ... | 20.0 Hz, 6000 samples 29.KONO.0.L0Z | 2001-01-13T17:42:24.924000Z - ... | 1.0 Hz, 3542 samples 30.KONO.0.L0N | 2001-01-13T17:42:24.924000Z - ... | 1.0 Hz, 3542 samples 31.KONO.0.L0E | 2001-01-13T17:42:24.924000Z - ... | 1.0 Hz, 3542 samples 32 33The file format will be determined automatically. Each trace (multiple channels 34are mapped to multiple traces) will have a stats attribute containing the usual 35information. 36 37>>> print(st[0].stats) # doctest: +NORMALIZE_WHITESPACE 38 network: 39 station: KONO 40 location: 0 41 channel: B0Z 42 starttime: 2001-01-13T17:45:01.999000Z 43 endtime: 2001-01-13T17:50:01.949000Z 44 sampling_rate: 20.0 45 delta: 0.05 46 npts: 6000 47 calib: 1.0 48 _format: SEISAN 49 50The actual data is stored as numpy.ndarray in the data attribute of each trace. 51 52>>> print(st[0].data) 53[ 464 492 519 ..., -7042 -6960 -6858] 54""" 55from __future__ import (absolute_import, division, print_function, 56 unicode_literals) 57from future.builtins import * # NOQA 58 59 60if __name__ == '__main__': 61 import doctest 62 doctest.testmod(exclude_empty=True) 63