diff --git a/schainpy/__init__.py b/schainpy/__init__.py index ce6e1df..6b50397 100644 --- a/schainpy/__init__.py +++ b/schainpy/__init__.py @@ -5,4 +5,4 @@ try: except: pass -__version__ = '3.0.0b5' +__version__ = '3.0.0b6' diff --git a/schainpy/model/proc/jroproc_spectra.py b/schainpy/model/proc/jroproc_spectra.py index db44b3d..fde1262 100644 --- a/schainpy/model/proc/jroproc_spectra.py +++ b/schainpy/model/proc/jroproc_spectra.py @@ -873,4 +873,26 @@ class IncohInt(Operation): dataOut.utctime = avgdatatime dataOut.flagNoData = False - return dataOut \ No newline at end of file + return dataOut + +class dopplerFlip(Operation): + + def run(self, dataOut): + # arreglo 1: (num_chan, num_profiles, num_heights) + self.dataOut = dataOut + # JULIA-oblicua, indice 2 + # arreglo 2: (num_profiles, num_heights) + jspectra = self.dataOut.data_spc[2] + jspectra_tmp = numpy.zeros(jspectra.shape) + num_profiles = jspectra.shape[0] + freq_dc = int(num_profiles / 2) + # Flip con for + for j in range(num_profiles): + jspectra_tmp[num_profiles-j-1]= jspectra[j] + # Intercambio perfil de DC con perfil inmediato anterior + jspectra_tmp[freq_dc-1]= jspectra[freq_dc-1] + jspectra_tmp[freq_dc]= jspectra[freq_dc] + # canal modificado es re-escrito en el arreglo de canales + self.dataOut.data_spc[2] = jspectra_tmp + + return self.dataOut \ No newline at end of file diff --git a/schainpy/model/proc/jroproc_voltage.py b/schainpy/model/proc/jroproc_voltage.py index 7a62196..9c71e4d 100644 --- a/schainpy/model/proc/jroproc_voltage.py +++ b/schainpy/model/proc/jroproc_voltage.py @@ -146,7 +146,7 @@ class selectChannels(Operation): class selectHeights(Operation): - def run(self, dataOut, minHei=None, maxHei=None): + def run(self, dataOut, minHei=None, maxHei=None, minIndex=None, maxIndex=None): """ Selecciona un bloque de datos en base a un grupo de valores de alturas segun el rango minHei <= height <= maxHei @@ -164,34 +164,30 @@ class selectHeights(Operation): self.dataOut = dataOut - if minHei == None: - minHei = self.dataOut.heightList[0] + if minHei and maxHei: - if maxHei == None: - maxHei = self.dataOut.heightList[-1] + if (minHei < self.dataOut.heightList[0]): + minHei = self.dataOut.heightList[0] - if (minHei < self.dataOut.heightList[0]): - minHei = self.dataOut.heightList[0] + if (maxHei > self.dataOut.heightList[-1]): + maxHei = self.dataOut.heightList[-1] - if (maxHei > self.dataOut.heightList[-1]): - maxHei = self.dataOut.heightList[-1] - - minIndex = 0 - maxIndex = 0 - heights = self.dataOut.heightList + minIndex = 0 + maxIndex = 0 + heights = self.dataOut.heightList - inda = numpy.where(heights >= minHei) - indb = numpy.where(heights <= maxHei) + inda = numpy.where(heights >= minHei) + indb = numpy.where(heights <= maxHei) - try: - minIndex = inda[0][0] - except: - minIndex = 0 + try: + minIndex = inda[0][0] + except: + minIndex = 0 - try: - maxIndex = indb[0][-1] - except: - maxIndex = len(heights) + try: + maxIndex = indb[0][-1] + except: + maxIndex = len(heights) self.selectHeightsByIndex(minIndex, maxIndex)