##// END OF EJS Templates
Fix saving shifted pdata, add shift_fft parameter in SpectraProc to correct shifted pdata
jespinoza -
r1132:b323193ace39
parent child
Show More
@@ -263,7 +263,7 class SpectraReader(JRODataReader, ProcessingUnit):
263 263 dc = dc.reshape( (self.systemHeaderObj.nChannels, self.processingHeaderObj.nHeights) ) #transforma a un arreglo 2D
264 264
265 265
266 if not(self.processingHeaderObj.shif_fft):
266 if self.processingHeaderObj.shif_fft:
267 267 #desplaza a la derecha en el eje 2 determinadas posiciones
268 268 shift = int(self.processingHeaderObj.profilesPerBlock/2)
269 269 spc = numpy.roll( spc, shift , axis=2 )
@@ -510,7 +510,7 class SpectraWriter(JRODataWriter, Operation):
510 510 """
511 511
512 512 spc = numpy.transpose( self.data_spc, (0,2,1) )
513 if not( self.processingHeaderObj.shif_fft ):
513 if self.processingHeaderObj.shif_fft:
514 514 spc = numpy.roll( spc, self.processingHeaderObj.profilesPerBlock/2, axis=2 ) #desplaza a la derecha en el eje 2 determinadas posiciones
515 515 data = spc.reshape((-1))
516 516 data = data.astype(self.dtype[0])
@@ -519,7 +519,7 class SpectraWriter(JRODataWriter, Operation):
519 519 if self.data_cspc is not None:
520 520 data = numpy.zeros( self.shape_cspc_Buffer, self.dtype )
521 521 cspc = numpy.transpose( self.data_cspc, (0,2,1) )
522 if not( self.processingHeaderObj.shif_fft ):
522 if self.processingHeaderObj.shif_fft:
523 523 cspc = numpy.roll( cspc, self.processingHeaderObj.profilesPerBlock/2, axis=2 ) #desplaza a la derecha en el eje 2 determinadas posiciones
524 524 data['real'] = cspc.real
525 525 data['imag'] = cspc.imag
@@ -116,7 +116,7 class SpectraProc(ProcessingUnit):
116 116 self.dataOut.blockSize = blocksize
117 117 self.dataOut.flagShiftFFT = True
118 118
119 def run(self, nProfiles=None, nFFTPoints=None, pairsList=[], ippFactor=None):
119 def run(self, nProfiles=None, nFFTPoints=None, pairsList=[], ippFactor=None, shift_fft=False):
120 120
121 121 self.dataOut.flagNoData = True
122 122
@@ -126,6 +126,15 class SpectraProc(ProcessingUnit):
126 126 pairsList = itertools.combinations(self.dataOut.channelList, 2)
127 127 if self.dataOut.data_cspc is not None:
128 128 self.__selectPairs(pairsList)
129 if shift_fft:
130 #desplaza a la derecha en el eje 2 determinadas posiciones
131 shift = int(self.dataOut.nFFTPoints/2)
132 self.dataOut.data_spc = numpy.roll(self.dataOut.data_spc, shift , axis=1)
133
134 if self.dataOut.data_cspc is not None:
135 #desplaza a la derecha en el eje 2 determinadas posiciones
136 self.dataOut.data_cspc = numpy.roll(self.dataOut.cspc, shift, axis=1)
137
129 138 return True
130 139
131 140 if self.dataIn.type == "Voltage":
General Comments 0
You need to be logged in to leave comments. Login now