@@ -0,0 +1,17 | |||
|
1 | #!/bin/bash | |
|
2 | # This hook is run after a new virtualenv is activated. | |
|
3 | # ~/.virtualenvs/postmkvirtualenv | |
|
4 | ||
|
5 | libs=( PyQt4 sip.so ) | |
|
6 | ||
|
7 | python_version=python$(python -c "import sys; print (str(sys.version_info[0])+'.'+str(sys.version_info[1]))") | |
|
8 | var=( $(which -a $python_version) ) | |
|
9 | ||
|
10 | get_python_lib_cmd="from distutils.sysconfig import get_python_lib; print (get_python_lib())" | |
|
11 | lib_virtualenv_path=$(python -c "$get_python_lib_cmd") | |
|
12 | lib_system_path=$(${var[-1]} -c "$get_python_lib_cmd") | |
|
13 | ||
|
14 | for lib in ${libs[@]} | |
|
15 | do | |
|
16 | ln -s $lib_system_path/$lib $lib_virtualenv_path/$lib | |
|
17 | done |
@@ -1,147 +1,153 | |||
|
1 | 1 | # Signal Chain |
|
2 | 2 | |
|
3 | 3 | ## Introduction |
|
4 | 4 | |
|
5 | 5 | Signal Chain (SCh) is a radar data processing library developed using [Python](www.python.org) at JRO. SCh provides modules to read, write, process and plot data. |
|
6 | 6 | |
|
7 | 7 | ## Installation |
|
8 | 8 | |
|
9 | 9 | Install system dependencies, clone the latest version from [git](http://jro-dev.igp.gob.pe/rhodecode/schain/) and install it as a normal python package. |
|
10 | 10 | |
|
11 | 11 | ### Linux based system |
|
12 | 12 | ``` |
|
13 | 13 | $ sudo apt-get install python-pip python-dev gfortran libpng-dev freetype* libblas-dev liblapack-dev libatlas-base-dev python-qt4 python-tk libssl-dev libhdf5-dev |
|
14 | $ sudo pip install numpy | |
|
15 | 14 | $ git clone http://jro-dev.igp.gob.pe/rhodecode/schain/ |
|
16 | 15 | $ cd schain |
|
17 | 16 | $ sudo pip install ./ |
|
18 | 17 | |
|
19 | 18 | ``` |
|
20 | 19 | **It is recommended to install schain in a virtual environment** |
|
21 | 20 | ``` |
|
22 | 21 | $ sudo pip install virtualenv |
|
23 | 22 | $ virtualenv /path/to/virtual --system-site-packages |
|
24 | 23 | $ source /path/to/virtual/bin/activate |
|
25 | 24 | (virtual) $ cd schain |
|
26 | 25 | (virtual) $ pip install ./ |
|
27 | 26 | |
|
28 | 27 | ``` |
|
29 | 28 | |
|
30 | 29 | ### MAC Os |
|
31 | 30 | ``` |
|
32 | 31 | $ brew install cartr/qt4/pyqt |
|
33 | 32 | $ git clone http://jro-dev.igp.gob.pe/rhodecode/schain/ |
|
34 | 33 | $ cd schain |
|
35 | 34 | $ pip install ./ |
|
36 | 35 | ``` |
|
37 | 36 | |
|
38 | 37 | if ```pip install ./``` does not work, install a proper python enviroment, and repeat the steps. |
|
39 | 38 | ``` |
|
40 | 39 | $ brew install python |
|
41 | 40 | ``` |
|
42 | 41 | |
|
42 | ### GUI Installation | |
|
43 | ||
|
44 | ``` | |
|
45 | $ sudo apt-get install python-pip python-dev gfortran libpng-dev freetype* libblas-dev liblapack-dev libatlas-base-dev python-qt4 python-tk libssl-dev libhdf5-dev | |
|
46 | $ (virtual) bash link_PyQt4.sh | |
|
47 | ``` | |
|
48 | ||
|
43 | 49 | |
|
44 | 50 | ## First Script |
|
45 | 51 | |
|
46 | 52 | Read Spectra data (.pdata) - remove dc - plot spectra & RTI |
|
47 | 53 | |
|
48 | 54 | Import SCh and creating a project |
|
49 | 55 | |
|
50 | 56 | ```python |
|
51 | 57 | #!/usr/bin/python |
|
52 | 58 | |
|
53 | 59 | from schainpy.controller import Project |
|
54 | 60 | |
|
55 | 61 | controller = Project() |
|
56 | 62 | controller.setup(id = '100', |
|
57 | 63 | name='test', |
|
58 | 64 | description='Basic experiment') |
|
59 | 65 | |
|
60 | 66 | |
|
61 | 67 | ``` |
|
62 | 68 | |
|
63 | 69 | Adding read unit and operations |
|
64 | 70 | |
|
65 | 71 | ```python |
|
66 | 72 | read_unit = controller.addReadUnit(datatype='Spectra', |
|
67 | 73 | path='/path/to/pdata/', |
|
68 | 74 | startDate='2014/01/31', |
|
69 | 75 | endDate='2014/03/31', |
|
70 | 76 | startTime='00:00:00', |
|
71 | 77 | endTime='23:59:59', |
|
72 | 78 | online=0, |
|
73 | 79 | walk=0) |
|
74 | 80 | |
|
75 | 81 | proc_unit = controller.addProcUnit(datatype='Spectra', |
|
76 | 82 | inputId=read_unit.getId()) |
|
77 | 83 | |
|
78 | 84 | op = proc_unit.addOperation(name='selectChannels') |
|
79 | 85 | op.addParameter(name='channelList', value='0,1', format='intlist') |
|
80 | 86 | |
|
81 | 87 | op = proc_unit.addOperation(name='selectHeights') |
|
82 | 88 | op.addParameter(name='minHei', value='80', format='float') |
|
83 | 89 | op.addParameter(name='maxHei', value='200', format='float') |
|
84 | 90 | |
|
85 | 91 | op = proc_unit.addOperation(name='removeDC') |
|
86 | 92 | |
|
87 | 93 | ``` |
|
88 | 94 | |
|
89 | 95 | Plotting data & start project |
|
90 | 96 | |
|
91 | 97 | ```python |
|
92 | 98 | op = proc_unit.addOperation(name='SpectraPlot', optype='other') |
|
93 | 99 | op.addParameter(name='id', value='1', format='int') |
|
94 | 100 | op.addParameter(name='wintitle', value='Spectra', format='str') |
|
95 | 101 | |
|
96 | 102 | op = procUnitConfObj1.addOperation(name='RTIPlot', optype='other') |
|
97 | 103 | op.addParameter(name='id', value='2', format='int') |
|
98 | 104 | op.addParameter(name='wintitle', value='RTI', format='str') |
|
99 | 105 | |
|
100 | 106 | controller.start() |
|
101 | 107 | |
|
102 | 108 | ``` |
|
103 | 109 | |
|
104 | 110 | Full script |
|
105 | 111 | |
|
106 | 112 | |
|
107 | 113 | ```python |
|
108 | 114 | #!/usr/bin/python |
|
109 | 115 | |
|
110 | 116 | from schainpy.controller import Project |
|
111 | 117 | |
|
112 | 118 | controller = Project() |
|
113 | 119 | controller.setup(id = '100', |
|
114 | 120 | name='test', |
|
115 | 121 | description='Basic experiment') |
|
116 | 122 | read_unit = controller.addReadUnit(datatype='Spectra', |
|
117 | 123 | path='/path/to/pdata/', |
|
118 | 124 | startDate='2014/01/31', |
|
119 | 125 | endDate='2014/03/31', |
|
120 | 126 | startTime='00:00:00', |
|
121 | 127 | endTime='23:59:59', |
|
122 | 128 | online=0, |
|
123 | 129 | walk=0) |
|
124 | 130 | |
|
125 | 131 | proc_unit = controller.addProcUnit(datatype='Spectra', |
|
126 | 132 | inputId=read_unit.getId()) |
|
127 | 133 | |
|
128 | 134 | op = proc_unit.addOperation(name='selectChannels') |
|
129 | 135 | op.addParameter(name='channelList', value='0,1', format='intlist') |
|
130 | 136 | |
|
131 | 137 | op = proc_unit.addOperation(name='selectHeights') |
|
132 | 138 | op.addParameter(name='minHei', value='80', format='float') |
|
133 | 139 | op.addParameter(name='maxHei', value='200', format='float') |
|
134 | 140 | |
|
135 | 141 | op = proc_unit.addOperation(name='removeDC') |
|
136 | 142 | |
|
137 | 143 | op = proc_unit.addOperation(name='SpectraPlot', optype='other') |
|
138 | 144 | op.addParameter(name='id', value='6', format='int') |
|
139 | 145 | op.addParameter(name='wintitle', value='Spectra', format='str') |
|
140 | 146 | |
|
141 | 147 | op = procUnitConfObj1.addOperation(name='RTIPlot', optype='other') |
|
142 | 148 | op.addParameter(name='id', value='2', format='int') |
|
143 | 149 | op.addParameter(name='wintitle', value='RTI', format='str') |
|
144 | 150 | |
|
145 | 151 | controller.start() |
|
146 | 152 | |
|
147 | 153 | ``` No newline at end of file |
@@ -1,29 +1,40 | |||
|
1 | 1 | #!/usr/bin/env python |
|
2 |
import os |
|
|
3 | from PyQt4 import QtCore, QtGui | |
|
4 | from PyQt4.QtGui import QApplication | |
|
2 | import os | |
|
3 | import sys | |
|
4 | from schainpy.utils import log | |
|
5 | ||
|
6 | try: | |
|
7 | from PyQt4 import QtCore, QtGui | |
|
8 | from PyQt4.QtGui import QApplication | |
|
9 | except: | |
|
10 | log.error( | |
|
11 | 'You should install PtQt4 module in order to run the GUI. See the README.') | |
|
12 | sys.exit() | |
|
13 | ||
|
5 | 14 | |
|
6 | 15 | from schainpy.gui.viewcontroller.initwindow import InitWindow |
|
7 | 16 | from schainpy.gui.viewcontroller.basicwindow import BasicWindow |
|
8 | 17 | from schainpy.gui.viewcontroller.workspace import Workspace |
|
9 | 18 | |
|
19 | ||
|
10 | 20 | def main(): |
|
11 | ||
|
21 | ||
|
12 | 22 | app = QtGui.QApplication(sys.argv) |
|
13 | ||
|
14 | Welcome=InitWindow() | |
|
15 | ||
|
16 |
if not Welcome.exec_(): |
|
|
17 | sys.exit(-1) | |
|
18 | ||
|
19 | WorkPathspace=Workspace() | |
|
20 | if not WorkPathspace.exec_(): | |
|
23 | ||
|
24 | Welcome = InitWindow() | |
|
25 | ||
|
26 | if not Welcome.exec_(): | |
|
21 | 27 | sys.exit(-1) |
|
22 | ||
|
23 | MainGUI=BasicWindow() | |
|
24 | MainGUI.setWorkSpaceGUI(WorkPathspace.dirComBox.currentText()) | |
|
28 | ||
|
29 | WorkPathspace = Workspace() | |
|
30 | if not WorkPathspace.exec_(): | |
|
31 | sys.exit(-1) | |
|
32 | ||
|
33 | MainGUI = BasicWindow() | |
|
34 | MainGUI.setWorkSpaceGUI(WorkPathspace.dirComBox.currentText()) | |
|
25 | 35 | MainGUI.show() |
|
26 | 36 | sys.exit(app.exec_()) |
|
27 | ||
|
37 | ||
|
38 | ||
|
28 | 39 | if __name__ == "__main__": |
|
29 | main() No newline at end of file | |
|
40 | main() |
@@ -1,69 +1,79 | |||
|
1 | 1 | ''' |
|
2 | 2 | Created on Jul 16, 2014 |
|
3 | 3 | |
|
4 | 4 | @author: Miguel Urco |
|
5 | 5 | ''' |
|
6 | 6 | |
|
7 | import os | |
|
7 | 8 | from setuptools import setup, Extension |
|
8 | 9 | from setuptools.command.build_ext import build_ext as _build_ext |
|
9 | 10 | from schainpy import __version__ |
|
11 | from schainpy.utils import log | |
|
10 | 12 | |
|
11 | 13 | |
|
12 | 14 | class build_ext(_build_ext): |
|
13 | 15 | def finalize_options(self): |
|
14 | 16 | _build_ext.finalize_options(self) |
|
15 | 17 | # Prevent numpy from thinking it is still in its setup process: |
|
16 | 18 | __builtins__.__NUMPY_SETUP__ = False |
|
17 | 19 | import numpy |
|
18 | 20 | self.include_dirs.append(numpy.get_include()) |
|
19 | 21 | |
|
20 | 22 | |
|
23 | try: | |
|
24 | from PyQt4 import QtCore, QtGui | |
|
25 | from PyQt4.QtGui import QApplication | |
|
26 | except: | |
|
27 | log.warning( | |
|
28 | 'You should install PtQt4 module in order to run the GUI. See the README.') | |
|
29 | ||
|
30 | ||
|
21 | 31 | setup(name="schainpy", |
|
22 | 32 | version=__version__, |
|
23 | 33 | description="Python tools to read, write and process Jicamarca data", |
|
24 | 34 | author="Miguel Urco", |
|
25 | 35 | author_email="miguel.urco@jro.igp.gob.pe", |
|
26 | 36 | url="http://jro.igp.gob.pe", |
|
27 | 37 | packages={'schainpy', |
|
28 | 38 | 'schainpy.model', |
|
29 | 39 | 'schainpy.model.data', |
|
30 | 40 | 'schainpy.model.graphics', |
|
31 | 41 | 'schainpy.model.io', |
|
32 | 42 | 'schainpy.model.proc', |
|
33 | 43 | 'schainpy.model.serializer', |
|
34 | 44 | 'schainpy.model.utils', |
|
35 | 45 | 'schainpy.gui', |
|
36 | 46 | 'schainpy.gui.figures', |
|
37 | 47 | 'schainpy.gui.viewcontroller', |
|
38 | 48 | 'schainpy.gui.viewer', |
|
39 | 49 | 'schainpy.gui.viewer.windows'}, |
|
40 | 50 | ext_package='schainpy', |
|
41 | 51 | py_modules=[''], |
|
42 | 52 | package_data={'': ['schain.conf.template'], |
|
43 | 53 | 'schainpy.gui.figures': ['*.png', '*.jpg'], |
|
44 | 54 | }, |
|
45 | 55 | include_package_data=False, |
|
46 | 56 | scripts=['schainpy/gui/schainGUI'], |
|
47 | 57 | ext_modules=[ |
|
48 | 58 | Extension("cSchain", ["schainpy/model/proc/extensions.c"] |
|
49 | 59 | )], |
|
50 | 60 | entry_points={ |
|
51 | 61 | 'console_scripts': [ |
|
52 | 62 | 'schain = schaincli.cli:main', |
|
53 | 63 | ], |
|
54 | 64 | }, |
|
55 | 65 | cmdclass={'build_ext': build_ext}, |
|
56 | 66 | setup_requires=["numpy >= 1.11.2"], |
|
57 | 67 | install_requires=[ |
|
58 | 68 | "scipy >= 0.14.0", |
|
59 | 69 | "h5py >= 2.2.1", |
|
60 | 70 | "matplotlib >= 1.4.2", |
|
61 | 71 | "pyfits >= 3.4", |
|
62 | 72 | "paramiko >= 2.1.2", |
|
63 | 73 | "paho-mqtt >= 1.2", |
|
64 | 74 | "zmq", |
|
65 | 75 | "fuzzywuzzy", |
|
66 | 76 | "click", |
|
67 | 77 | "python-Levenshtein" |
|
68 | 78 | ], |
|
69 | 79 | ) |
General Comments 0
You need to be logged in to leave comments.
Login now