-
Notifications
You must be signed in to change notification settings - Fork 218
/
Copy pathmake-shot-gather.py
41 lines (31 loc) · 981 Bytes
/
make-shot-gather.py
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
import sys
import numpy as np
import segyio
def main():
if len(sys.argv) < 2:
sys.exit('Usage: {} [output]'.format(sys.argv[0]))
spec = segyio.spec()
filename = sys.argv[1]
spec.format = 1
spec.samples = range(25)
spec.tracecount = 61
with segyio.create(filename, spec) as f:
trno = 0
keys = [2, 3, 5, 8]
lens = [10, 12, 13, 26]
for key, length in zip(keys, lens):
for i in range(length):
f.header[trno].update(
offset = 1,
fldr = key,
grnofr = (i % 2) + 1,
tracf = spec.tracecount - i,
)
trace = np.linspace(start = key,
stop = key + 1,
num = len(spec.samples))
f.trace[trno] = trace
trno += 1
f.bin.update()
if __name__ == '__main__':
main()