From fed0fad1169f591dda50178baec6e43dda8ae875 2023-03-29 21:19:19 From: Juan C. Espinoza Date: 2023-03-29 21:19:19 Subject: [PATCH] Remove numpy.complex --- diff --git a/schainpy/model/proc/jroproc_parameters.py b/schainpy/model/proc/jroproc_parameters.py index c7b41ed..b0c16b5 100644 --- a/schainpy/model/proc/jroproc_parameters.py +++ b/schainpy/model/proc/jroproc_parameters.py @@ -1419,8 +1419,8 @@ class SpectralMoments(Operation): absc = dataOut.abscissaList[:-1] noise = dataOut.noise - nChannel = data.shape[0] - data_param = numpy.zeros((nChannel, 8, data.shape[2])) + nChannel = dataOut.data_pre[0].shape[0] + data_param = numpy.zeros((nChannel, 4 + proc_type*3, dataOut.data_pre[0].shape[2])) if proc_type == 1: fwindow = numpy.zeros(absc.size) + 1 @@ -1449,7 +1449,7 @@ class SpectralMoments(Operation): smooth=None for ind in range(nChannel): - data_param[ind,:,:] = self.__calculateMoments( data[ind,:,:] , absc , noise[ind], nicoh=nIncohInt, smooth=smooth, type1=type1, fwindow=fwindow, id_ch=ind) + data_param[ind,:,:] = self.__calculateMoments( data[ind,:,:] , absc , noise[ind], nicoh=nIncohInt, smooth=smooth, type1=type1, fwindow=fwindow) if proc_type == 1: dataOut.moments = data_param[:,1:,:] diff --git a/schainpy/model/proc/jroproc_spectra.py b/schainpy/model/proc/jroproc_spectra.py index d078dfe..66790b1 100644 --- a/schainpy/model/proc/jroproc_spectra.py +++ b/schainpy/model/proc/jroproc_spectra.py @@ -666,7 +666,7 @@ class removeInterference(Operation): median_imag = int(numpy.median(numpy.imag( junkcspc_interf[mask_prof[ind[list(range(3 * num_prof // 4))]], :]))) comp_mask_prof = [int(e) for e in comp_mask_prof] - junkcspc_interf[comp_mask_prof, :] = numpy.complex( + junkcspc_interf[comp_mask_prof, :] = complex( median_real, median_imag) for iprof in range(num_prof): diff --git a/schainpy/model/proc/jroproc_spectra_acf.py b/schainpy/model/proc/jroproc_spectra_acf.py index 6814d0c..e5e610a 100644 --- a/schainpy/model/proc/jroproc_spectra_acf.py +++ b/schainpy/model/proc/jroproc_spectra_acf.py @@ -610,7 +610,7 @@ class SpectraAFCProc(ProcessingUnit): median_real = numpy.median(numpy.real(junkcspc_interf[mask_prof[ind[list(range(3 * num_prof / 4))]], :])) median_imag = numpy.median(numpy.imag(junkcspc_interf[mask_prof[ind[list(range(3 * num_prof / 4))]], :])) - junkcspc_interf[comp_mask_prof, :] = numpy.complex(median_real, median_imag) + junkcspc_interf[comp_mask_prof, :] = complex(median_real, median_imag) for iprof in range(num_prof): ind = numpy.abs(junkcspc_interf[iprof, :]).ravel().argsort() diff --git a/schainpy/model/proc/jroproc_spectra_lags.py b/schainpy/model/proc/jroproc_spectra_lags.py index 59e6c05..1213f7e 100644 --- a/schainpy/model/proc/jroproc_spectra_lags.py +++ b/schainpy/model/proc/jroproc_spectra_lags.py @@ -613,7 +613,7 @@ class SpectraLagsProc(ProcessingUnit): median_real = numpy.median(numpy.real(junkcspc_interf[mask_prof[ind[list(range(3 * num_prof / 4))]], :])) median_imag = numpy.median(numpy.imag(junkcspc_interf[mask_prof[ind[list(range(3 * num_prof / 4))]], :])) - junkcspc_interf[comp_mask_prof, :] = numpy.complex(median_real, median_imag) + junkcspc_interf[comp_mask_prof, :] = complex(median_real, median_imag) for iprof in range(num_prof): ind = numpy.abs(junkcspc_interf[iprof, :]).ravel().argsort() diff --git a/schainpy/model/proc/jroproc_voltage.py b/schainpy/model/proc/jroproc_voltage.py index f424d2d..c941f20 100644 --- a/schainpy/model/proc/jroproc_voltage.py +++ b/schainpy/model/proc/jroproc_voltage.py @@ -2996,7 +2996,7 @@ class CohInt(Operation): def integrateByBlock(self, dataOut): times = int(dataOut.data.shape[1]/self.n) - avgdata = numpy.zeros((dataOut.nChannels, times, dataOut.nHeights), dtype=numpy.complex) + avgdata = numpy.zeros((dataOut.nChannels, times, dataOut.nHeights), dtype=complex) id_min = 0 id_max = self.n @@ -3236,8 +3236,8 @@ class SSheightProfiles(Operation): self.bufferShape = int(shape[0]), int(numberSamples), int(numberProfile) # nchannels, nsamples , nprofiles self.profileShape = int(shape[0]), int(numberProfile), int(numberSamples) # nchannels, nprofiles, nsamples - self.buffer = numpy.zeros(self.bufferShape , dtype=numpy.complex) - self.sshProfiles = numpy.zeros(self.profileShape, dtype=numpy.complex) + self.buffer = numpy.zeros(self.bufferShape , dtype=complex) + self.sshProfiles = numpy.zeros(self.profileShape, dtype=complex) def run(self, dataOut, step, nsamples, code = None, repeat = None): #print(dataOut.profileIndex) @@ -3475,7 +3475,7 @@ class Decoder(Operation): raise ValueError('Number of heights (%d) should be greater than number of bauds (%d)' %(self.__nHeis, self.nBaud)) #Frequency - __codeBuffer = numpy.zeros((self.nCode, self.__nHeis), dtype=numpy.complex) + __codeBuffer = numpy.zeros((self.nCode, self.__nHeis), dtype=complex) __codeBuffer[:,0:self.nBaud] = self.code @@ -3485,7 +3485,7 @@ class Decoder(Operation): self.ndatadec = self.__nHeis #- self.nBaud + 1 - self.datadecTime = numpy.zeros((self.__nChannels, self.__nProfiles, self.ndatadec), dtype=numpy.complex) + self.datadecTime = numpy.zeros((self.__nChannels, self.__nProfiles, self.ndatadec), dtype=complex) else: @@ -3493,7 +3493,7 @@ class Decoder(Operation): self.ndatadec = self.__nHeis #- self.nBaud + 1 - self.datadecTime = numpy.zeros((self.__nChannels, self.ndatadec), dtype=numpy.complex) + self.datadecTime = numpy.zeros((self.__nChannels, self.ndatadec), dtype=complex) def __convolutionInFreq(self, data): @@ -3677,7 +3677,7 @@ class DecoderRoll(Operation): raise ValueError('Number of heights (%d) should be greater than number of bauds (%d)' %(self.__nHeis, self.nBaud)) #Frequency - __codeBuffer = numpy.zeros((self.nCode, self.__nHeis), dtype=numpy.complex) + __codeBuffer = numpy.zeros((self.nCode, self.__nHeis), dtype=complex) __codeBuffer[:,0:self.nBaud] = self.code @@ -3687,7 +3687,7 @@ class DecoderRoll(Operation): self.ndatadec = self.__nHeis #- self.nBaud + 1 - self.datadecTime = numpy.zeros((self.__nChannels, self.__nProfiles, self.ndatadec), dtype=numpy.complex) + self.datadecTime = numpy.zeros((self.__nChannels, self.__nProfiles, self.ndatadec), dtype=complex) else: @@ -3695,7 +3695,7 @@ class DecoderRoll(Operation): self.ndatadec = self.__nHeis #- self.nBaud + 1 - self.datadecTime = numpy.zeros((self.__nChannels, self.ndatadec), dtype=numpy.complex) + self.datadecTime = numpy.zeros((self.__nChannels, self.ndatadec), dtype=complex) def __convolutionInFreq(self, data): @@ -4373,7 +4373,7 @@ class CombineProfiles(Operation): # bufferList = [] # # for i in range(nChannels): -# bufferByChannel = collections.deque(numpy.zeros( buffer_size*nSamples, dtype=numpy.complex) + numpy.NAN, +# bufferByChannel = collections.deque(numpy.zeros( buffer_size*nSamples, dtype=complex) + numpy.NAN, # maxlen = buffer_size*nSamples) # # bufferList.append(bufferByChannel) @@ -4406,7 +4406,7 @@ class CombineProfiles(Operation): # dataOut.flagNoData = True # return # -# self.__arrayBuffer = numpy.zeros((self.__nChannels, self.__newNSamples), dtype = numpy.complex) +# self.__arrayBuffer = numpy.zeros((self.__nChannels, self.__newNSamples), dtype = complex) # self.__pulseFound = True # self.__startIndex = indexFound # @@ -6211,7 +6211,7 @@ class PulsePairVoltage(Operation): # bufferList = [] # # for i in range(nChannels): -# bufferByChannel = collections.deque(numpy.zeros( buffer_size*nSamples, dtype=numpy.complex) + numpy.NAN, +# bufferByChannel = collections.deque(numpy.zeros( buffer_size*nSamples, dtype=complex) + numpy.NAN, # maxlen = buffer_size*nSamples) # # bufferList.append(bufferByChannel) @@ -6244,7 +6244,7 @@ class PulsePairVoltage(Operation): # dataOut.flagNoData = True # return # -# self.__arrayBuffer = numpy.zeros((self.__nChannels, self.__newNSamples), dtype = numpy.complex) +# self.__arrayBuffer = numpy.zeros((self.__nChannels, self.__newNSamples), dtype = complex) # self.__pulseFound = True # self.__startIndex = indexFound #