-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathCSFtools.py
53 lines (41 loc) · 1.63 KB
/
CSFtools.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
import os
import sys
class CSFtools:
def __init__(self):
self.parentPath = os.path.split(os.path.realpath(__file__))[0]
def fullPath(self,script_name):
return os.path.join(self.parentPath, script_name)
def getPyExePath(self):
return sys.executable
def command(self,script):
return self.getPyExePath()+ " " + self.fullPath(script)
def parse_params(self, params):
if len(params)%2 != 0:
print("Parameter number is not correct.")
cmdstr = ""
for i in range(0, len(params),2):
param_name = params[i]
param_value = params[i+1]
cmdstr += param_name + " " + str(param_value) + " "
return cmdstr
def csfground(self, params):
cmdstr = self.parse_params(params)
os.system(self.command("csfground.py " + cmdstr))
def csfdem(self, params):
cmdstr = self.parse_params(params)
os.system(self.command("csfdem.py "+cmdstr))
def csfnormalize(self, params):
cmdstr = self.parse_params(params)
os.system(self.command("csfnormalize.py " + cmdstr))
def csfclassify(self, params):
cmdstr = self.parse_params(params)
os.system(self.command("csfclassify.py " + cmdstr))
def csfcrown(self, params):
cmdstr = self.parse_params(params)
os.system(self.command("csfcrown.py " + cmdstr))
def csflai(self, params):
cmdstr = self.parse_params(params)
os.system(self.command("csflai.py " + cmdstr))
def csfheight(self, params):
cmdstr = self.parse_params(params)
os.system(self.command("csfheight.py " + cmdstr))