File: make-multiple-text.py

package info (click to toggle)
segyio 1.8.3-1.2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 3,724 kB
  • sloc: cpp: 17,823; ansic: 4,637; python: 4,326; makefile: 38; sh: 23
file content (25 lines) | stat: -rw-r--r-- 501 bytes parent folder | download | duplicates (2)
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
import sys
import segyio

def main():
    if len(sys.argv) < 2:
        sys.exit("Usage: make-multiple-text.py [file]")

    filename = sys.argv[1]

    spec = segyio.spec()
    spec.sorting = 2
    spec.format = 1
    spec.samples = [1]
    spec.ilines = [1]
    spec.xlines = [1]
    spec.ext_headers = 4

    with segyio.create(filename, spec) as f:
        for i in range(1, spec.ext_headers + 1):
            f.text[i] = f.text[0]

        f.trace[0] = [0]

if __name__ == '__main__':
    main()