@@ -1527,11 +1527,12 class PulsePair_vRF(Operation): | |||||
1527 | removeDC = False |
|
1527 | removeDC = False | |
1528 | ipp = None |
|
1528 | ipp = None | |
1529 | lambda_ = 0 |
|
1529 | lambda_ = 0 | |
|
1530 | wradar = False | |||
1530 |
|
1531 | |||
1531 | def __init__(self,**kwargs): |
|
1532 | def __init__(self,**kwargs): | |
1532 | Operation.__init__(self,**kwargs) |
|
1533 | Operation.__init__(self,**kwargs) | |
1533 |
|
1534 | |||
1534 | def setup(self, dataOut, n = None, removeDC=False): |
|
1535 | def setup(self, dataOut, n = None, removeDC=False,wradar=False): | |
1535 | ''' |
|
1536 | ''' | |
1536 | n= Numero de PRF's de entrada |
|
1537 | n= Numero de PRF's de entrada | |
1537 | ''' |
|
1538 | ''' | |
@@ -1613,7 +1614,7 class PulsePair_vRF(Operation): | |||||
1613 | dc= numpy.tile(tmp,[1,self.__nProf,1]) |
|
1614 | dc= numpy.tile(tmp,[1,self.__nProf,1]) | |
1614 | self.__buffer = self.__buffer - dc |
|
1615 | self.__buffer = self.__buffer - dc | |
1615 | #------------------Calculo de Potencia ------------------------ |
|
1616 | #------------------Calculo de Potencia ------------------------ | |
1616 |
pair0 = self.__buffer*numpy.conj(self.__buffer) |
|
1617 | pair0 = self.__buffer*numpy.conj(self.__buffer)#* 10.0 | |
1617 | pair0 = pair0.real |
|
1618 | pair0 = pair0.real | |
1618 | lag_0 = numpy.sum(pair0,1) |
|
1619 | lag_0 = numpy.sum(pair0,1) | |
1619 | #-----------------Calculo de Cscp------------------------------ New |
|
1620 | #-----------------Calculo de Cscp------------------------------ New | |
@@ -1644,9 +1645,10 class PulsePair_vRF(Operation): | |||||
1644 | else: |
|
1645 | else: | |
1645 | data_ccf = 0 |
|
1646 | data_ccf = 0 | |
1646 | #------------------ Senal -------------------------------------------------- |
|
1647 | #------------------ Senal -------------------------------------------------- | |
1647 | data_intensity = pair0/pwcode - noise_buffer |
|
1648 | data_intensity = pair0/(self.nCohInt*pwcode) - noise_buffer | |
1648 |
data_intensity = numpy.sum(data_intensity,axis=1) |
|
1649 | data_intensity = numpy.sum(data_intensity,axis=1)/(self.n)#*(self.n*self.nCohInt) | |
1649 | #data_intensity = (lag_0-self.noise*self.n)*(self.n*self.nCohInt) |
|
1650 | #data_intensity = (lag_0-self.noise*self.n)*(self.n*self.nCohInt) | |
|
1651 | #print("data_intensity",data_intensity) | |||
1650 | for i in range(self.__nch): |
|
1652 | for i in range(self.__nch): | |
1651 | for j in range(self.__nHeis): |
|
1653 | for j in range(self.__nHeis): | |
1652 | if data_intensity[i][j] < 0: |
|
1654 | if data_intensity[i][j] < 0: | |
@@ -1663,7 +1665,7 class PulsePair_vRF(Operation): | |||||
1663 | S = lag_0-self.noise |
|
1665 | S = lag_0-self.noise | |
1664 |
|
1666 | |||
1665 | #---------------- Frecuencia Doppler promedio --------------------- |
|
1667 | #---------------- Frecuencia Doppler promedio --------------------- | |
1666 |
lag_1 = lag_1/((self.n-1)* |
|
1668 | lag_1 = lag_1/((self.n-1)*pwcode*self.nCohInt) | |
1667 | R1 = numpy.abs(lag_1) |
|
1669 | R1 = numpy.abs(lag_1) | |
1668 |
|
1670 | |||
1669 | #---------------- Calculo del SNR---------------------------------- |
|
1671 | #---------------- Calculo del SNR---------------------------------- | |
@@ -1675,10 +1677,10 class PulsePair_vRF(Operation): | |||||
1675 |
|
1677 | |||
1676 | #----------------- Calculo del ancho espectral ---------------------- |
|
1678 | #----------------- Calculo del ancho espectral ---------------------- | |
1677 | L = S/R1 |
|
1679 | L = S/R1 | |
1678 |
L = numpy.where(L<0, |
|
1680 | L = numpy.where(L<0,numpy.nan,L) | |
1679 | L = numpy.log(L) |
|
1681 | L = numpy.log(L) | |
1680 | tmp = numpy.sqrt(numpy.absolute(L)) |
|
1682 | tmp = numpy.sqrt(numpy.absolute(L)) | |
1681 |
data_specwidth = (self.lambda_/(2*math.sqrt(2)*math.pi*self.ippSec*self.nCohInt))*tmp |
|
1683 | data_specwidth = (self.lambda_/(2*math.sqrt(2)*math.pi*self.ippSec*self.nCohInt))*tmp | |
1682 | n = self.__profIndex |
|
1684 | n = self.__profIndex | |
1683 |
|
1685 | |||
1684 | self.__buffer = numpy.zeros((self.__nch, self.__nProf,self.__nHeis), dtype='complex') |
|
1686 | self.__buffer = numpy.zeros((self.__nch, self.__nProf,self.__nHeis), dtype='complex') | |
@@ -1723,27 +1725,23 class PulsePair_vRF(Operation): | |||||
1723 |
|
1725 | |||
1724 | return data_power, data_intensity, data_velocity, data_snrPP,data_specwidth,data_ccf, avgdatatime |
|
1726 | return data_power, data_intensity, data_velocity, data_snrPP,data_specwidth,data_ccf, avgdatatime | |
1725 |
|
1727 | |||
1726 | def run(self, dataOut,n = None,removeDC= False, overlapping= False,**kwargs): |
|
1728 | def run(self, dataOut,n = None,removeDC= False, overlapping= False,wradar=False,**kwargs): | |
1727 |
|
1729 | |||
1728 | if dataOut.flagDataAsBlock: |
|
1730 | if dataOut.flagDataAsBlock: | |
1729 | n = int(dataOut.nProfiles) |
|
1731 | n = int(dataOut.nProfiles) | |
1730 | #print("n",n) |
|
1732 | #print("n",n) | |
1731 |
|
1733 | |||
1732 | if not self.isConfig: |
|
1734 | if not self.isConfig: | |
1733 | self.setup(dataOut = dataOut, n = n , removeDC=removeDC , **kwargs) |
|
1735 | self.setup(dataOut = dataOut, n = n , removeDC=removeDC , wradar=wradar,**kwargs) | |
1734 | self.isConfig = True |
|
1736 | self.isConfig = True | |
1735 |
|
1737 | |||
1736 |
|
||||
1737 | data_power, data_intensity, data_velocity,data_snrPP,data_specwidth,data_ccf, avgdatatime = self.pulsePairOp(dataOut, n, dataOut.utctime) |
|
1738 | data_power, data_intensity, data_velocity,data_snrPP,data_specwidth,data_ccf, avgdatatime = self.pulsePairOp(dataOut, n, dataOut.utctime) | |
1738 |
|
||||
1739 |
|
||||
1740 | dataOut.flagNoData = True |
|
1739 | dataOut.flagNoData = True | |
1741 |
|
1740 | |||
1742 | if self.__dataReady: |
|
1741 | if self.__dataReady: | |
1743 | ###print("READY ----------------------------------") |
|
|||
1744 | dataOut.nCohInt *= self.n |
|
1742 | dataOut.nCohInt *= self.n | |
|
1743 | dataOut.dataPP_POWER = data_power# P valor que corresponde a POTENCIA MOMENTO | |||
1745 | dataOut.dataPP_POW = data_intensity # S |
|
1744 | dataOut.dataPP_POW = data_intensity # S | |
1746 | dataOut.dataPP_POWER = data_power # P valor que corresponde a POTENCIA MOMENTO |
|
|||
1747 | dataOut.dataPP_DOP = data_velocity |
|
1745 | dataOut.dataPP_DOP = data_velocity | |
1748 | dataOut.dataPP_SNR = data_snrPP |
|
1746 | dataOut.dataPP_SNR = data_snrPP | |
1749 | dataOut.dataPP_WIDTH = data_specwidth |
|
1747 | dataOut.dataPP_WIDTH = data_specwidth |
General Comments 0
You need to be logged in to leave comments.
Login now