##// END OF EJS Templates
Correction to Spaced Antenna libraries
Julio Valdez -
r762:7c90b920ac51
parent child
Show More
@@ -37,7 +37,7 class CorrelationProc(ProcessingUnit):
37 self.dataOut.utctime = self.firstdatatime
37 self.dataOut.utctime = self.firstdatatime
38 self.dataOut.flagDecodeData = self.dataIn.flagDecodeData #asumo q la data esta decodificada
38 self.dataOut.flagDecodeData = self.dataIn.flagDecodeData #asumo q la data esta decodificada
39 self.dataOut.flagDeflipData = self.dataIn.flagDeflipData #asumo q la data esta sin flip
39 self.dataOut.flagDeflipData = self.dataIn.flagDeflipData #asumo q la data esta sin flip
40 # self.dataOut.nCohInt = self.dataIn.nCohInt
40 self.dataOut.nCohInt = self.dataIn.nCohInt
41 # self.dataOut.nIncohInt = 1
41 # self.dataOut.nIncohInt = 1
42 self.dataOut.ippSeconds = self.dataIn.ippSeconds
42 self.dataOut.ippSeconds = self.dataIn.ippSeconds
43 # self.dataOut.windowOfFilter = self.dataIn.windowOfFilter
43 # self.dataOut.windowOfFilter = self.dataIn.windowOfFilter
@@ -60,7 +60,7 class ParametersProc(ProcessingUnit):
60 self.dataOut.heightList = self.dataIn.getHeiRange()
60 self.dataOut.heightList = self.dataIn.getHeiRange()
61 self.dataOut.frequency = self.dataIn.frequency
61 self.dataOut.frequency = self.dataIn.frequency
62
62
63 def run(self, nSeconds = None, nProfiles = None):
63 def run(self, nSeconds = 100, nProfiles = None):
64
64
65
65
66
66
@@ -71,16 +71,20 class ParametersProc(ProcessingUnit):
71
71
72 if self.dataIn.type == "Voltage":
72 if self.dataIn.type == "Voltage":
73 self.dataOut.flagNoData = True
73 self.dataOut.flagNoData = True
74 if nSeconds != None:
74
75
76 if self.buffer == None:
75 self.nSeconds = nSeconds
77 self.nSeconds = nSeconds
76 self.nProfiles= int(numpy.floor(nSeconds/(self.dataIn.ippSeconds*self.dataIn.nCohInt)))
78 self.nProfiles= int(numpy.floor(nSeconds/(self.dataIn.ippSeconds*self.dataIn.nCohInt)))
79
80 self.buffer = numpy.zeros((self.dataIn.nChannels,
81 self.nProfiles,
82 self.dataIn.nHeights),
83 dtype='complex')
77
84
78 if self.buffer is None:
85 if self.profIndex == 7990:
79 self.buffer = numpy.zeros((self.dataIn.nChannels,
86 a = 1
80 self.nProfiles,
87
81 self.dataIn.nHeights),
82 dtype='complex')
83
84 self.buffer[:,self.profIndex,:] = self.dataIn.data.copy()
88 self.buffer[:,self.profIndex,:] = self.dataIn.data.copy()
85 self.profIndex += 1
89 self.profIndex += 1
86
90
@@ -131,7 +135,7 class ParametersProc(ProcessingUnit):
131 self.__updateObjFromInput()
135 self.__updateObjFromInput()
132 self.firstdatatime = None
136 self.firstdatatime = None
133 self.dataOut.utctimeInit = self.dataIn.utctime
137 self.dataOut.utctimeInit = self.dataIn.utctime
134 self.dataOut.outputInterval = self.dataIn.timeInterval
138 self.dataOut.paramInterval = self.dataIn.timeInterval
135
139
136 #------------------- Get Moments ----------------------------------
140 #------------------- Get Moments ----------------------------------
137 def GetMoments(self, channelList = None):
141 def GetMoments(self, channelList = None):
@@ -174,7 +178,7 class ParametersProc(ProcessingUnit):
174 elif (self.smooth < 3): smooth = 0
178 elif (self.smooth < 3): smooth = 0
175
179
176 if (type1 == None): type1 = 0
180 if (type1 == None): type1 = 0
177 if (fwindow is None): fwindow = numpy.zeros(oldfreq.size) + 1
181 if (fwindow == None): fwindow = numpy.zeros(oldfreq.size) + 1
178 if (snrth == None): snrth = -3
182 if (snrth == None): snrth = -3
179 if (dc == None): dc = 0
183 if (dc == None): dc = 0
180 if (aliasing == None): aliasing = 0
184 if (aliasing == None): aliasing = 0
@@ -559,7 +563,10 class ParametersProc(ProcessingUnit):
559 #***************************+ PASS DATA TO NEXT STEP **********************
563 #***************************+ PASS DATA TO NEXT STEP **********************
560 arrayFinal = arrayParameters.reshape((1,arrayParameters.shape[0],arrayParameters.shape[1]))
564 arrayFinal = arrayParameters.reshape((1,arrayParameters.shape[0],arrayParameters.shape[1]))
561 self.dataOut.data_param = arrayFinal
565 self.dataOut.data_param = arrayFinal
562
566
567 if arrayFinal == None:
568 self.dataOut.flagNoData = True
569
563 return
570 return
564
571
565 def __getHardwarePhaseDiff(self, voltage0, pairslist, newheis, n):
572 def __getHardwarePhaseDiff(self, voltage0, pairslist, newheis, n):
@@ -1051,6 +1058,10 class ParametersProc(ProcessingUnit):
1051 date = re.findall(r'\((.*?)\)', date)
1058 date = re.findall(r'\((.*?)\)', date)
1052 date = date[0].split(',')
1059 date = date[0].split(',')
1053 date = map(int, date)
1060 date = map(int, date)
1061
1062 if len(date)<6:
1063 date.append(0)
1064
1054 date = [date[0]*10000 + date[1]*100 + date[2], date[3]*10000 + date[4]*100 + date[5]]
1065 date = [date[0]*10000 + date[1]*100 + date[2], date[3]*10000 + date[4]*100 + date[5]]
1055 arrayDate = numpy.tile(date, (len(listMeteors), 1))
1066 arrayDate = numpy.tile(date, (len(listMeteors), 1))
1056
1067
@@ -1280,7 +1291,7 class ParametersProc(ProcessingUnit):
1280 error1 = p0*numpy.nan
1291 error1 = p0*numpy.nan
1281
1292
1282 #Save
1293 #Save
1283 if self.dataOut.data_param is None:
1294 if self.dataOut.data_param == None:
1284 self.dataOut.data_param = numpy.zeros((nGroups, p0.size, nHeights))*numpy.nan
1295 self.dataOut.data_param = numpy.zeros((nGroups, p0.size, nHeights))*numpy.nan
1285 self.dataOut.data_error = numpy.zeros((nGroups, p0.size + 1, nHeights))*numpy.nan
1296 self.dataOut.data_error = numpy.zeros((nGroups, p0.size + 1, nHeights))*numpy.nan
1286
1297
@@ -1580,9 +1591,12 class WindProfiler(Operation):
1580
1591
1581 Parameters affected: Winds
1592 Parameters affected: Winds
1582 '''
1593 '''
1583 print arrayMeteor.shape
1594 # print arrayMeteor.shape
1584 #Settings
1595 #Settings
1585 nInt = (heightMax - heightMin)/2
1596 nInt = (heightMax - heightMin)/2
1597 # print nInt
1598 nInt = int(nInt)
1599 # print nInt
1586 winds = numpy.zeros((2,nInt))*numpy.nan
1600 winds = numpy.zeros((2,nInt))*numpy.nan
1587
1601
1588 #Filter errors
1602 #Filter errors
@@ -1633,8 +1647,8 class WindProfiler(Operation):
1633 def run(self, dataOut, technique, **kwargs):
1647 def run(self, dataOut, technique, **kwargs):
1634
1648
1635 param = dataOut.data_param
1649 param = dataOut.data_param
1636 # if dataOut.abscissaList != None:
1650 if dataOut.abscissaList != None:
1637 # absc = dataOut.abscissaList[:-1]
1651 absc = dataOut.abscissaList[:-1]
1638 noise = dataOut.noise
1652 noise = dataOut.noise
1639 heightList = dataOut.heightList
1653 heightList = dataOut.heightList
1640 SNR = dataOut.data_SNR
1654 SNR = dataOut.data_SNR
@@ -1726,7 +1740,7 class WindProfiler(Operation):
1726
1740
1727 self.__isConfig = True
1741 self.__isConfig = True
1728
1742
1729 if self.__buffer is None:
1743 if self.__buffer == None:
1730 self.__buffer = dataOut.data_param
1744 self.__buffer = dataOut.data_param
1731 self.__firstdata = copy.copy(dataOut)
1745 self.__firstdata = copy.copy(dataOut)
1732
1746
@@ -1837,7 +1851,7 class PhaseCalibration(Operation):
1837
1851
1838 def __getGammas(self, pairs, k, d, phases):
1852 def __getGammas(self, pairs, k, d, phases):
1839 gammas = numpy.zeros(2)
1853 gammas = numpy.zeros(2)
1840
1854
1841 for i in range(len(pairs)):
1855 for i in range(len(pairs)):
1842
1856
1843 pairi = pairs[i]
1857 pairi = pairs[i]
@@ -1859,7 +1873,7 class PhaseCalibration(Operation):
1859 phasesX = phaseHisto[1][:-1]
1873 phasesX = phaseHisto[1][:-1]
1860 width = phasesX[1] - phasesX[0]
1874 width = phasesX[1] - phasesX[0]
1861 phasesX += width/2
1875 phasesX += width/2
1862
1876
1863 #Gaussian aproximation
1877 #Gaussian aproximation
1864 bpeak = meteorsY.argmax()
1878 bpeak = meteorsY.argmax()
1865 peak = meteorsY.max()
1879 peak = meteorsY.max()
@@ -1878,8 +1892,7 class PhaseCalibration(Operation):
1878
1892
1879 #Gammas
1893 #Gammas
1880 gammas[i] = coeff[0][1]
1894 gammas[i] = coeff[0][1]
1881 # gammas[i] = bpeak
1895
1882
1883 return gammas
1896 return gammas
1884
1897
1885 def __residualFunction(self, coeffs, y, t):
1898 def __residualFunction(self, coeffs, y, t):
@@ -1897,7 +1910,7 class PhaseCalibration(Operation):
1897 pairy = pairsList[1]
1910 pairy = pairsList[1]
1898 center_xangle = 0
1911 center_xangle = 0
1899 center_yangle = 0
1912 center_yangle = 0
1900 range_angle = numpy.array([8*numpy.pi,numpy.pi,numpy.pi/2,numpy.pi/4])
1913 range_angle = numpy.array([10*numpy.pi,numpy.pi,numpy.pi/2,numpy.pi/4])
1901 ntimes = len(range_angle)
1914 ntimes = len(range_angle)
1902
1915
1903 nstepsx = 20.0
1916 nstepsx = 20.0
@@ -1963,7 +1976,7 class PhaseCalibration(Operation):
1963
1976
1964 self.__isConfig = True
1977 self.__isConfig = True
1965
1978
1966 if self.__buffer is None:
1979 if self.__buffer == None:
1967 self.__buffer = dataOut.data_param.copy()
1980 self.__buffer = dataOut.data_param.copy()
1968
1981
1969 else:
1982 else:
@@ -2138,7 +2151,4 class MeteorOperations():
2138 indInvalid1 = numpy.where(numpy.logical_and(h_bool == 0, error == 0))[0]
2151 indInvalid1 = numpy.where(numpy.logical_and(h_bool == 0, error == 0))[0]
2139 error[indInvalid1] = 13
2152 error[indInvalid1] = 13
2140
2153
2141 return heights, error
2154 return heights, error No newline at end of file
2142
2143
2144 No newline at end of file
General Comments 0
You need to be logged in to leave comments. Login now