forked from SasView/sasview
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfit.py
executable file
·45 lines (32 loc) · 1.17 KB
/
fit.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
#!/usr/bin/env python
"""
Bumps model file for running saved sasview fits.
Fit configuration (including fitted variables and ranges) is set up in the
Sasview GUI and saved as a .svs or .fitv file. These can then be run
directly from bumps using::
path/to/sasview/fit.py path/to/save.svs [--bumps_option ...]
Alternatively, if sasview is installed on your python path, use::
python -m sas.sascalc.fit.fitstate path/to/save.svs [--bumps_option ...]
In unix/mac you can create a file on your shell path (e.g., ~/bin/sasbumps)
containing::
#!/usr/bin/env python
from sas.sascalc.fit.fitstate import bumps_cli
bumps_cli()
set it as executable with::
chmod a+x ~/bin/sasbumps
and use::
sasbumps path/to/save.svs [--bumps_option ...]
"""
# ============ Set up python environment ==============
import sys
import os
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
from run import prepare
del sys.path[0]
prepare(rebuild=False)
# =========== Set up logging ===========
#from sas.logger_config import SetupLogger
#SetupLogger(__name__).config_development()
# =========== Run BUMPS ===============
from sas.sascalc.fit.fitstate import bumps_cli
bumps_cli()