-
Notifications
You must be signed in to change notification settings - Fork 0
/
ext_attrib_1.py
57 lines (48 loc) · 1.06 KB
/
ext_attrib_1.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/usr/bin/python
#
# Calculate attributes from Inline and Crossline dip
#
#
import sys
import numpy as np
#
# Import the module with the I/O scaffolding of the External Attribute
#
import extattrib as xa
#
# These are the attribute parameters
#
xa.params = {
'Inputs': ['Input'],
'Output': ['Output'],
'Help': 'http://waynegm.github.io/OpendTect-Plugin-Docs/external_attributes/DipandAzimuth.html'
}
#
# Define the compute function
#
def doCompute():
while True:
xa.doInput()
#
# Get the output
xa.Output['Output'] = xa.Input['Input'] * 5
xa.doOutput()
#
# Assign the compute function to the attribute
#
xa.doCompute = doCompute
#
# Do it
#
xa.run(sys.argv[1:])
nrsamples = xa.TI['nrsamp'] * xa.SI['nrtraces']
myfile=open(r"C:\Users\Polash-Dell\coder_guy\PycharmProjects\snippets\123pol.txt", 'w+')
# myfile.write(str(xa.Input['Input'][0][0].tolist()))
try:
mylist=xa.Input['Input'][0][0].tolist()
for samp in mylist:
myfile.write(str(samp)+"\n")
#myfile.write("\n")
except:
pass
myfile.close()