##// END OF EJS Templates
Optimizacion de graficos RTI y CoherenMap, aun no se aplican los cambios a las otras clases de ploteo....
Daniel Valdez -
r395:f907033f1e91
parent child
Show More
@@ -9,7 +9,7 class Figure:
9 __driver = mpldriver
9 __driver = mpldriver
10 fig = None
10 fig = None
11
11
12 idfigure = None
12 id = None
13 wintitle = None
13 wintitle = None
14 width = None
14 width = None
15 height = None
15 height = None
@@ -32,7 +32,7 class Figure:
32
32
33 def getFilename(self, name, ext='.png'):
33 def getFilename(self, name, ext='.png'):
34
34
35 path = '%s%03d' %(self.PREFIX, self.idfigure)
35 path = '%s%03d' %(self.PREFIX, self.id)
36 filename = '%s_%s%s' %(self.PREFIX, name, ext)
36 filename = '%s_%s%s' %(self.PREFIX, name, ext)
37
37
38 return os.path.join(path, filename)
38 return os.path.join(path, filename)
@@ -82,11 +82,11 class Figure:
82
82
83 return tmin, tmax
83 return tmin, tmax
84
84
85 def init(self, idfigure, nplots, wintitle):
85 def init(self, id, nplots, wintitle):
86
86
87 raise ValueError, "This method has been replaced with createFigure"
87 raise ValueError, "This method has been replaced with createFigure"
88
88
89 def createFigure(self, idfigure, wintitle, widthplot=None, heightplot=None, show=True):
89 def createFigure(self, id, wintitle, widthplot=None, heightplot=None, show=True):
90
90
91 """
91 """
92 Crea la figura de acuerdo al driver y parametros seleccionados seleccionados.
92 Crea la figura de acuerdo al driver y parametros seleccionados seleccionados.
@@ -94,7 +94,7 class Figure:
94 y self.HEIGHT y el numero de subplots (nrow, ncol)
94 y self.HEIGHT y el numero de subplots (nrow, ncol)
95
95
96 Input:
96 Input:
97 idfigure : Los parametros necesarios son
97 id : Los parametros necesarios son
98 wintitle :
98 wintitle :
99
99
100 """
100 """
@@ -105,13 +105,13 class Figure:
105 if heightplot == None:
105 if heightplot == None:
106 heightplot = self.HEIGHT
106 heightplot = self.HEIGHT
107
107
108 self.idfigure = idfigure
108 self.id = id
109
109
110 self.wintitle = wintitle
110 self.wintitle = wintitle
111
111
112 self.widthscreen, self.heightscreen = self.getScreenDim(widthplot, heightplot)
112 self.widthscreen, self.heightscreen = self.getScreenDim(widthplot, heightplot)
113
113
114 self.fig = self.__driver.createFigure(idfigure=self.idfigure,
114 self.fig = self.__driver.createFigure(id=self.id,
115 wintitle=self.wintitle,
115 wintitle=self.wintitle,
116 width=self.widthscreen,
116 width=self.widthscreen,
117 height=self.heightscreen,
117 height=self.heightscreen,
@@ -204,6 +204,9 class Axes:
204 x_buffer = None
204 x_buffer = None
205 z_buffer = None
205 z_buffer = None
206
206
207 __MAXNUMX = 1000
208 __MAXNUMY = 500
209
207 def __init__(self, *args):
210 def __init__(self, *args):
208
211
209 """
212 """
@@ -429,8 +432,14 class Axes:
429 zmin=None, zmax=None,
432 zmin=None, zmax=None,
430 xlabel='', ylabel='',
433 xlabel='', ylabel='',
431 title='', rti = False, colormap='jet',
434 title='', rti = False, colormap='jet',
435 maxNumX = None, maxNumY = None,
432 **kwargs):
436 **kwargs):
433
437
438 if maxNumX == None:
439 maxNumX = self.__MAXNUMX
440
441 if maxNumY == None:
442 maxNumY = self.__MAXNUMY
434
443
435 if self.__firsttime:
444 if self.__firsttime:
436 self.z_buffer = z
445 self.z_buffer = z
@@ -461,6 +470,16 class Axes:
461 if self.zmin == None: self.zmin = zmin
470 if self.zmin == None: self.zmin = zmin
462 if self.zmax == None: self.zmax = zmax
471 if self.zmax == None: self.zmax = zmax
463
472
473
474 deltax = (xmax - xmin)/maxNumX
475 deltay = (ymax - ymin)/maxNumY
476
477 resolutionx = x[1]-x[0]
478 resolutiony = y[1]-y[0]
479
480 self.decimationx = numpy.ceil(deltax / resolutionx)
481 self.decimationy = numpy.ceil(deltay / resolutiony)
482
464 self.__firsttime = False
483 self.__firsttime = False
465 return
484 return
466
485
@@ -477,13 +496,16 class Axes:
477
496
478 self.z_buffer = numpy.hstack((self.z_buffer, z))
497 self.z_buffer = numpy.hstack((self.z_buffer, z))
479
498
480 newydim = len(y)
481
482 # self.z_buffer = numpy.ma.masked_inside(self.z_buffer,0.99*self.__missing,1.01*self.__missing)
499 # self.z_buffer = numpy.ma.masked_inside(self.z_buffer,0.99*self.__missing,1.01*self.__missing)
500 ydim = len(y)
501 z_buffer = self.z_buffer.reshape(-1,ydim)
483
502
484 z_buffer = self.z_buffer.reshape(-1,newydim)
503 x_buffer = self.x_buffer[::self.decimationx]
504 y_buffer = y[::self.decimationy]
505 z_buffer = z_buffer[::self.decimationx, ::self.decimationy]
506 #===================================================
485
507
486 self.__driver.addpcolorbuffer(self.ax, self.x_buffer, y, z_buffer, self.zmin, self.zmax,
508 self.__driver.addpcolorbuffer(self.ax, x_buffer, y_buffer, z_buffer, self.zmin, self.zmax,
487 xlabel=xlabel,
509 xlabel=xlabel,
488 ylabel=ylabel,
510 ylabel=ylabel,
489 title=title,
511 title=title,
@@ -18,10 +18,10 from matplotlib.ticker import *
18 #Actualizacion de las funciones del driver
18 #Actualizacion de las funciones del driver
19 ###########################################
19 ###########################################
20
20
21 def createFigure(idfigure, wintitle, width, height, facecolor="w", show=True):
21 def createFigure(id, wintitle, width, height, facecolor="w", show=True):
22
22
23 matplotlib.pyplot.ioff()
23 matplotlib.pyplot.ioff()
24 fig = matplotlib.pyplot.figure(num=idfigure, facecolor=facecolor)
24 fig = matplotlib.pyplot.figure(num=id, facecolor=facecolor)
25 fig.canvas.manager.set_window_title(wintitle)
25 fig.canvas.manager.set_window_title(wintitle)
26 fig.canvas.manager.resize(width, height)
26 fig.canvas.manager.resize(width, height)
27 matplotlib.pyplot.ion()
27 matplotlib.pyplot.ion()
@@ -36,7 +36,7 class CrossSpectraPlot(Figure):
36
36
37 return nrow, ncol
37 return nrow, ncol
38
38
39 def setup(self, idfigure, nplots, wintitle, showprofile=True, show=True):
39 def setup(self, id, nplots, wintitle, showprofile=True, show=True):
40
40
41 self.__showprofile = showprofile
41 self.__showprofile = showprofile
42 self.nplots = nplots
42 self.nplots = nplots
@@ -44,7 +44,7 class CrossSpectraPlot(Figure):
44 ncolspan = 1
44 ncolspan = 1
45 colspan = 1
45 colspan = 1
46
46
47 self.createFigure(idfigure = idfigure,
47 self.createFigure(id = id,
48 wintitle = wintitle,
48 wintitle = wintitle,
49 widthplot = self.WIDTH + self.WIDTHPROF,
49 widthplot = self.WIDTH + self.WIDTHPROF,
50 heightplot = self.HEIGHT + self.HEIGHTPROF,
50 heightplot = self.HEIGHT + self.HEIGHTPROF,
@@ -59,7 +59,7 class CrossSpectraPlot(Figure):
59
59
60 counter += 1
60 counter += 1
61
61
62 def run(self, dataOut, idfigure, wintitle="", pairsList=None, showprofile='True',
62 def run(self, dataOut, id, wintitle="", pairsList=None, showprofile='True',
63 xmin=None, xmax=None, ymin=None, ymax=None, zmin=None, zmax=None,
63 xmin=None, xmax=None, ymin=None, ymax=None, zmin=None, zmax=None,
64 save=False, figpath='./', figfile=None,
64 save=False, figpath='./', figfile=None,
65 power_cmap='jet', coherence_cmap='jet', phase_cmap='RdBu_r', show=True):
65 power_cmap='jet', coherence_cmap='jet', phase_cmap='RdBu_r', show=True):
@@ -68,7 +68,7 class CrossSpectraPlot(Figure):
68
68
69 Input:
69 Input:
70 dataOut :
70 dataOut :
71 idfigure :
71 id :
72 wintitle :
72 wintitle :
73 channelList :
73 channelList :
74 showProfile :
74 showProfile :
@@ -117,7 +117,7 class CrossSpectraPlot(Figure):
117
117
118 nplots = len(pairsIndexList)
118 nplots = len(pairsIndexList)
119
119
120 self.setup(idfigure=idfigure,
120 self.setup(id=id,
121 nplots=nplots,
121 nplots=nplots,
122 wintitle=wintitle,
122 wintitle=wintitle,
123 showprofile=showprofile,
123 showprofile=showprofile,
@@ -203,7 +203,7 class RTIPlot(Figure):
203 self.HEIGHT = 150
203 self.HEIGHT = 150
204 self.WIDTHPROF = 120
204 self.WIDTHPROF = 120
205 self.HEIGHTPROF = 0
205 self.HEIGHTPROF = 0
206 self.counterftp = 0
206 self.counter_imagwr = 0
207
207
208 def getSubplots(self):
208 def getSubplots(self):
209
209
@@ -212,7 +212,7 class RTIPlot(Figure):
212
212
213 return nrow, ncol
213 return nrow, ncol
214
214
215 def setup(self, idfigure, nplots, wintitle, showprofile=True, show=True):
215 def setup(self, id, nplots, wintitle, showprofile=True, show=True):
216
216
217 self.__showprofile = showprofile
217 self.__showprofile = showprofile
218 self.nplots = nplots
218 self.nplots = nplots
@@ -224,7 +224,7 class RTIPlot(Figure):
224 colspan = 6
224 colspan = 6
225 self.__nsubplots = 2
225 self.__nsubplots = 2
226
226
227 self.createFigure(idfigure = idfigure,
227 self.createFigure(id = id,
228 wintitle = wintitle,
228 wintitle = wintitle,
229 widthplot = self.WIDTH + self.WIDTHPROF,
229 widthplot = self.WIDTH + self.WIDTHPROF,
230 heightplot = self.HEIGHT + self.HEIGHTPROF,
230 heightplot = self.HEIGHT + self.HEIGHTPROF,
@@ -246,16 +246,16 class RTIPlot(Figure):
246
246
247 counter += 1
247 counter += 1
248
248
249 def run(self, dataOut, idfigure, wintitle="", channelList=None, showprofile='True',
249 def run(self, dataOut, id, wintitle="", channelList=None, showprofile='True',
250 xmin=None, xmax=None, ymin=None, ymax=None, zmin=None, zmax=None,
250 xmin=None, xmax=None, ymin=None, ymax=None, zmin=None, zmax=None,
251 timerange=None,
251 timerange=None,
252 save=False, figpath='./', figfile=None, ftp=False, ftpratio=1, show=True):
252 save=False, figpath='./', figfile=None, ftp=False, res_imagwr=1, show=True):
253
253
254 """
254 """
255
255
256 Input:
256 Input:
257 dataOut :
257 dataOut :
258 idfigure :
258 id :
259 wintitle :
259 wintitle :
260 channelList :
260 channelList :
261 showProfile :
261 showProfile :
@@ -302,7 +302,7 class RTIPlot(Figure):
302
302
303 nplots = len(channelIndexList)
303 nplots = len(channelIndexList)
304
304
305 self.setup(idfigure=idfigure,
305 self.setup(id=id,
306 nplots=nplots,
306 nplots=nplots,
307 wintitle=wintitle,
307 wintitle=wintitle,
308 showprofile=showprofile,
308 showprofile=showprofile,
@@ -341,16 +341,18 class RTIPlot(Figure):
341
341
342 if save:
342 if save:
343
343
344 if figfile == None:
344 self.counter_imagwr += 1
345 figfile = self.getFilename(name = self.name)
345 if (self.counter_imagwr==res_imagwr):
346
346
347 self.saveFigure(figpath, figfile)
347
348
348 fig_file = self.getFilename(name = self.name)
349 self.counterftp += 1
349 self.saveFigure(figpath, fig_file)
350 if (ftp and (self.counterftp==ftpratio)):
350 if ftp:
351 figfilename = os.path.join(figpath,figfile)
351 self.saveFigure(figpath, figfile)
352 self.sendByFTP(figfilename)
352 figfilename = os.path.join(figpath,figfile)
353 self.counterftp = 0
353 self.sendByFTP(figfilename)
354
355 self.counter_imagwr = 0
354
356
355 if x[1] + (x[1]-x[0]) >= self.axesList[0].xmax:
357 if x[1] + (x[1]-x[0]) >= self.axesList[0].xmax:
356 self.__isConfig = False
358 self.__isConfig = False
@@ -381,7 +383,7 class SpectraPlot(Figure):
381
383
382 return nrow, ncol
384 return nrow, ncol
383
385
384 def setup(self, idfigure, nplots, wintitle, showprofile=True, show=True):
386 def setup(self, id, nplots, wintitle, showprofile=True, show=True):
385
387
386 self.__showprofile = showprofile
388 self.__showprofile = showprofile
387 self.nplots = nplots
389 self.nplots = nplots
@@ -393,7 +395,7 class SpectraPlot(Figure):
393 colspan = 2
395 colspan = 2
394 self.__nsubplots = 2
396 self.__nsubplots = 2
395
397
396 self.createFigure(idfigure = idfigure,
398 self.createFigure(id = id,
397 wintitle = wintitle,
399 wintitle = wintitle,
398 widthplot = self.WIDTH + self.WIDTHPROF,
400 widthplot = self.WIDTH + self.WIDTHPROF,
399 heightplot = self.HEIGHT + self.HEIGHTPROF,
401 heightplot = self.HEIGHT + self.HEIGHTPROF,
@@ -415,7 +417,7 class SpectraPlot(Figure):
415
417
416 counter += 1
418 counter += 1
417
419
418 def run(self, dataOut, idfigure, wintitle="", channelList=None, showprofile='True',
420 def run(self, dataOut, id, wintitle="", channelList=None, showprofile='True',
419 xmin=None, xmax=None, ymin=None, ymax=None, zmin=None, zmax=None,
421 xmin=None, xmax=None, ymin=None, ymax=None, zmin=None, zmax=None,
420 save=False, figpath='./', figfile=None, show=True):
422 save=False, figpath='./', figfile=None, show=True):
421
423
@@ -423,7 +425,7 class SpectraPlot(Figure):
423
425
424 Input:
426 Input:
425 dataOut :
427 dataOut :
426 idfigure :
428 id :
427 wintitle :
429 wintitle :
428 channelList :
430 channelList :
429 showProfile :
431 showProfile :
@@ -466,7 +468,7 class SpectraPlot(Figure):
466
468
467 nplots = len(channelIndexList)
469 nplots = len(channelIndexList)
468
470
469 self.setup(idfigure=idfigure,
471 self.setup(id=id,
470 nplots=nplots,
472 nplots=nplots,
471 wintitle=wintitle,
473 wintitle=wintitle,
472 showprofile=showprofile,
474 showprofile=showprofile,
@@ -527,11 +529,11 class Scope(Figure):
527 ncol = 3
529 ncol = 3
528 return nrow, ncol
530 return nrow, ncol
529
531
530 def setup(self, idfigure, nplots, wintitle, show):
532 def setup(self, id, nplots, wintitle, show):
531
533
532 self.nplots = nplots
534 self.nplots = nplots
533
535
534 self.createFigure(idfigure=idfigure,
536 self.createFigure(id=id,
535 wintitle=wintitle,
537 wintitle=wintitle,
536 show=show)
538 show=show)
537
539
@@ -544,7 +546,7 class Scope(Figure):
544
546
545
547
546
548
547 def run(self, dataOut, idfigure, wintitle="", channelList=None,
549 def run(self, dataOut, id, wintitle="", channelList=None,
548 xmin=None, xmax=None, ymin=None, ymax=None, save=False,
550 xmin=None, xmax=None, ymin=None, ymax=None, save=False,
549 figpath='./', figfile=None, show=True):
551 figpath='./', figfile=None, show=True):
550
552
@@ -552,7 +554,7 class Scope(Figure):
552
554
553 Input:
555 Input:
554 dataOut :
556 dataOut :
555 idfigure :
557 id :
556 wintitle :
558 wintitle :
557 channelList :
559 channelList :
558 xmin : None,
560 xmin : None,
@@ -583,7 +585,7 class Scope(Figure):
583 if not self.__isConfig:
585 if not self.__isConfig:
584 nplots = len(channelIndexList)
586 nplots = len(channelIndexList)
585
587
586 self.setup(idfigure=idfigure,
588 self.setup(id=id,
587 nplots=nplots,
589 nplots=nplots,
588 wintitle=wintitle,
590 wintitle=wintitle,
589 show=show)
591 show=show)
@@ -635,14 +637,14 class PowerProfilePlot(Figure):
635
637
636 return nrow, ncol
638 return nrow, ncol
637
639
638 def setup(self, idfigure, nplots, wintitle, show):
640 def setup(self, id, nplots, wintitle, show):
639
641
640 self.nplots = nplots
642 self.nplots = nplots
641
643
642 ncolspan = 1
644 ncolspan = 1
643 colspan = 1
645 colspan = 1
644
646
645 self.createFigure(idfigure = idfigure,
647 self.createFigure(id = id,
646 wintitle = wintitle,
648 wintitle = wintitle,
647 widthplot = self.WIDTH,
649 widthplot = self.WIDTH,
648 heightplot = self.HEIGHT,
650 heightplot = self.HEIGHT,
@@ -655,7 +657,7 class PowerProfilePlot(Figure):
655 for x in range(ncol):
657 for x in range(ncol):
656 self.addAxes(nrow, ncol*ncolspan, y, x*ncolspan, colspan, 1)
658 self.addAxes(nrow, ncol*ncolspan, y, x*ncolspan, colspan, 1)
657
659
658 def run(self, dataOut, idfigure, wintitle="", channelList=None,
660 def run(self, dataOut, id, wintitle="", channelList=None,
659 xmin=None, xmax=None, ymin=None, ymax=None,
661 xmin=None, xmax=None, ymin=None, ymax=None,
660 save=False, figpath='./', figfile=None, show=True):
662 save=False, figpath='./', figfile=None, show=True):
661
663
@@ -687,7 +689,7 class PowerProfilePlot(Figure):
687
689
688 nplots = 1
690 nplots = 1
689
691
690 self.setup(idfigure=idfigure,
692 self.setup(id=id,
691 nplots=nplots,
693 nplots=nplots,
692 wintitle=wintitle,
694 wintitle=wintitle,
693 show=show)
695 show=show)
@@ -738,7 +740,7 class CoherenceMap(Figure):
738 self.HEIGHT = 150
740 self.HEIGHT = 150
739 self.WIDTHPROF = 120
741 self.WIDTHPROF = 120
740 self.HEIGHTPROF = 0
742 self.HEIGHTPROF = 0
741 self.counterftp = 0
743 self.counter_imagwr = 0
742
744
743 def getSubplots(self):
745 def getSubplots(self):
744 ncol = 1
746 ncol = 1
@@ -746,7 +748,7 class CoherenceMap(Figure):
746
748
747 return nrow, ncol
749 return nrow, ncol
748
750
749 def setup(self, idfigure, nplots, wintitle, showprofile=True, show=True):
751 def setup(self, id, nplots, wintitle, showprofile=True, show=True):
750 self.__showprofile = showprofile
752 self.__showprofile = showprofile
751 self.nplots = nplots
753 self.nplots = nplots
752
754
@@ -757,7 +759,7 class CoherenceMap(Figure):
757 colspan = 6
759 colspan = 6
758 self.__nsubplots = 2
760 self.__nsubplots = 2
759
761
760 self.createFigure(idfigure = idfigure,
762 self.createFigure(id = id,
761 wintitle = wintitle,
763 wintitle = wintitle,
762 widthplot = self.WIDTH + self.WIDTHPROF,
764 widthplot = self.WIDTH + self.WIDTHPROF,
763 heightplot = self.HEIGHT + self.HEIGHTPROF,
765 heightplot = self.HEIGHT + self.HEIGHTPROF,
@@ -773,10 +775,10 class CoherenceMap(Figure):
773 if showprofile:
775 if showprofile:
774 self.addAxes(nrow, ncol*ncolspan, y, x*ncolspan+colspan, 1, 1)
776 self.addAxes(nrow, ncol*ncolspan, y, x*ncolspan+colspan, 1, 1)
775
777
776 def run(self, dataOut, idfigure, wintitle="", pairsList=None, showprofile='True',
778 def run(self, dataOut, id, wintitle="", pairsList=None, showprofile='True',
777 xmin=None, xmax=None, ymin=None, ymax=None, zmin=None, zmax=None,
779 xmin=None, xmax=None, ymin=None, ymax=None, zmin=None, zmax=None,
778 timerange=None,
780 timerange=None,
779 save=False, figpath='./', figfile=None, ftp=False, ftpratio=1,
781 save=False, figpath='./', figfile=None, ftp=False, res_imagwr=1,
780 coherence_cmap='jet', phase_cmap='RdBu_r', show=True):
782 coherence_cmap='jet', phase_cmap='RdBu_r', show=True):
781
783
782 if pairsList == None:
784 if pairsList == None:
@@ -810,7 +812,7 class CoherenceMap(Figure):
810
812
811 if not self.__isConfig:
813 if not self.__isConfig:
812 nplots = len(pairsIndexList)
814 nplots = len(pairsIndexList)
813 self.setup(idfigure=idfigure,
815 self.setup(id=id,
814 nplots=nplots,
816 nplots=nplots,
815 wintitle=wintitle,
817 wintitle=wintitle,
816 showprofile=showprofile,
818 showprofile=showprofile,
@@ -881,16 +883,16 class CoherenceMap(Figure):
881
883
882 if save:
884 if save:
883
885
884 if figfile == None:
886 self.counter_imagwr += 1
885 figfile = self.getFilename(name = self.name)
887 if (self.counter_imagwr==res_imagwr):
886
888 fig_file = self.getFilename(name = self.name)
887 self.saveFigure(figpath, figfile)
889 self.saveFigure(figpath, fig_file)
888
890 if ftp:
889 self.counterftp += 1
891 self.saveFigure(figpath, figfile)
890 if (ftp and (self.counterftp==ftpratio)):
892 figfilename = os.path.join(figpath,figfile)
891 figfilename = os.path.join(figpath,figfile)
893 self.sendByFTP(figfilename)
892 self.sendByFTP(figfilename)
894
893 self.counterftp = 0
895 self.counter_imagwr = 0
894
896
895 if x[1] + (x[1]-x[0]) >= self.axesList[0].xmax:
897 if x[1] + (x[1]-x[0]) >= self.axesList[0].xmax:
896 self.__isConfig = False
898 self.__isConfig = False
@@ -922,7 +924,7 class RTIfromNoise(Figure):
922
924
923 return nrow, ncol
925 return nrow, ncol
924
926
925 def setup(self, idfigure, nplots, wintitle, showprofile=True, show=True):
927 def setup(self, id, nplots, wintitle, showprofile=True, show=True):
926
928
927 self.__showprofile = showprofile
929 self.__showprofile = showprofile
928 self.nplots = nplots
930 self.nplots = nplots
@@ -931,7 +933,7 class RTIfromNoise(Figure):
931 colspan = 6
933 colspan = 6
932 self.__nsubplots = 2
934 self.__nsubplots = 2
933
935
934 self.createFigure(idfigure = idfigure,
936 self.createFigure(id = id,
935 wintitle = wintitle,
937 wintitle = wintitle,
936 widthplot = self.WIDTH+self.WIDTHPROF,
938 widthplot = self.WIDTH+self.WIDTHPROF,
937 heightplot = self.HEIGHT+self.HEIGHTPROF,
939 heightplot = self.HEIGHT+self.HEIGHTPROF,
@@ -942,7 +944,7 class RTIfromNoise(Figure):
942 self.addAxes(nrow, ncol*ncolspan, 0, 0, colspan, 1)
944 self.addAxes(nrow, ncol*ncolspan, 0, 0, colspan, 1)
943
945
944
946
945 def run(self, dataOut, idfigure, wintitle="", channelList=None, showprofile='True',
947 def run(self, dataOut, id, wintitle="", channelList=None, showprofile='True',
946 xmin=None, xmax=None, ymin=None, ymax=None,
948 xmin=None, xmax=None, ymin=None, ymax=None,
947 timerange=None,
949 timerange=None,
948 save=False, figpath='./', figfile=None, show=True):
950 save=False, figpath='./', figfile=None, show=True):
@@ -978,7 +980,7 class RTIfromNoise(Figure):
978
980
979 nplots = 1
981 nplots = 1
980
982
981 self.setup(idfigure=idfigure,
983 self.setup(id=id,
982 nplots=nplots,
984 nplots=nplots,
983 wintitle=wintitle,
985 wintitle=wintitle,
984 showprofile=showprofile,
986 showprofile=showprofile,
@@ -1050,7 +1052,7 class SpectraHeisScope(Figure):
1050 self.HEIGHT = 250
1052 self.HEIGHT = 250
1051 self.WIDTHPROF = 120
1053 self.WIDTHPROF = 120
1052 self.HEIGHTPROF = 0
1054 self.HEIGHTPROF = 0
1053 self.counterftp = 0
1055 self.counter_imagwr = 0
1054
1056
1055 def getSubplots(self):
1057 def getSubplots(self):
1056
1058
@@ -1059,7 +1061,7 class SpectraHeisScope(Figure):
1059
1061
1060 return nrow, ncol
1062 return nrow, ncol
1061
1063
1062 def setup(self, idfigure, nplots, wintitle, show):
1064 def setup(self, id, nplots, wintitle, show):
1063
1065
1064 showprofile = False
1066 showprofile = False
1065 self.__showprofile = showprofile
1067 self.__showprofile = showprofile
@@ -1072,7 +1074,7 class SpectraHeisScope(Figure):
1072 colspan = 2
1074 colspan = 2
1073 self.__nsubplots = 2
1075 self.__nsubplots = 2
1074
1076
1075 self.createFigure(idfigure = idfigure,
1077 self.createFigure(id = id,
1076 wintitle = wintitle,
1078 wintitle = wintitle,
1077 widthplot = self.WIDTH + self.WIDTHPROF,
1079 widthplot = self.WIDTH + self.WIDTHPROF,
1078 heightplot = self.HEIGHT + self.HEIGHTPROF,
1080 heightplot = self.HEIGHT + self.HEIGHTPROF,
@@ -1107,11 +1109,11 class SpectraHeisScope(Figure):
1107 # ncol = 3
1109 # ncol = 3
1108 # return nrow, ncol
1110 # return nrow, ncol
1109 #
1111 #
1110 # def setup(self, idfigure, nplots, wintitle):
1112 # def setup(self, id, nplots, wintitle):
1111 #
1113 #
1112 # self.nplots = nplots
1114 # self.nplots = nplots
1113 #
1115 #
1114 # self.createFigure(idfigure, wintitle)
1116 # self.createFigure(id, wintitle)
1115 #
1117 #
1116 # nrow,ncol = self.getSubplots()
1118 # nrow,ncol = self.getSubplots()
1117 # colspan = 3
1119 # colspan = 3
@@ -1120,15 +1122,15 class SpectraHeisScope(Figure):
1120 # for i in range(nplots):
1122 # for i in range(nplots):
1121 # self.addAxes(nrow, ncol, i, 0, colspan, rowspan)
1123 # self.addAxes(nrow, ncol, i, 0, colspan, rowspan)
1122
1124
1123 def run(self, dataOut, idfigure, wintitle="", channelList=None,
1125 def run(self, dataOut, id, wintitle="", channelList=None,
1124 xmin=None, xmax=None, ymin=None, ymax=None, save=False,
1126 xmin=None, xmax=None, ymin=None, ymax=None, save=False,
1125 figpath='./', figfile=None, ftp=False, ftpratio=1, show=True):
1127 figpath='./', figfile=None, ftp=False, res_imagwr=1, show=True):
1126
1128
1127 """
1129 """
1128
1130
1129 Input:
1131 Input:
1130 dataOut :
1132 dataOut :
1131 idfigure :
1133 id :
1132 wintitle :
1134 wintitle :
1133 channelList :
1135 channelList :
1134 xmin : None,
1136 xmin : None,
@@ -1171,7 +1173,7 class SpectraHeisScope(Figure):
1171 if not self.__isConfig:
1173 if not self.__isConfig:
1172 nplots = len(channelIndexList)
1174 nplots = len(channelIndexList)
1173
1175
1174 self.setup(idfigure=idfigure,
1176 self.setup(id=id,
1175 nplots=nplots,
1177 nplots=nplots,
1176 wintitle=wintitle,
1178 wintitle=wintitle,
1177 show=show)
1179 show=show)
@@ -1203,11 +1205,11 class SpectraHeisScope(Figure):
1203
1205
1204 self.saveFigure(figpath, figfile)
1206 self.saveFigure(figpath, figfile)
1205
1207
1206 self.counterftp += 1
1208 self.counter_imagwr += 1
1207 if (ftp and (self.counterftp==ftpratio)):
1209 if (ftp and (self.counter_imagwr==res_imagwr)):
1208 figfilename = os.path.join(figpath,figfile)
1210 figfilename = os.path.join(figpath,figfile)
1209 self.sendByFTP(figfilename)
1211 self.sendByFTP(figfilename)
1210 self.counterftp = 0
1212 self.counter_imagwr = 0
1211
1213
1212
1214
1213 class RTIfromSpectraHeis(Figure):
1215 class RTIfromSpectraHeis(Figure):
@@ -1227,7 +1229,7 class RTIfromSpectraHeis(Figure):
1227 self.HEIGHT = 200
1229 self.HEIGHT = 200
1228 self.WIDTHPROF = 120
1230 self.WIDTHPROF = 120
1229 self.HEIGHTPROF = 0
1231 self.HEIGHTPROF = 0
1230 self.counterftp = 0
1232 self.counter_imagwr = 0
1231 self.xdata = None
1233 self.xdata = None
1232 self.ydata = None
1234 self.ydata = None
1233
1235
@@ -1238,7 +1240,7 class RTIfromSpectraHeis(Figure):
1238
1240
1239 return nrow, ncol
1241 return nrow, ncol
1240
1242
1241 def setup(self, idfigure, nplots, wintitle, showprofile=True, show=True):
1243 def setup(self, id, nplots, wintitle, showprofile=True, show=True):
1242
1244
1243 self.__showprofile = showprofile
1245 self.__showprofile = showprofile
1244 self.nplots = nplots
1246 self.nplots = nplots
@@ -1247,7 +1249,7 class RTIfromSpectraHeis(Figure):
1247 colspan = 6
1249 colspan = 6
1248 self.__nsubplots = 2
1250 self.__nsubplots = 2
1249
1251
1250 self.createFigure(idfigure = idfigure,
1252 self.createFigure(id = id,
1251 wintitle = wintitle,
1253 wintitle = wintitle,
1252 widthplot = self.WIDTH+self.WIDTHPROF,
1254 widthplot = self.WIDTH+self.WIDTHPROF,
1253 heightplot = self.HEIGHT+self.HEIGHTPROF,
1255 heightplot = self.HEIGHT+self.HEIGHTPROF,
@@ -1258,10 +1260,10 class RTIfromSpectraHeis(Figure):
1258 self.addAxes(nrow, ncol*ncolspan, 0, 0, colspan, 1)
1260 self.addAxes(nrow, ncol*ncolspan, 0, 0, colspan, 1)
1259
1261
1260
1262
1261 def run(self, dataOut, idfigure, wintitle="", channelList=None, showprofile='True',
1263 def run(self, dataOut, id, wintitle="", channelList=None, showprofile='True',
1262 xmin=None, xmax=None, ymin=None, ymax=None,
1264 xmin=None, xmax=None, ymin=None, ymax=None,
1263 timerange=None,
1265 timerange=None,
1264 save=False, figpath='./', figfile=None, ftp=False, ftpratio=1, show=True):
1266 save=False, figpath='./', figfile=None, ftp=False, res_imagwr=1, show=True):
1265
1267
1266 if channelList == None:
1268 if channelList == None:
1267 channelIndexList = dataOut.channelIndexList
1269 channelIndexList = dataOut.channelIndexList
@@ -1300,7 +1302,7 class RTIfromSpectraHeis(Figure):
1300
1302
1301 nplots = 1
1303 nplots = 1
1302
1304
1303 self.setup(idfigure=idfigure,
1305 self.setup(id=id,
1304 nplots=nplots,
1306 nplots=nplots,
1305 wintitle=wintitle,
1307 wintitle=wintitle,
1306 showprofile=showprofile,
1308 showprofile=showprofile,
@@ -1348,11 +1350,11 class RTIfromSpectraHeis(Figure):
1348
1350
1349 self.saveFigure(figpath, figfile)
1351 self.saveFigure(figpath, figfile)
1350
1352
1351 self.counterftp += 1
1353 self.counter_imagwr += 1
1352 if (ftp and (self.counterftp==ftpratio)):
1354 if (ftp and (self.counter_imagwr==res_imagwr)):
1353 figfilename = os.path.join(figpath,figfile)
1355 figfilename = os.path.join(figpath,figfile)
1354 self.sendByFTP(figfilename)
1356 self.sendByFTP(figfilename)
1355 self.counterftp = 0
1357 self.counter_imagwr = 0
1356
1358
1357 if x[1] + (x[1]-x[0]) >= self.axesList[0].xmax:
1359 if x[1] + (x[1]-x[0]) >= self.axesList[0].xmax:
1358 self.__isConfig = False
1360 self.__isConfig = False
General Comments 0
You need to be logged in to leave comments. Login now