##// END OF EJS Templates
Decimating data for Spectra and RTI plot
Miguel Valdez -
r813:0ca7674ca107
parent child
Show More
@@ -72,3 +72,7 properly but the next days did not.
72 72 -jroproc_spectra_lags.py added to schainpy
73 73 -Bug fixed in schainGUI: ProcUnit was created with the same id in some cases.
74 74 -Bug fixed in jroHeaderIO: Header size validation.
75
76 2.2.4.1:
77 -jroIO_usrp.py is update to read Sandra's data
78 -decimation in Spectra and RTI plots is always enabled. No newline at end of file
@@ -618,11 +618,19 class ProcUnitConf():
618 618
619 619 kwargs[parmConfObj.name] = parmConfObj.getValue()
620 620
621 ini = time.time()
622
621 623 #print "\tRunning the '%s' operation with %s" %(opConfObj.name, opConfObj.id)
622 624 sts = self.procUnitObj.call(opType = opConfObj.type,
623 625 opName = opConfObj.name,
624 626 opId = opConfObj.id,
625 627 **kwargs)
628
629 # total_time = time.time() - ini
630 #
631 # if total_time > 0.002:
632 # print "%s::%s took %f seconds" %(self.name, opConfObj.name, total_time)
633
626 634 is_ok = is_ok or sts
627 635
628 636 return is_ok
@@ -309,8 +309,10 class Axes:
309 309 decimationx = None
310 310 decimationy = None
311 311
312 __MAXNUMX = 300
313 __MAXNUMY = 150
312 __MAXNUMX = 200
313 __MAXNUMY = 400
314
315 __MAXNUMTIME = 500
314 316
315 317 def __init__(self, *args):
316 318
@@ -471,7 +473,7 class Axes:
471 473 ymin=None, ymax=None,
472 474 zmin=None, zmax=None,
473 475 xlabel='', ylabel='',
474 title='', rti = False, colormap='jet',
476 title='', colormap='jet',
475 477 **kwargs):
476 478
477 479 """
@@ -491,8 +493,19 class Axes:
491 493 **kwargs : Los parametros aceptados son
492 494 ticksize=9,
493 495 cblabel=''
494 rti = True or False
495 496 """
497
498 #Decimating data
499 xlen = len(x)
500 ylen = len(y)
501
502 decimationx = numpy.floor(xlen/self.__MAXNUMX) + 1
503 decimationy = numpy.floor(ylen/self.__MAXNUMY) + 1
504
505 x_buffer = x[::decimationx]
506 y_buffer = y[::decimationy]
507 z_buffer = z[::decimationx, ::decimationy]
508 #===================================================
496 509
497 510 if self.__firsttime:
498 511
@@ -504,7 +517,9 class Axes:
504 517 if zmax == None: zmax = numpy.nanmax(z)
505 518
506 519
507 self.plot = self.__driver.createPcolor(self.ax, x, y, z,
520 self.plot = self.__driver.createPcolor(self.ax, x_buffer,
521 y_buffer,
522 z_buffer,
508 523 xmin, xmax,
509 524 ymin, ymax,
510 525 zmin, zmax,
@@ -524,15 +539,8 class Axes:
524 539 self.__firsttime = False
525 540 return
526 541
527 if rti:
528 self.__driver.addpcolor(self.ax, x, y, z, self.zmin, self.zmax,
529 xlabel=xlabel,
530 ylabel=ylabel,
531 title=title,
532 colormap=colormap)
533 return
534
535 self.__driver.pcolor(self.plot, z,
542 self.__driver.pcolor(self.plot,
543 z_buffer,
536 544 xlabel=xlabel,
537 545 ylabel=ylabel,
538 546 title=title)
@@ -549,7 +557,7 class Axes:
549 557 **kwargs):
550 558
551 559 if maxNumX == None:
552 maxNumX = self.__MAXNUMX
560 maxNumX = self.__MAXNUMTIME
553 561
554 562 if maxNumY == None:
555 563 maxNumY = self.__MAXNUMY
@@ -588,22 +596,18 class Axes:
588 596
589 597 self.x_buffer = numpy.hstack((self.x_buffer[:-1], x[0], x[-1]))
590 598 self.z_buffer = numpy.hstack((self.z_buffer, z))
599 z_buffer = self.z_buffer.reshape(-1,len(y))
591 600
592 if self.decimationx == None:
593 deltax = float(self.xmax - self.xmin)/maxNumX
594 deltay = float(self.ymax - self.ymin)/maxNumY
595
596 resolutionx = self.x_buffer[2]-self.x_buffer[0]
597 resolutiony = y[1]-y[0]
598
599 self.decimationx = numpy.ceil(deltax / resolutionx)
600 self.decimationy = numpy.ceil(deltay / resolutiony)
601 #Decimating data
602 xlen = len(self.x_buffer)
603 ylen = len(y)
601 604
602 z_buffer = self.z_buffer.reshape(-1,len(y))
605 decimationx = numpy.floor(xlen/maxNumX) + 1
606 decimationy = numpy.floor(ylen/maxNumY) + 1
603 607
604 x_buffer = self.x_buffer[::self.decimationx]
605 y_buffer = y[::self.decimationy]
606 z_buffer = z_buffer[::self.decimationx, ::self.decimationy]
608 x_buffer = self.x_buffer[::decimationx]
609 y_buffer = y[::decimationy]
610 z_buffer = z_buffer[::decimationx, ::decimationy]
607 611 #===================================================
608 612
609 613 x_buffer, y_buffer, z_buffer = self.__fillGaps(x_buffer, y_buffer, z_buffer)
General Comments 0
You need to be logged in to leave comments. Login now