@@ -205,6 +205,7 class Plot(Operation): | |||
|
205 | 205 | self.ymax = kwargs.get('ymax', None) |
|
206 | 206 | self.yscale = kwargs.get('yscale', None) |
|
207 | 207 | self.xlabel = kwargs.get('xlabel', None) |
|
208 | self.attr_time = kwargs.get('attr_time', 'utctime') | |
|
208 | 209 | self.decimation = kwargs.get('decimation', None) |
|
209 | 210 | self.showSNR = kwargs.get('showSNR', False) |
|
210 | 211 | self.oneFigure = kwargs.get('oneFigure', True) |
@@ -468,7 +469,8 class Plot(Operation): | |||
|
468 | 469 | else: |
|
469 | 470 | if self.xaxis is 'time': |
|
470 | 471 | dt = self.getDateTime(self.data.max_time) |
|
471 | xmax = (dt.replace(hour=int(self.xmax), minute=59, second=59) - | |
|
472 | xmax = self.xmax - 1 | |
|
473 | xmax = (dt.replace(hour=int(xmax), minute=59, second=59) - | |
|
472 | 474 | datetime.datetime(1970, 1, 1) + datetime.timedelta(seconds=1)).total_seconds() |
|
473 | 475 | if self.data.localtime: |
|
474 | 476 | xmax += time.timezone |
@@ -477,11 +479,10 class Plot(Operation): | |||
|
477 | 479 | |
|
478 | 480 | ymin = self.ymin if self.ymin else numpy.nanmin(self.y) |
|
479 | 481 | ymax = self.ymax if self.ymax else numpy.nanmax(self.y) |
|
480 | #Y = numpy.array([1, 2, 5, 10, 20, 50, 100, 200, 500, 1000, 2000, 5000, 10000, 20000, 50000]) | |
|
481 | 482 | |
|
482 | #i = 1 if numpy.where( | |
|
483 | # abs(ymax-ymin) <= Y)[0][0] < 0 else numpy.where(abs(ymax-ymin) <= Y)[0][0] | |
|
484 | #ystep = Y[i] / 10. | |
|
483 | for n, ax in enumerate(self.axes): | |
|
484 | if ax.firsttime: | |
|
485 | ||
|
485 | 486 | dig = int(numpy.log10(ymax)) |
|
486 | 487 | if dig == 0: |
|
487 | 488 | digD = len(str(ymax)) - 2 |
@@ -513,8 +514,6 class Plot(Operation): | |||
|
513 | 514 | xstep = ((xmax + (10**(dig)))//10**(dig))*(10**(dig)) |
|
514 | 515 | xstep = xstep/5 |
|
515 | 516 | |
|
516 | for n, ax in enumerate(self.axes): | |
|
517 | if ax.firsttime: | |
|
518 | 517 | ax.set_facecolor(self.bgcolor) |
|
519 | 518 | ax.yaxis.set_major_locator(MultipleLocator(ystep)) |
|
520 | 519 | if self.xscale: |
@@ -606,15 +605,13 class Plot(Operation): | |||
|
606 | 605 | fig.canvas.draw() |
|
607 | 606 | if self.show: |
|
608 | 607 | fig.show() |
|
609 | figpause(0.1) | |
|
608 | # figpause(0.1) | |
|
610 | 609 | |
|
611 | 610 | if self.save: |
|
612 | 611 | self.save_figure(n) |
|
613 | 612 | |
|
614 | 613 | if self.plot_server: |
|
615 | 614 | self.send_to_server() |
|
616 | # t = Thread(target=self.send_to_server) | |
|
617 | # t.start() | |
|
618 | 615 | |
|
619 | 616 | def save_figure(self, n): |
|
620 | 617 | ''' |
@@ -736,10 +733,8 class Plot(Operation): | |||
|
736 | 733 | |
|
737 | 734 | if self.isConfig is False: |
|
738 | 735 | self.__setup(**kwargs) |
|
739 | if dataOut.type == 'Parameters': | |
|
740 |
|
|
|
741 | else: | |
|
742 | t = dataOut.utctime | |
|
736 | ||
|
737 | t = getattr(dataOut, self.attr_time) | |
|
743 | 738 | |
|
744 | 739 | if dataOut.useLocalTime: |
|
745 | 740 | self.getDateTime = datetime.datetime.fromtimestamp |
@@ -753,10 +748,11 class Plot(Operation): | |||
|
753 | 748 | if 'buffer' in self.plot_type: |
|
754 | 749 | if self.xmin is None: |
|
755 | 750 | self.tmin = t |
|
751 | self.xmin = self.getDateTime(t).hour | |
|
756 | 752 | else: |
|
757 | 753 | self.tmin = ( |
|
758 | 754 | self.getDateTime(t).replace( |
|
759 | hour=self.xmin, | |
|
755 | hour=int(self.xmin), | |
|
760 | 756 | minute=0, |
|
761 | 757 | second=0) - self.getDateTime(0)).total_seconds() |
|
762 | 758 | |
@@ -769,10 +765,7 class Plot(Operation): | |||
|
769 | 765 | self.poll = zmq.Poller() |
|
770 | 766 | self.poll.register(self.socket, zmq.POLLIN) |
|
771 | 767 | |
|
772 | if dataOut.type == 'Parameters': | |
|
773 | tm = dataOut.utctimeInit | |
|
774 | else: | |
|
775 | tm = dataOut.utctime | |
|
768 | tm = getattr(dataOut, self.attr_time) | |
|
776 | 769 | |
|
777 | 770 | if not dataOut.useLocalTime and self.localtime: |
|
778 | 771 | tm -= time.timezone |
General Comments 0
You need to be logged in to leave comments.
Login now