Hot-keys on this page

r m x p   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

50

51

52

53

54

55

56

57

58

59

# -*- coding: utf-8 -*- 

""" 

obspy.seisan - SEISAN read support for ObsPy 

============================================ 

 

The obspy.seisan package contains methods in order to read seismogram files in 

the SEISAN format. 

 

:copyright: 

    The ObsPy Development Team (devs@obspy.org) 

:license: 

    GNU Lesser General Public License, Version 3 

    (http://www.gnu.org/copyleft/lesser.html) 

 

Reading 

------- 

Importing SEISAN files is done similar to reading any other waveform data 

format within ObsPy by using the :func:`~obspy.core.stream.read()` method of 

the :mod:`obspy.core` module. Examples seismograms files may be found at 

http://examples.obspy.org. 

 

>>> from obspy import read 

>>> st = read("/path/to/2001-01-13-1742-24S.KONO__004") 

>>> st  # doctest: +ELLIPSIS 

<obspy.core.stream.Stream object at 0x...> 

>>> print(st)  # doctest: +ELLIPSIS 

4 Trace(s) in Stream: 

.KONO.0.B0Z | 2001-01-13T17:45:01.999000Z - ... | 20.0 Hz, 6000 samples 

.KONO.0.L0Z | 2001-01-13T17:42:24.924000Z - ... | 1.0 Hz, 3542 samples 

.KONO.0.L0N | 2001-01-13T17:42:24.924000Z - ... | 1.0 Hz, 3542 samples 

.KONO.0.L0E | 2001-01-13T17:42:24.924000Z - ... | 1.0 Hz, 3542 samples 

 

The file format will be determined automatically. Each trace (multiple channels 

are mapped to multiple traces) will have a stats attribute containing the usual 

information. 

 

>>> print(st[0].stats)  # doctest: +NORMALIZE_WHITESPACE 

             network: 

             station: KONO 

            location: 0 

             channel: B0Z 

           starttime: 2001-01-13T17:45:01.999000Z 

             endtime: 2001-01-13T17:50:01.949000Z 

       sampling_rate: 20.0 

               delta: 0.05 

                npts: 6000 

               calib: 1.0 

             _format: SEISAN 

 

The actual data is stored as numpy.ndarray in the data attribute of each trace. 

 

>>> print(st[0].data) 

[  492   519   542 ..., -6960 -6858 24000] 

""" 

 

 

if __name__ == '__main__': 

    import doctest 

    doctest.testmod(exclude_empty=True)