@@ -380,4 +380,4 def draw(fig): | |||||
380 | if type(fig) == 'int': |
|
380 | if type(fig) == 'int': | |
381 | raise ValueError, "This parameter should be of tpye matplotlib figure" |
|
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 | data.tofile(self.fp) |
|
2407 | data.tofile(self.fp) | |
2408 |
|
2408 | |||
2409 | self.data_spc.fill(0) |
|
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 | if self.data_cspc != None: |
|
2414 | if self.data_cspc != None: | |
2412 | self.data_cspc.fill(0) |
|
2415 | self.data_cspc.fill(0) | |
2413 |
|
2416 | |||
@@ -2447,7 +2450,8 class SpectraWriter(JRODataWriter): | |||||
2447 | self.setBasicHeader() |
|
2450 | self.setBasicHeader() | |
2448 |
|
2451 | |||
2449 | self.data_spc = self.dataOut.data_spc.copy() |
|
2452 | self.data_spc = self.dataOut.data_spc.copy() | |
2450 |
|
|
2453 | if self.dataOut.data_cspc != None: | |
|
2454 | self.data_cspc = self.dataOut.data_cspc.copy() | |||
2451 | self.data_dc = self.dataOut.data_dc.copy() |
|
2455 | self.data_dc = self.dataOut.data_dc.copy() | |
2452 |
|
2456 | |||
2453 | # #self.processingHeaderObj.dataBlocksPerFile) |
|
2457 | # #self.processingHeaderObj.dataBlocksPerFile) | |
@@ -2580,11 +2584,13 class SpectraWriter(JRODataWriter): | |||||
2580 | for channel in range(self.dataOut.nChannels): |
|
2584 | for channel in range(self.dataOut.nChannels): | |
2581 | channelList.append(channel) |
|
2585 | channelList.append(channel) | |
2582 | channelList.append(channel) |
|
2586 | channelList.append(channel) | |
2583 |
|
|
2587 | ||
2584 | pairsList = [] |
|
2588 | pairsList = [] | |
2585 |
f |
|
2589 | if self.dataOut.nPairs > 0: | |
2586 | pairsList.append(pair[0]) |
|
2590 | for pair in self.dataOut.pairsList: | |
2587 |
pairsList.append(pair[ |
|
2591 | pairsList.append(pair[0]) | |
|
2592 | pairsList.append(pair[1]) | |||
|
2593 | ||||
2588 | spectraComb = channelList + pairsList |
|
2594 | spectraComb = channelList + pairsList | |
2589 | spectraComb = numpy.array(spectraComb,dtype="u1") |
|
2595 | spectraComb = numpy.array(spectraComb,dtype="u1") | |
2590 | self.processingHeaderObj.spectraComb = spectraComb |
|
2596 | self.processingHeaderObj.spectraComb = spectraComb |
@@ -4,7 +4,7 from graphics.figure import * | |||||
4 | def isRealtime(utcdatatime): |
|
4 | def isRealtime(utcdatatime): | |
5 | utcnow = time.mktime(datetime.datetime.utcnow().timetuple()) |
|
5 | utcnow = time.mktime(datetime.datetime.utcnow().timetuple()) | |
6 | delta = utcnow - utcdatatime # abs |
|
6 | delta = utcnow - utcdatatime # abs | |
7 |
if delta >= |
|
7 | if delta >= 30.: | |
8 | return False |
|
8 | return False | |
9 | return True |
|
9 | return True | |
10 |
|
10 | |||
@@ -497,6 +497,11 class SpectraPlot(Figure): | |||||
497 | zmax : None |
|
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 | if channelList == None: |
|
505 | if channelList == None: | |
501 | channelIndexList = dataOut.channelIndexList |
|
506 | channelIndexList = dataOut.channelIndexList | |
502 | else: |
|
507 | else: |
@@ -751,7 +751,7 class SpectraProc(ProcessingUnit): | |||||
751 | self.buffer |
|
751 | self.buffer | |
752 | self.dataOut.flagNoData |
|
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 | fft_volt = fft_volt.astype(numpy.dtype('complex')) |
|
755 | fft_volt = fft_volt.astype(numpy.dtype('complex')) | |
756 | dc = fft_volt[:,0,:] |
|
756 | dc = fft_volt[:,0,:] | |
757 |
|
757 | |||
@@ -780,7 +780,7 class SpectraProc(ProcessingUnit): | |||||
780 | self.dataOut.blockSize = blocksize |
|
780 | self.dataOut.blockSize = blocksize | |
781 | self.dataOut.flagShiftFFT = False |
|
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 | self.dataOut.flagNoData = True |
|
785 | self.dataOut.flagNoData = True | |
786 |
|
786 | |||
@@ -804,7 +804,7 class SpectraProc(ProcessingUnit): | |||||
804 |
|
804 | |||
805 | if self.buffer == None: |
|
805 | if self.buffer == None: | |
806 | self.buffer = numpy.zeros((self.dataIn.nChannels, |
|
806 | self.buffer = numpy.zeros((self.dataIn.nChannels, | |
807 |
|
|
807 | nProfiles, | |
808 | self.dataIn.nHeights), |
|
808 | self.dataIn.nHeights), | |
809 | dtype='complex') |
|
809 | dtype='complex') | |
810 |
|
810 |
General Comments 0
You need to be logged in to leave comments.
Login now