-
Notifications
You must be signed in to change notification settings - Fork 27
/
Copy pathlaunch_acolite.py
35 lines (28 loc) · 1.07 KB
/
launch_acolite.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
## wrapper to launch ACOLITE GUI/CLI
## QV 2018
## last modifications QV 2018-09-12 renamed from acolite.py and added main test
## QV 2019-02-21 ignore numpy errors
## QV 2021-01-05 added freeze_support call for binary GUI
def launch_acolite():
## need to run freeze_support for PyInstaller binary generation
from multiprocessing import Process, freeze_support
freeze_support()
## import sys to parse arguments
import sys
## fix matplotlib backend to Agg
## skip import if --nogfx is given
if not (('--cli' in sys.argv) & ('--nogfx' in sys.argv)):
import matplotlib
matplotlib.use("Agg")
## import acolite source
import acolite as ac
## ignore numpy errors
import numpy as np
olderr = np.seterr(all='ignore')
## run command line if --cli provided, otherwise use gui
if '--cli' in sys.argv:
ac.acolite.acolite_cli(sys.argv)
else:
ret = ac.acolite.acolite_gui(sys.argv, version=ac.acolite.config['version'])
if __name__ == '__main__':
launch_acolite()