##// END OF EJS Templates
Optimizacion de Salvado de Spectros...
Daniel Valdez -
r404:334499cc45be
parent child
Show More
@@ -380,4 +380,4 def draw(fig):
380 380 if type(fig) == 'int':
381 381 raise ValueError, "This parameter should be of tpye matplotlib figure"
382 382
383 fig.canvas.draw() No newline at end of file
383 fig.canvas.draw()
@@ -2407,7 +2407,10 class SpectraWriter(JRODataWriter):
2407 2407 data.tofile(self.fp)
2408 2408
2409 2409 self.data_spc.fill(0)
2410 self.data_dc.fill(0)
2410
2411 if self.data_dc != None:
2412 self.data_dc.fill(0)
2413
2411 2414 if self.data_cspc != None:
2412 2415 self.data_cspc.fill(0)
2413 2416
@@ -2447,7 +2450,8 class SpectraWriter(JRODataWriter):
2447 2450 self.setBasicHeader()
2448 2451
2449 2452 self.data_spc = self.dataOut.data_spc.copy()
2450 self.data_cspc = self.dataOut.data_cspc.copy()
2453 if self.dataOut.data_cspc != None:
2454 self.data_cspc = self.dataOut.data_cspc.copy()
2451 2455 self.data_dc = self.dataOut.data_dc.copy()
2452 2456
2453 2457 # #self.processingHeaderObj.dataBlocksPerFile)
@@ -2580,11 +2584,13 class SpectraWriter(JRODataWriter):
2580 2584 for channel in range(self.dataOut.nChannels):
2581 2585 channelList.append(channel)
2582 2586 channelList.append(channel)
2583
2587
2584 2588 pairsList = []
2585 for pair in self.dataOut.pairsList:
2586 pairsList.append(pair[0])
2587 pairsList.append(pair[1])
2589 if self.dataOut.nPairs > 0:
2590 for pair in self.dataOut.pairsList:
2591 pairsList.append(pair[0])
2592 pairsList.append(pair[1])
2593
2588 2594 spectraComb = channelList + pairsList
2589 2595 spectraComb = numpy.array(spectraComb,dtype="u1")
2590 2596 self.processingHeaderObj.spectraComb = spectraComb
@@ -4,7 +4,7 from graphics.figure import *
4 4 def isRealtime(utcdatatime):
5 5 utcnow = time.mktime(datetime.datetime.utcnow().timetuple())
6 6 delta = utcnow - utcdatatime # abs
7 if delta >= 5*60.:
7 if delta >= 30.:
8 8 return False
9 9 return True
10 10
@@ -497,6 +497,11 class SpectraPlot(Figure):
497 497 zmax : None
498 498 """
499 499
500 if dataOut.realtime:
501 if not(isRealtime(utcdatatime = dataOut.utctime)):
502 print 'Skipping this plot function'
503 return
504
500 505 if channelList == None:
501 506 channelIndexList = dataOut.channelIndexList
502 507 else:
@@ -751,7 +751,7 class SpectraProc(ProcessingUnit):
751 751 self.buffer
752 752 self.dataOut.flagNoData
753 753 """
754 fft_volt = numpy.fft.fft(self.buffer,axis=1)
754 fft_volt = numpy.fft.fft(self.buffer,n=self.dataOut.nFFTPoints,axis=1)
755 755 fft_volt = fft_volt.astype(numpy.dtype('complex'))
756 756 dc = fft_volt[:,0,:]
757 757
@@ -780,7 +780,7 class SpectraProc(ProcessingUnit):
780 780 self.dataOut.blockSize = blocksize
781 781 self.dataOut.flagShiftFFT = False
782 782
783 def init(self, nFFTPoints=None, pairsList=None):
783 def init(self, nProfiles, nFFTPoints=None, pairsList=None):
784 784
785 785 self.dataOut.flagNoData = True
786 786
@@ -804,7 +804,7 class SpectraProc(ProcessingUnit):
804 804
805 805 if self.buffer == None:
806 806 self.buffer = numpy.zeros((self.dataIn.nChannels,
807 self.dataOut.nFFTPoints,
807 nProfiles,
808 808 self.dataIn.nHeights),
809 809 dtype='complex')
810 810
General Comments 0
You need to be logged in to leave comments. Login now