diff --git a/schainpy/model/graphics/jroplot_data.py b/schainpy/model/graphics/jroplot_data.py index 9fb22ff..fc56431 100644 --- a/schainpy/model/graphics/jroplot_data.py +++ b/schainpy/model/graphics/jroplot_data.py @@ -106,17 +106,30 @@ class PlotData(Operation, Process): poner otro tiempo a la figura q no necesariamente es el ultimo. Solo se realiza cuando termina la imagen. Problemas: - -Aun no encuentro. + + File "/home/ci-81/workspace/schainv2.3/schainpy/model/graphics/jroplot_data.py", line 145, in __plot + for n, eachfigure in enumerate(self.figurelist): + TypeError: 'NoneType' object is not iterable + ''' def deleteanotherfiles(self): figurenames=[] - for n, eachfigure in enumerate(self.figurelist): - #add specific name for each channel in channelList - ghostfigname = os.path.join(self.save, '{}_{}_{}'.format(self.titles[n].replace(' ',''),self.CODE, - datetime.datetime.fromtimestamp(self.saveTime).strftime('%y%m%d'))) - figname = os.path.join(self.save, '{}_{}_{}.png'.format(self.titles[n].replace(' ',''),self.CODE, - datetime.datetime.fromtimestamp(self.saveTime).strftime('%y%m%d_%H%M%S'))) + if self.figurelist != None: + for n, eachfigure in enumerate(self.figurelist): + #add specific name for each channel in channelList + ghostfigname = os.path.join(self.save, '{}_{}_{}'.format(self.titles[n].replace(' ',''),self.CODE, + datetime.datetime.fromtimestamp(self.saveTime).strftime('%y%m%d'))) + figname = os.path.join(self.save, '{}_{}_{}.png'.format(self.titles[n].replace(' ',''),self.CODE, + datetime.datetime.fromtimestamp(self.saveTime).strftime('%y%m%d_%H%M%S'))) + for ghostfigure in glob.glob(ghostfigname+'*'): #ghostfigure will adopt all posible names of figures + if ghostfigure != figname: + os.remove(ghostfigure) + print 'Removing GhostFigures:' , figname + else : + '''Erasing ghost images for just on******************''' + ghostfigname = os.path.join(self.save, '{}_{}'.format(self.CODE,datetime.datetime.fromtimestamp(self.saveTime).strftime('%y%m%d'))) + figname = os.path.join(self.save, '{}_{}.png'.format(self.CODE,datetime.datetime.fromtimestamp(self.saveTime).strftime('%y%m%d_%H%M%S'))) for ghostfigure in glob.glob(ghostfigname+'*'): #ghostfigure will adopt all posible names of figures if ghostfigure != figname: os.remove(ghostfigure) @@ -133,6 +146,7 @@ class PlotData(Operation, Process): self.figure.canvas.manager.set_window_title('{} {} - {}'.format(self.title, self.CODE.upper(), datetime.datetime.fromtimestamp(self.max_time).strftime('%Y/%m/%d'))) else : + print 'len(self.figurelist): ',len(self.figurelist) for n, eachfigure in enumerate(self.figurelist): if self.show: eachfigure.show() @@ -228,6 +242,7 @@ class PlotData(Operation, Process): self.ended = True self.isConfig = False self.__plot() + #TODO : AUN NO FUNCIONA PARA COHERENCIA. self.deleteanotherfiles() #CLPDG elif seconds_passed >= self.data['throttle']: print 'passed', seconds_passed @@ -533,9 +548,17 @@ class PlotRTIData(PlotData): self.ncols = 1 self.nrows = self.dataOut.nChannels self.width = 10 - self.height = 2.2*self.nrows if self.nrows<6 else 12 + #TODO : arreglar la altura de la figura, esta hardcodeada. + #Se arreglo, testear! + if self.ind_plt_ch: + self.height = 3.2#*self.nrows if self.nrows<6 else 12 + else: + self.height = 2.2*self.nrows if self.nrows<6 else 12 + + ''' if self.nrows==1: self.height += 1 + ''' self.ylabel = 'Range [Km]' self.titles = ['Channel {}'.format(x) for x in self.dataOut.channelList] diff --git a/schainpy/scripts/PPD.py b/schainpy/scripts/PPD.py index 3884e01..2beb1e0 100644 --- a/schainpy/scripts/PPD.py +++ b/schainpy/scripts/PPD.py @@ -1,5 +1,5 @@ import argparse - +import datetime from schainpy.controller import Project, multiSchain desc = "HF_EXAMPLE" @@ -95,7 +95,15 @@ def fiber(cursor, skip, q, dt): if __name__ == '__main__': + ############################DATE########################################## + doitnow = datetime.datetime.now() - datetime.timedelta(days=1) # Un dia antes + y = doitnow.year + m = doitnow.month + d = int(doitnow.day) + date = str(y)+"/"+str(m)+"/"+str(d) + ########################################################################### parser = argparse.ArgumentParser(description='Set number of parallel processes') parser.add_argument('--nProcess', default=1, type=int) args = parser.parse_args() - multiSchain(fiber, nProcess=8, startDate='2016/04/23', endDate='2016/04/27') + multiSchain(fiber, nProcess=8, startDate='2016/04/23', endDate='2016/04/23') + #multiSchain(fiber, nProcess=4, startDate=date, endDate=date) #Plot automatico de un dia antes diff --git a/schainpy/scripts/receiver.py b/schainpy/scripts/receiver.py index 83b6d24..7b74fb6 100644 --- a/schainpy/scripts/receiver.py +++ b/schainpy/scripts/receiver.py @@ -18,7 +18,10 @@ if __name__ == '__main__': # proc1.addParameter(name='realtime', value='0', format='bool') #proc1.addParameter(name='plottypes', value='rti,coh,phase,snr,dop', format='str') #proc1.addParameter(name='plottypes', value='rti,coh,phase,snr', format='str') - proc1.addParameter(name='plottypes', value='snr,dop', format='str') + + #proc1.addParameter(name='plottypes', value='snr,dop', format='str') + proc1.addParameter(name='plottypes', value='rti,dop,snr,phase,coh', format='str') + #proc1.addParameter(name='plottypes', value='phase,coh', format='str') #proc1.addParameter(name='throttle', value='10', format='int') @@ -34,49 +37,53 @@ if __name__ == '__main__': op1.addParameter(name='zmin', value='-110', format='float') op1.addParameter(name='zmax', value='-50', format='float') op1.addParameter(name='colormap', value='jet', format='str') - # - op2 = proc1.addOperation(name='PlotCOHData', optype='other') - op2.addParameter(name='wintitle', value='HF System', format='str') - op2.addParameter(name='zmin', value='0.001', format='float') - op2.addParameter(name='zmax', value='1', format='float') - op2.addParameter(name='save', value='/home/ci-81/Pictures', format='str') - op2.addParameter(name='colormap', value='jet', format='str') - op2.addParameter(name='show', value='0', format='bool') - # # - op6 = proc1.addOperation(name='PlotPHASEData', optype='other') - op6.addParameter(name='wintitle', value='HF System', format='str') - op6.addParameter(name='save', value='/home/ci-81/Pictures', format='str') - op6.addParameter(name='show', value='1', format='bool') - # # proc2 = controllerObj.addProcUnit(name='ReceiverData') # proc2.addParameter(name='server', value='juanca', format='str') # proc2.addParameter(name='plottypes', value='snr,dop', format='str') # """ + + op2 = proc1.addOperation(name='PlotCOHData', optype='other') + op2.addParameter(name='wintitle', value='HF System Coh', format='str') + op2.addParameter(name='zmin', value='0.001', format='float') + op2.addParameter(name='zmax', value='1', format='float') + op2.addParameter(name='save', value='/home/ci-81/Pictures', format='str') + op2.addParameter(name='colormap', value='jet', format='str') + op2.addParameter(name='show', value='1', format='bool') + op3 = proc1.addOperation(name='PlotSNRData', optype='other') op3.addParameter(name='wintitle', value='HF System SNR0', format='str') op3.addParameter(name='save', value='/home/ci-81/Pictures', format='str') - op3.addParameter(name='show', value='0', format='bool') + op3.addParameter(name='show', value='1', format='bool') op3.addParameter(name='zmin', value='-10', format='int') op3.addParameter(name='zmax', value='30', format='int') op3.addParameter(name='SNRthresh', value='0', format='float') op3.addParameter(name='ind_plt_ch',value='1',format = 'bool') - # + op5 = proc1.addOperation(name='PlotDOPData', optype='other') op5.addParameter(name='wintitle', value='HF System DOP', format='str') op5.addParameter(name='save', value='/home/ci-81/Pictures', format='str') op5.addParameter(name='show', value='1', format='bool') - op5.addParameter(name='zmin', value='-120', format='float') - op5.addParameter(name='zmax', value='120', format='float') + op5.addParameter(name='zmin', value='-140', format='float') + op5.addParameter(name='zmax', value='140', format='float') op5.addParameter(name='colormap', value='RdBu_r', format='str') op5.addParameter(name='ind_plt_ch',value='1',format = 'bool') - """ - op4 = proc1.addOperation(name='PlotSNRData1', optype='other') - op4.addParameter(name='wintitle', value='HF System SNR1', format='str') - op4.addParameter(name='save', value='/home/ci-81/Pictures', format='str') - op4.addParameter(name='show', value='0', format='bool') - """ + + # op4 = proc1.addOperation(name='PlotSNRData1', optype='other') + # op4.addParameter(name='wintitle', value='HF System SNR1', format='str') + # op4.addParameter(name='save', value='/home/ci-81/Pictures', format='str') + # op4.addParameter(name='show', value='0', format='bool') + + op6 = proc1.addOperation(name='PlotPHASEData', optype='other') + op6.addParameter(name='wintitle', value='HF System', format='str') + op6.addParameter(name='colormap', value='RdBu_r', format='str') + op6.addParameter(name='zmin', value='-180', format='float') + op6.addParameter(name='zmax', value='180', format='float') + op6.addParameter(name='save', value='/home/ci-81/Pictures', format='str') + op6.addParameter(name='show', value='1', format='bool') + op6.addParameter(name='ind_plt_ch',value='0',format = 'bool') + """ """ controllerObj.start() diff --git a/schainpy/scripts/schain.xml b/schainpy/scripts/schain.xml index 36900b6..78a056f 100644 --- a/schainpy/scripts/schain.xml +++ b/schainpy/scripts/schain.xml @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file