@@ -31,10 +31,6 def multiSchain(child, nProcess=cpu_count(), startDate=None, endDate=None, by_da | |||||
31 | cursor = 0 |
|
31 | cursor = 0 | |
32 | nFiles = None |
|
32 | nFiles = None | |
33 | processes = [] |
|
33 | processes = [] | |
34 |
|
||||
35 |
|
||||
36 |
|
||||
37 |
|
||||
38 | dt1 = datetime.datetime.strptime(startDate, '%Y/%m/%d') |
|
34 | dt1 = datetime.datetime.strptime(startDate, '%Y/%m/%d') | |
39 | dt2 = datetime.datetime.strptime(endDate, '%Y/%m/%d') |
|
35 | dt2 = datetime.datetime.strptime(endDate, '%Y/%m/%d') | |
40 | days = (dt2 - dt1).days |
|
36 | days = (dt2 - dt1).days |
@@ -5,4 +5,3 from jroplot_correlation import * | |||||
5 | from jroplot_parameters import * |
|
5 | from jroplot_parameters import * | |
6 | from jroplot_data import * |
|
6 | from jroplot_data import * | |
7 | from jroplotter import * |
|
7 | from jroplotter import * | |
8 | No newline at end of file |
|
@@ -5,6 +5,8 import time | |||||
5 | import numpy |
|
5 | import numpy | |
6 | import datetime |
|
6 | import datetime | |
7 | import numpy as np |
|
7 | import numpy as np | |
|
8 | import matplotlib | |||
|
9 | matplotlib.use('TkAgg') | |||
8 | import matplotlib.pyplot as plt |
|
10 | import matplotlib.pyplot as plt | |
9 | from mpl_toolkits.axes_grid1 import make_axes_locatable |
|
11 | from mpl_toolkits.axes_grid1 import make_axes_locatable | |
10 | from matplotlib.ticker import FuncFormatter, LinearLocator |
|
12 | from matplotlib.ticker import FuncFormatter, LinearLocator | |
@@ -12,7 +14,7 from multiprocessing import Process | |||||
12 |
|
14 | |||
13 | from schainpy.model.proc.jroproc_base import Operation |
|
15 | from schainpy.model.proc.jroproc_base import Operation | |
14 |
|
16 | |||
15 |
|
|
17 | plt.ioff() | |
16 |
|
18 | |||
17 | func = lambda x, pos: ('%s') %(datetime.datetime.fromtimestamp(x).strftime('%H:%M')) |
|
19 | func = lambda x, pos: ('%s') %(datetime.datetime.fromtimestamp(x).strftime('%H:%M')) | |
18 |
|
20 | |||
@@ -90,6 +92,7 class PlotData(Operation, Process): | |||||
90 | print 'plotting...{}'.format(self.CODE) |
|
92 | print 'plotting...{}'.format(self.CODE) | |
91 |
|
93 | |||
92 | if self.show: |
|
94 | if self.show: | |
|
95 | print 'showing' | |||
93 | self.figure.show() |
|
96 | self.figure.show() | |
94 |
|
97 | |||
95 | self.plot() |
|
98 | self.plot() | |
@@ -628,7 +631,7 class PlotWindProfilerData(PlotRTIData): | |||||
628 |
|
631 | |||
629 | self.z = np.array(self.z) |
|
632 | self.z = np.array(self.z) | |
630 | self.z = numpy.ma.masked_invalid(self.z) |
|
633 | self.z = numpy.ma.masked_invalid(self.z) | |
631 |
|
634 | |||
632 | cmap=plt.get_cmap(self.colormap) |
|
635 | cmap=plt.get_cmap(self.colormap) | |
633 | cmap.set_bad('white', 1.) |
|
636 | cmap.set_bad('white', 1.) | |
634 |
|
637 |
@@ -30,10 +30,10 class Plotter(Operation): | |||||
30 | name = None |
|
30 | name = None | |
31 | __queue = None |
|
31 | __queue = None | |
32 |
|
32 | |||
33 | def __init__(self, plotter_name, plotter_queue=None): |
|
33 | def __init__(self, plotter_name, plotter_queue=None, **kwargs): | |
|
34 | ||||
|
35 | Operation.__init__(self, **kwargs) | |||
34 |
|
36 | |||
35 | Operation.__init__(self) |
|
|||
36 |
|
||||
37 | self.isConfig = False |
|
37 | self.isConfig = False | |
38 | self.name = plotter_name |
|
38 | self.name = plotter_name | |
39 | self.__queue = plotter_queue |
|
39 | self.__queue = plotter_queue | |
@@ -84,7 +84,7 class PlotManager(): | |||||
84 | 'CrossSpectraPlot', 'CoherenceMap', |
|
84 | 'CrossSpectraPlot', 'CoherenceMap', | |
85 | 'PowerProfilePlot', 'Noise', 'BeaconPhase', |
|
85 | 'PowerProfilePlot', 'Noise', 'BeaconPhase', | |
86 | 'CorrelationPlot', |
|
86 | 'CorrelationPlot', | |
87 | 'SpectraHeisScope','RTIfromSpectraHeis'] |
|
87 | 'SpectraHeisScope', 'RTIfromSpectraHeis'] | |
88 |
|
88 | |||
89 | def __init__(self, plotter_queue): |
|
89 | def __init__(self, plotter_queue): | |
90 |
|
90 | |||
@@ -170,7 +170,7 class PlotManager(): | |||||
170 |
|
170 | |||
171 | if plot_id not in self.plotInstanceDict.keys(): |
|
171 | if plot_id not in self.plotInstanceDict.keys(): | |
172 | className = eval(plot_name) |
|
172 | className = eval(plot_name) | |
173 | self.plotInstanceDict[plot_id] = className() |
|
173 | self.plotInstanceDict[plot_id] = className(**kwargs) | |
174 |
|
174 | |||
175 | plotter = self.plotInstanceDict[plot_id] |
|
175 | plotter = self.plotInstanceDict[plot_id] | |
176 | try: |
|
176 | try: |
@@ -262,11 +262,11 def addpcolorbuffer(ax, x, y, z, zmin, zmax, xlabel='', ylabel='', title='', col | |||||
262 | ax.collections.remove(ax.collections[0]) |
|
262 | ax.collections.remove(ax.collections[0]) | |
263 |
|
263 | |||
264 | z = numpy.ma.masked_invalid(z) |
|
264 | z = numpy.ma.masked_invalid(z) | |
265 |
|
265 | |||
266 | cmap=matplotlib.pyplot.get_cmap(colormap) |
|
266 | cmap=matplotlib.pyplot.get_cmap(colormap) | |
267 | cmap.set_bad('white', 1.) |
|
267 | cmap.set_bad('white', 1.) | |
268 |
|
268 | |||
269 |
|
269 | |||
270 | ax.pcolormesh(x,y,z.T,vmin=zmin,vmax=zmax, cmap=cmap) |
|
270 | ax.pcolormesh(x,y,z.T,vmin=zmin,vmax=zmax, cmap=cmap) | |
271 |
|
271 | |||
272 | def createPmultiline(ax, x, y, xmin, xmax, ymin, ymax, xlabel='', ylabel='', title='', legendlabels=None, |
|
272 | def createPmultiline(ax, x, y, xmin, xmax, ymin, ymax, xlabel='', ylabel='', title='', legendlabels=None, |
@@ -245,7 +245,7 class PublishData(Operation): | |||||
245 | def close(self): |
|
245 | def close(self): | |
246 | if self.zeromq is 1: |
|
246 | if self.zeromq is 1: | |
247 | self.dataOut.finished = True |
|
247 | self.dataOut.finished = True | |
248 |
|
|
248 | self.zmq_socket.send_pyobj(self.dataOut) | |
249 |
|
249 | |||
250 | if self.client: |
|
250 | if self.client: | |
251 | self.client.loop_stop() |
|
251 | self.client.loop_stop() |
@@ -31,8 +31,8 def fiber(cursor, skip, q, dt): | |||||
31 | procUnitConfObj2 = controllerObj.addProcUnit(datatype='Spectra', inputId=readUnitConfObj.getId()) |
|
31 | procUnitConfObj2 = controllerObj.addProcUnit(datatype='Spectra', inputId=readUnitConfObj.getId()) | |
32 | # opObj11 = procUnitConfObj2.addParameter(name='pairsList', value='(0,1)', format='pairslist') |
|
32 | # opObj11 = procUnitConfObj2.addParameter(name='pairsList', value='(0,1)', format='pairslist') | |
33 | # |
|
33 | # | |
34 |
|
|
34 | procUnitConfObj3 = controllerObj.addProcUnit(datatype='ParametersProc', inputId=readUnitConfObj.getId()) | |
35 |
|
|
35 | opObj11 = procUnitConfObj3.addOperation(name='SpectralMoments', optype='other') | |
36 |
|
36 | |||
37 | # |
|
37 | # | |
38 | # opObj11 = procUnitConfObj1.addOperation(name='SpectraPlot', optype='other') |
|
38 | # opObj11 = procUnitConfObj1.addOperation(name='SpectraPlot', optype='other') | |
@@ -58,7 +58,7 def fiber(cursor, skip, q, dt): | |||||
58 | # opObj11.addParameter(name='save', value='0', format='int') |
|
58 | # opObj11.addParameter(name='save', value='0', format='int') | |
59 | # # opObj11.addParameter(name='figpath', value='/tmp/', format='str') |
|
59 | # # opObj11.addParameter(name='figpath', value='/tmp/', format='str') | |
60 | # |
|
60 | # | |
61 |
opObj12 = procUnitConfObj |
|
61 | opObj12 = procUnitConfObj3.addOperation(name='PublishData', optype='other') | |
62 | opObj12.addParameter(name='zeromq', value=1, format='int') |
|
62 | opObj12.addParameter(name='zeromq', value=1, format='int') | |
63 |
|
63 | |||
64 |
|
64 |
@@ -16,34 +16,42 if __name__ == '__main__': | |||||
16 |
|
16 | |||
17 | proc1 = controllerObj.addProcUnit(name='ReceiverData') |
|
17 | proc1 = controllerObj.addProcUnit(name='ReceiverData') | |
18 | proc1.addParameter(name='realtime', value='0', format='bool') |
|
18 | proc1.addParameter(name='realtime', value='0', format='bool') | |
19 | proc1.addParameter(name='plottypes', value='rti', format='str') |
|
19 | proc1.addParameter(name='plottypes', value='rti,coh,phase,snr,dop', format='str') | |
20 |
|
|
20 | proc1.addParameter(name='throttle', value='10', format='int') | |
21 | proc1.addParameter(name='plot_server', value='tcp://10.10.10.82:7000', format='str') |
|
21 | proc1.addParameter(name='plot_server', value='tcp://10.10.10.82:7000', format='str') | |
22 | ## TODO Agregar direccion de server de publicacion a graficos como variable |
|
22 | ## TODO Agregar direccion de server de publicacion a graficos como variable | |
23 |
|
23 | |||
24 | op1 = proc1.addOperation(name='PlotRTIData', optype='other') |
|
24 | op1 = proc1.addOperation(name='PlotRTIData', optype='other') | |
25 | op1.addParameter(name='wintitle', value='Julia 150Km', format='str') |
|
25 | op1.addParameter(name='wintitle', value='Julia 150Km', format='str') | |
26 | op1.addParameter(name='save', value='/home/nanosat/Pictures', format='str') |
|
26 | op1.addParameter(name='save', value='/home/nanosat/Pictures', format='str') | |
|
27 | op1.addParameter(name='show', value='0', format='bool') | |||
|
28 | op1.addParameter(name='colormap', value='jet', format='str') | |||
27 | # |
|
29 | # | |
28 |
|
|
30 | op2 = proc1.addOperation(name='PlotCOHData', optype='other') | |
29 |
|
|
31 | op2.addParameter(name='wintitle', value='Julia 150Km', format='str') | |
30 |
|
|
32 | op2.addParameter(name='save', value='/home/nanosat/Pictures', format='str') | |
|
33 | op2.addParameter(name='colormap', value='jet', format='str') | |||
|
34 | op2.addParameter(name='show', value='0', format='bool') | |||
31 | # # |
|
35 | # # | |
32 |
|
|
36 | op6 = proc1.addOperation(name='PlotPHASEData', optype='other') | |
33 |
|
|
37 | op6.addParameter(name='wintitle', value='Julia 150Km', format='str') | |
34 |
|
|
38 | op6.addParameter(name='save', value='/home/nanosat/Pictures', format='str') | |
|
39 | op6.addParameter(name='show', value='1', format='bool') | |||
35 | # |
|
40 | # | |
36 | # proc2 = controllerObj.addProcUnit(name='ReceiverData') |
|
41 | # proc2 = controllerObj.addProcUnit(name='ReceiverData') | |
37 | # proc2.addParameter(name='server', value='juanca', format='str') |
|
42 | # proc2.addParameter(name='server', value='juanca', format='str') | |
38 | # proc2.addParameter(name='plottypes', value='snr,dop', format='str') |
|
43 | # proc2.addParameter(name='plottypes', value='snr,dop', format='str') | |
39 | # |
|
44 | # | |
40 |
|
|
45 | op3 = proc1.addOperation(name='PlotSNRData', optype='other') | |
41 |
|
|
46 | op3.addParameter(name='wintitle', value='Julia 150Km', format='str') | |
42 |
|
|
47 | op3.addParameter(name='save', value='/home/nanosat/Pictures', format='str') | |
|
48 | op3.addParameter(name='show', value='0', format='bool') | |||
43 | # |
|
49 | # | |
44 |
|
|
50 | op4 = proc1.addOperation(name='PlotDOPData', optype='other') | |
45 |
|
|
51 | op4.addParameter(name='wintitle', value='Julia 150Km', format='str') | |
46 |
|
|
52 | op4.addParameter(name='save', value='/home/nanosat/Pictures', format='str') | |
|
53 | op4.addParameter(name='show', value='0', format='bool') | |||
|
54 | op4.addParameter(name='colormap', value='jet', format='str') | |||
47 |
|
55 | |||
48 |
|
56 | |||
49 |
|
57 |
@@ -1,1 +1,1 | |||||
1 | <Project description="Segundo Test" id="191" name="test01"><ProcUnit datatype="ReceiverData" id="1911" inputId="0" name="ReceiverData"><Operation id="19111" name="run" priority="1" type="self"><Parameter format="bool" id="191111" name="realtime" value="1" /><Parameter format="str" id="191112" name="plottypes" value="rti" /><Parameter format="str" id="191113" name="plot_server" value="tcp://10.10.10.82:7000" /></Operation><Operation id="19112" name="PlotRTIData" priority="2" type="other"><Parameter format="str" id="191121" name="wintitle" value="Julia 150Km" /><Parameter format="str" id="191122" name="save" value="/home/nanosat/Pictures" /></Operation></ProcUnit></Project> No newline at end of file |
|
1 | <Project description="HF_EXAMPLE" id="191" name="test01"><ReadUnit datatype="SpectraReader" id="1911" inputId="0" name="SpectraReader"><Operation id="19111" name="run" priority="1" type="self"><Parameter format="str" id="191111" name="datatype" value="SpectraReader" /><Parameter format="str" id="191112" name="path" value="/home/nanosat/data/hysell_data20/pdata" /><Parameter format="date" id="191113" name="startDate" value="2015/09/26" /><Parameter format="date" id="191114" name="endDate" value="2015/09/26" /><Parameter format="time" id="191115" name="startTime" value="00:00:00" /><Parameter format="time" id="191116" name="endTime" value="23:59:59" /><Parameter format="int" id="191118" name="cursor" value="2" /><Parameter format="int" id="191119" name="skip" value="720" /><Parameter format="int" id="191120" name="delay" value="10" /><Parameter format="int" id="191121" name="walk" value="1" /><Parameter format="int" id="191122" name="online" value="0" /></Operation></ReadUnit><ProcUnit datatype="ParametersProc" id="1913" inputId="1911" name="ParametersProc"><Operation id="19131" name="run" priority="1" type="self" /><Operation id="19132" name="SpectralMoments" priority="2" type="other" /><Operation id="19133" name="PublishData" priority="3" type="other"><Parameter format="int" id="191331" name="zeromq" value="1" /><Parameter format="int" id="191332" name="delay" value="1" /></Operation></ProcUnit><ProcUnit datatype="Spectra" id="1912" inputId="1911" name="SpectraProc"><Operation id="19121" name="run" priority="1" type="self" /></ProcUnit></Project> No newline at end of file |
General Comments 0
You need to be logged in to leave comments.
Login now