@@ -106,17 +106,30 class PlotData(Operation, Process): | |||||
106 | poner otro tiempo a la figura q no necesariamente es el ultimo. |
|
106 | poner otro tiempo a la figura q no necesariamente es el ultimo. | |
107 | Solo se realiza cuando termina la imagen. |
|
107 | Solo se realiza cuando termina la imagen. | |
108 | Problemas: |
|
108 | Problemas: | |
109 | -Aun no encuentro. |
|
109 | ||
|
110 | File "/home/ci-81/workspace/schainv2.3/schainpy/model/graphics/jroplot_data.py", line 145, in __plot | |||
|
111 | for n, eachfigure in enumerate(self.figurelist): | |||
|
112 | TypeError: 'NoneType' object is not iterable | |||
|
113 | ||||
110 | ''' |
|
114 | ''' | |
111 | def deleteanotherfiles(self): |
|
115 | def deleteanotherfiles(self): | |
112 | figurenames=[] |
|
116 | figurenames=[] | |
113 | for n, eachfigure in enumerate(self.figurelist): |
|
117 | if self.figurelist != None: | |
114 | #add specific name for each channel in channelList |
|
118 | for n, eachfigure in enumerate(self.figurelist): | |
115 | ghostfigname = os.path.join(self.save, '{}_{}_{}'.format(self.titles[n].replace(' ',''),self.CODE, |
|
119 | #add specific name for each channel in channelList | |
116 | datetime.datetime.fromtimestamp(self.saveTime).strftime('%y%m%d'))) |
|
120 | ghostfigname = os.path.join(self.save, '{}_{}_{}'.format(self.titles[n].replace(' ',''),self.CODE, | |
117 | figname = os.path.join(self.save, '{}_{}_{}.png'.format(self.titles[n].replace(' ',''),self.CODE, |
|
121 | datetime.datetime.fromtimestamp(self.saveTime).strftime('%y%m%d'))) | |
118 | datetime.datetime.fromtimestamp(self.saveTime).strftime('%y%m%d_%H%M%S'))) |
|
122 | figname = os.path.join(self.save, '{}_{}_{}.png'.format(self.titles[n].replace(' ',''),self.CODE, | |
|
123 | datetime.datetime.fromtimestamp(self.saveTime).strftime('%y%m%d_%H%M%S'))) | |||
119 |
|
124 | |||
|
125 | for ghostfigure in glob.glob(ghostfigname+'*'): #ghostfigure will adopt all posible names of figures | |||
|
126 | if ghostfigure != figname: | |||
|
127 | os.remove(ghostfigure) | |||
|
128 | print 'Removing GhostFigures:' , figname | |||
|
129 | else : | |||
|
130 | '''Erasing ghost images for just on******************''' | |||
|
131 | ghostfigname = os.path.join(self.save, '{}_{}'.format(self.CODE,datetime.datetime.fromtimestamp(self.saveTime).strftime('%y%m%d'))) | |||
|
132 | figname = os.path.join(self.save, '{}_{}.png'.format(self.CODE,datetime.datetime.fromtimestamp(self.saveTime).strftime('%y%m%d_%H%M%S'))) | |||
120 | for ghostfigure in glob.glob(ghostfigname+'*'): #ghostfigure will adopt all posible names of figures |
|
133 | for ghostfigure in glob.glob(ghostfigname+'*'): #ghostfigure will adopt all posible names of figures | |
121 | if ghostfigure != figname: |
|
134 | if ghostfigure != figname: | |
122 | os.remove(ghostfigure) |
|
135 | os.remove(ghostfigure) | |
@@ -133,6 +146,7 class PlotData(Operation, Process): | |||||
133 | self.figure.canvas.manager.set_window_title('{} {} - {}'.format(self.title, self.CODE.upper(), |
|
146 | self.figure.canvas.manager.set_window_title('{} {} - {}'.format(self.title, self.CODE.upper(), | |
134 | datetime.datetime.fromtimestamp(self.max_time).strftime('%Y/%m/%d'))) |
|
147 | datetime.datetime.fromtimestamp(self.max_time).strftime('%Y/%m/%d'))) | |
135 | else : |
|
148 | else : | |
|
149 | print 'len(self.figurelist): ',len(self.figurelist) | |||
136 | for n, eachfigure in enumerate(self.figurelist): |
|
150 | for n, eachfigure in enumerate(self.figurelist): | |
137 | if self.show: |
|
151 | if self.show: | |
138 | eachfigure.show() |
|
152 | eachfigure.show() | |
@@ -228,6 +242,7 class PlotData(Operation, Process): | |||||
228 | self.ended = True |
|
242 | self.ended = True | |
229 | self.isConfig = False |
|
243 | self.isConfig = False | |
230 | self.__plot() |
|
244 | self.__plot() | |
|
245 | #TODO : AUN NO FUNCIONA PARA COHERENCIA. | |||
231 | self.deleteanotherfiles() #CLPDG |
|
246 | self.deleteanotherfiles() #CLPDG | |
232 | elif seconds_passed >= self.data['throttle']: |
|
247 | elif seconds_passed >= self.data['throttle']: | |
233 | print 'passed', seconds_passed |
|
248 | print 'passed', seconds_passed | |
@@ -533,9 +548,17 class PlotRTIData(PlotData): | |||||
533 | self.ncols = 1 |
|
548 | self.ncols = 1 | |
534 | self.nrows = self.dataOut.nChannels |
|
549 | self.nrows = self.dataOut.nChannels | |
535 | self.width = 10 |
|
550 | self.width = 10 | |
536 | self.height = 2.2*self.nrows if self.nrows<6 else 12 |
|
551 | #TODO : arreglar la altura de la figura, esta hardcodeada. | |
|
552 | #Se arreglo, testear! | |||
|
553 | if self.ind_plt_ch: | |||
|
554 | self.height = 3.2#*self.nrows if self.nrows<6 else 12 | |||
|
555 | else: | |||
|
556 | self.height = 2.2*self.nrows if self.nrows<6 else 12 | |||
|
557 | ||||
|
558 | ''' | |||
537 | if self.nrows==1: |
|
559 | if self.nrows==1: | |
538 | self.height += 1 |
|
560 | self.height += 1 | |
|
561 | ''' | |||
539 | self.ylabel = 'Range [Km]' |
|
562 | self.ylabel = 'Range [Km]' | |
540 | self.titles = ['Channel {}'.format(x) for x in self.dataOut.channelList] |
|
563 | self.titles = ['Channel {}'.format(x) for x in self.dataOut.channelList] | |
541 |
|
564 |
@@ -1,5 +1,5 | |||||
1 | import argparse |
|
1 | import argparse | |
2 |
|
2 | import datetime | ||
3 | from schainpy.controller import Project, multiSchain |
|
3 | from schainpy.controller import Project, multiSchain | |
4 |
|
4 | |||
5 | desc = "HF_EXAMPLE" |
|
5 | desc = "HF_EXAMPLE" | |
@@ -95,7 +95,15 def fiber(cursor, skip, q, dt): | |||||
95 |
|
95 | |||
96 |
|
96 | |||
97 | if __name__ == '__main__': |
|
97 | if __name__ == '__main__': | |
|
98 | ############################DATE########################################## | |||
|
99 | doitnow = datetime.datetime.now() - datetime.timedelta(days=1) # Un dia antes | |||
|
100 | y = doitnow.year | |||
|
101 | m = doitnow.month | |||
|
102 | d = int(doitnow.day) | |||
|
103 | date = str(y)+"/"+str(m)+"/"+str(d) | |||
|
104 | ########################################################################### | |||
98 | parser = argparse.ArgumentParser(description='Set number of parallel processes') |
|
105 | parser = argparse.ArgumentParser(description='Set number of parallel processes') | |
99 | parser.add_argument('--nProcess', default=1, type=int) |
|
106 | parser.add_argument('--nProcess', default=1, type=int) | |
100 | args = parser.parse_args() |
|
107 | args = parser.parse_args() | |
101 |
multiSchain(fiber, nProcess=8, startDate='2016/04/23', endDate='2016/04/2 |
|
108 | multiSchain(fiber, nProcess=8, startDate='2016/04/23', endDate='2016/04/23') | |
|
109 | #multiSchain(fiber, nProcess=4, startDate=date, endDate=date) #Plot automatico de un dia antes |
@@ -18,7 +18,10 if __name__ == '__main__': | |||||
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,coh,phase,snr,dop', format='str') |
|
19 | #proc1.addParameter(name='plottypes', value='rti,coh,phase,snr,dop', format='str') | |
20 | #proc1.addParameter(name='plottypes', value='rti,coh,phase,snr', format='str') |
|
20 | #proc1.addParameter(name='plottypes', value='rti,coh,phase,snr', format='str') | |
21 | proc1.addParameter(name='plottypes', value='snr,dop', format='str') |
|
21 | ||
|
22 | #proc1.addParameter(name='plottypes', value='snr,dop', format='str') | |||
|
23 | proc1.addParameter(name='plottypes', value='rti,dop,snr,phase,coh', format='str') | |||
|
24 | #proc1.addParameter(name='plottypes', value='phase,coh', format='str') | |||
22 |
|
25 | |||
23 | #proc1.addParameter(name='throttle', value='10', format='int') |
|
26 | #proc1.addParameter(name='throttle', value='10', format='int') | |
24 |
|
27 | |||
@@ -34,49 +37,53 if __name__ == '__main__': | |||||
34 | op1.addParameter(name='zmin', value='-110', format='float') |
|
37 | op1.addParameter(name='zmin', value='-110', format='float') | |
35 | op1.addParameter(name='zmax', value='-50', format='float') |
|
38 | op1.addParameter(name='zmax', value='-50', format='float') | |
36 | op1.addParameter(name='colormap', value='jet', format='str') |
|
39 | op1.addParameter(name='colormap', value='jet', format='str') | |
37 | # |
|
|||
38 | op2 = proc1.addOperation(name='PlotCOHData', optype='other') |
|
|||
39 | op2.addParameter(name='wintitle', value='HF System', format='str') |
|
|||
40 | op2.addParameter(name='zmin', value='0.001', format='float') |
|
|||
41 | op2.addParameter(name='zmax', value='1', format='float') |
|
|||
42 | op2.addParameter(name='save', value='/home/ci-81/Pictures', format='str') |
|
|||
43 | op2.addParameter(name='colormap', value='jet', format='str') |
|
|||
44 | op2.addParameter(name='show', value='0', format='bool') |
|
|||
45 | # # |
|
|||
46 |
|
40 | |||
47 | op6 = proc1.addOperation(name='PlotPHASEData', optype='other') |
|
|||
48 | op6.addParameter(name='wintitle', value='HF System', format='str') |
|
|||
49 | op6.addParameter(name='save', value='/home/ci-81/Pictures', format='str') |
|
|||
50 | op6.addParameter(name='show', value='1', format='bool') |
|
|||
51 | # |
|
|||
52 |
|
41 | |||
53 | # proc2 = controllerObj.addProcUnit(name='ReceiverData') |
|
42 | # proc2 = controllerObj.addProcUnit(name='ReceiverData') | |
54 | # proc2.addParameter(name='server', value='juanca', format='str') |
|
43 | # proc2.addParameter(name='server', value='juanca', format='str') | |
55 | # proc2.addParameter(name='plottypes', value='snr,dop', format='str') |
|
44 | # proc2.addParameter(name='plottypes', value='snr,dop', format='str') | |
56 | # |
|
45 | # | |
57 | """ |
|
46 | """ | |
|
47 | ||||
|
48 | op2 = proc1.addOperation(name='PlotCOHData', optype='other') | |||
|
49 | op2.addParameter(name='wintitle', value='HF System Coh', format='str') | |||
|
50 | op2.addParameter(name='zmin', value='0.001', format='float') | |||
|
51 | op2.addParameter(name='zmax', value='1', format='float') | |||
|
52 | op2.addParameter(name='save', value='/home/ci-81/Pictures', format='str') | |||
|
53 | op2.addParameter(name='colormap', value='jet', format='str') | |||
|
54 | op2.addParameter(name='show', value='1', format='bool') | |||
|
55 | ||||
58 | op3 = proc1.addOperation(name='PlotSNRData', optype='other') |
|
56 | op3 = proc1.addOperation(name='PlotSNRData', optype='other') | |
59 | op3.addParameter(name='wintitle', value='HF System SNR0', format='str') |
|
57 | op3.addParameter(name='wintitle', value='HF System SNR0', format='str') | |
60 | op3.addParameter(name='save', value='/home/ci-81/Pictures', format='str') |
|
58 | op3.addParameter(name='save', value='/home/ci-81/Pictures', format='str') | |
61 |
op3.addParameter(name='show', value=' |
|
59 | op3.addParameter(name='show', value='1', format='bool') | |
62 | op3.addParameter(name='zmin', value='-10', format='int') |
|
60 | op3.addParameter(name='zmin', value='-10', format='int') | |
63 | op3.addParameter(name='zmax', value='30', format='int') |
|
61 | op3.addParameter(name='zmax', value='30', format='int') | |
64 | op3.addParameter(name='SNRthresh', value='0', format='float') |
|
62 | op3.addParameter(name='SNRthresh', value='0', format='float') | |
65 | op3.addParameter(name='ind_plt_ch',value='1',format = 'bool') |
|
63 | op3.addParameter(name='ind_plt_ch',value='1',format = 'bool') | |
66 |
|
64 | |||
67 | # |
|
65 | ||
68 | op5 = proc1.addOperation(name='PlotDOPData', optype='other') |
|
66 | op5 = proc1.addOperation(name='PlotDOPData', optype='other') | |
69 | op5.addParameter(name='wintitle', value='HF System DOP', format='str') |
|
67 | op5.addParameter(name='wintitle', value='HF System DOP', format='str') | |
70 | op5.addParameter(name='save', value='/home/ci-81/Pictures', format='str') |
|
68 | op5.addParameter(name='save', value='/home/ci-81/Pictures', format='str') | |
71 | op5.addParameter(name='show', value='1', format='bool') |
|
69 | op5.addParameter(name='show', value='1', format='bool') | |
72 |
op5.addParameter(name='zmin', value='-1 |
|
70 | op5.addParameter(name='zmin', value='-140', format='float') | |
73 |
op5.addParameter(name='zmax', value='1 |
|
71 | op5.addParameter(name='zmax', value='140', format='float') | |
74 | op5.addParameter(name='colormap', value='RdBu_r', format='str') |
|
72 | op5.addParameter(name='colormap', value='RdBu_r', format='str') | |
75 | op5.addParameter(name='ind_plt_ch',value='1',format = 'bool') |
|
73 | op5.addParameter(name='ind_plt_ch',value='1',format = 'bool') | |
76 | """ |
|
74 | ||
77 | op4 = proc1.addOperation(name='PlotSNRData1', optype='other') |
|
75 | # op4 = proc1.addOperation(name='PlotSNRData1', optype='other') | |
78 | op4.addParameter(name='wintitle', value='HF System SNR1', format='str') |
|
76 | # op4.addParameter(name='wintitle', value='HF System SNR1', format='str') | |
79 | op4.addParameter(name='save', value='/home/ci-81/Pictures', format='str') |
|
77 | # op4.addParameter(name='save', value='/home/ci-81/Pictures', format='str') | |
80 | op4.addParameter(name='show', value='0', format='bool') |
|
78 | # op4.addParameter(name='show', value='0', format='bool') | |
81 | """ |
|
79 | ||
|
80 | op6 = proc1.addOperation(name='PlotPHASEData', optype='other') | |||
|
81 | op6.addParameter(name='wintitle', value='HF System', format='str') | |||
|
82 | op6.addParameter(name='colormap', value='RdBu_r', format='str') | |||
|
83 | op6.addParameter(name='zmin', value='-180', format='float') | |||
|
84 | op6.addParameter(name='zmax', value='180', format='float') | |||
|
85 | op6.addParameter(name='save', value='/home/ci-81/Pictures', format='str') | |||
|
86 | op6.addParameter(name='show', value='1', format='bool') | |||
|
87 | op6.addParameter(name='ind_plt_ch',value='0',format = 'bool') | |||
|
88 | """ """ | |||
82 | controllerObj.start() |
|
89 | controllerObj.start() |
@@ -1,1 +1,1 | |||||
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="/media/ci-81/Huancayo/DATA/hfradar_2016/pdata/sp1_f1" /><Parameter format="date" id="191113" name="startDate" value="2016/04/2 |
|
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="/media/ci-81/Huancayo/DATA/hfradar_2016/pdata/sp1_f1" /><Parameter format="date" id="191113" name="startDate" value="2016/04/23" /><Parameter format="date" id="191114" name="endDate" value="2016/04/23" /><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="8" /><Parameter format="int" id="191119" name="skip" value="16" /><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" /></Operation></ProcUnit><ProcUnit datatype="Spectra" id="1912" inputId="1911" name="SpectraProc"><Operation id="19121" name="run" priority="1" type="self" /><Operation id="19122" name="removeInterference" priority="2" type="self" /></ProcUnit></Project> No newline at end of file |
General Comments 0
You need to be logged in to leave comments.
Login now