##// END OF EJS Templates
para pruebas em PC AMISR
joabAM -
r1541:77e2d8d2b2ef
parent child
Show More
@@ -614,7 +614,8 class AMISRReader(ProcessingUnit):
614 self.dataOut.flagNoData = True
614 self.dataOut.flagNoData = True
615 return 0
615 return 0
616
616
617 if self.__hasNotDataInBuffer():
617 if self.profileIndex >= (self.newProfiles*self.nblocks): #
618 #if self.__hasNotDataInBuffer():
618 if not (self.readNextFile(self.online)):
619 if not (self.readNextFile(self.online)):
619 return 0
620 return 0
620
621
@@ -664,7 +664,7 class getNoiseB(Operation):
664 self.isConfig = True
664 self.isConfig = True
665 if offset!=None:
665 if offset!=None:
666 self.offset = 10**(offset/10)
666 self.offset = 10**(offset/10)
667 #print("config getNoise Done")
667 #print("config getNoiseB Done")
668
668
669 def run(self, dataOut, offset=None, minHei=None, maxHei=None,minVel=None, maxVel=None, minFreq= None, maxFreq=None, warnings=False):
669 def run(self, dataOut, offset=None, minHei=None, maxHei=None,minVel=None, maxVel=None, minFreq= None, maxFreq=None, warnings=False):
670 self.dataOut = dataOut
670 self.dataOut = dataOut
@@ -676,19 +676,28 class getNoiseB(Operation):
676 noise = None
676 noise = None
677 if self.dataOut.type == 'Voltage':
677 if self.dataOut.type == 'Voltage':
678 noise = self.dataOut.getNoise(ymin_index=self.minIndex, ymax_index=self.maxIndex)
678 noise = self.dataOut.getNoise(ymin_index=self.minIndex, ymax_index=self.maxIndex)
679 #print(minIndex, maxIndex,minIndexVel, maxIndexVel)
679 #print(minIndex, maxIndex,minIndexVel, maxIndexVel)
680 elif self.dataOut.type == 'Spectra':
680 elif self.dataOut.type == 'Spectra':
681
681 #print(self.minIndex, self.maxIndex,self.minIndexFFT, self.maxIndexFFT, self.dataOut.nIncohInt)
682 noise = numpy.zeros( self.dataOut.nChannels)
682 noise = numpy.zeros( self.dataOut.nChannels)
683 norm = 1
683 for channel in range( self.dataOut.nChannels):
684 for channel in range( self.dataOut.nChannels):
684 norm = self.dataOut.max_nIncohInt/self.dataOut.nIncohInt[channel, self.minIndex:self.maxIndex]
685 if not hasattr(self.dataOut.nIncohInt,'__len__'):
685 #print("norm nIncoh: ", norm )
686 norm = 1
687 else:
688 norm = self.dataOut.max_nIncohInt/self.dataOut.nIncohInt[channel, self.minIndex:self.maxIndex]
689 #print("norm nIncoh: ", norm ,self.dataOut.data_spc.shape)
686 daux = self.dataOut.data_spc[channel,self.minIndexFFT:self.maxIndexFFT, self.minIndex:self.maxIndex]
690 daux = self.dataOut.data_spc[channel,self.minIndexFFT:self.maxIndexFFT, self.minIndex:self.maxIndex]
687 daux = numpy.multiply(daux, norm)
691 daux = numpy.multiply(daux, norm)
688 #print("offset: ", self.offset, 10*numpy.log10(self.offset))
692 #print("offset: ", self.offset, 10*numpy.log10(self.offset))
689 #noise[channel] = self.getNoiseByMean(daux)/self.offset
693 #noise[channel] = self.getNoiseByMean(daux)/self.offset
694 #print(daux.shape, daux)
690 noise[channel] = self.getNoiseByHS(daux, self.dataOut.max_nIncohInt)/self.offset
695 noise[channel] = self.getNoiseByHS(daux, self.dataOut.max_nIncohInt)/self.offset
691
696
697 # data = numpy.mean(daux,axis=1)
698 # sortdata = numpy.sort(data, axis=None)
699 # noise[channel] = _noise.hildebrand_sekhon(sortdata, self.dataOut.max_nIncohInt)/self.offset
700
692 #noise = self.dataOut.getNoise(xmin_index=self.minIndexFFT, xmax_index=self.maxIndexFFT, ymin_index=self.minIndex, ymax_index=self.maxIndex)
701 #noise = self.dataOut.getNoise(xmin_index=self.minIndexFFT, xmax_index=self.maxIndexFFT, ymin_index=self.minIndex, ymax_index=self.maxIndex)
693 else:
702 else:
694 noise = self.dataOut.getNoise(xmin_index=self.minIndexFFT, xmax_index=self.maxIndexFFT, ymin_index=self.minIndex, ymax_index=self.maxIndex)
703 noise = self.dataOut.getNoise(xmin_index=self.minIndexFFT, xmax_index=self.maxIndexFFT, ymin_index=self.minIndex, ymax_index=self.maxIndex)
@@ -696,6 +705,7 class getNoiseB(Operation):
696 #print("2: ",10*numpy.log10(self.dataOut.noise_estimation/64))
705 #print("2: ",10*numpy.log10(self.dataOut.noise_estimation/64))
697
706
698 #print(self.dataOut.flagNoData)
707 #print(self.dataOut.flagNoData)
708 print("getNoise Done")
699 return self.dataOut
709 return self.dataOut
700
710
701 def getNoiseByMean(self,data):
711 def getNoiseByMean(self,data):
@@ -2050,7 +2060,7 class IncohInt(Operation):
2050 self.incohInt = 0
2060 self.incohInt = 0
2051 self.nOutliers = 0
2061 self.nOutliers = 0
2052 self.__profIndex = 0
2062 self.__profIndex = 0
2053
2063 #print("IncohInt Done")
2054 return dataOut
2064 return dataOut
2055
2065
2056 class dopplerFlip(Operation):
2066 class dopplerFlip(Operation):
@@ -1898,24 +1898,14 class removeProfileByFaradayHS(Operation):
1898 '''
1898 '''
1899
1899
1900 '''
1900 '''
1901 #isConfig = False
1902 #n = None
1903
1901
1904 #__dataReady = False
1905 __buffer_data = []
1902 __buffer_data = []
1906 __buffer_times = []
1903 __buffer_times = []
1907 #__initime = None
1908 #__count_exec = 0
1909 #__profIndex = 0
1910 buffer = None
1911 #lenProfileOut = 1
1912
1904
1913 #init_prof = 0
1905 buffer = None
1914 #end_prof = 0
1915
1906
1916 #first_utcBlock = None
1917 outliers_IDs_list = []
1907 outliers_IDs_list = []
1918 #__dh = 0
1908
1919
1909
1920 __slots__ = ('n','navg','profileMargin','thHistOutlier','minHei_idx','maxHei_idx','nHeights',
1910 __slots__ = ('n','navg','profileMargin','thHistOutlier','minHei_idx','maxHei_idx','nHeights',
1921 '__dh','first_utcBlock','__profIndex','init_prof','end_prof','lenProfileOut','nChannels',
1911 '__dh','first_utcBlock','__profIndex','init_prof','end_prof','lenProfileOut','nChannels',
@@ -1984,6 +1974,7 class removeProfileByFaradayHS(Operation):
1984 # plt.grid()
1974 # plt.grid()
1985 # plt.show()
1975 # plt.show()
1986
1976
1977
1987 outliers_IDs = outliers_IDs.astype(numpy.dtype('int64'))
1978 outliers_IDs = outliers_IDs.astype(numpy.dtype('int64'))
1988 outliers_IDs = numpy.unique(outliers_IDs)
1979 outliers_IDs = numpy.unique(outliers_IDs)
1989 outs_lines = numpy.sort(outliers_IDs)
1980 outs_lines = numpy.sort(outliers_IDs)
@@ -1992,9 +1983,9 class removeProfileByFaradayHS(Operation):
1992
1983
1993
1984
1994 #Agrupando el histograma de outliers,
1985 #Agrupando el histograma de outliers,
1986 #my_bins = numpy.linspace(0,int(profiles), int(profiles/100), endpoint=False)
1995 my_bins = numpy.linspace(0,9600, 96, endpoint=False)
1987 my_bins = numpy.linspace(0,9600, 96, endpoint=False)
1996
1988
1997
1998 hist, bins = numpy.histogram(outs_lines,bins=my_bins)
1989 hist, bins = numpy.histogram(outs_lines,bins=my_bins)
1999 hist_outliers_indexes = numpy.where(hist > self.thHistOutlier) #es outlier
1990 hist_outliers_indexes = numpy.where(hist > self.thHistOutlier) #es outlier
2000 #print(hist_outliers_indexes[0])
1991 #print(hist_outliers_indexes[0])
@@ -2002,14 +1993,15 class removeProfileByFaradayHS(Operation):
2002 #print(bins_outliers_indexes)
1993 #print(bins_outliers_indexes)
2003 outlier_loc_index = []
1994 outlier_loc_index = []
2004
1995
2005 #outlier_loc_index = [k for k in range(bins_outliers_indexes[n]-50,bins_outliers_indexes[n+1]+50) for n in range(len(bins_outliers_indexes)-1) ]
1996
2006 for n in range(len(bins_outliers_indexes)-1):
1997 # for n in range(len(bins_outliers_indexes)-1):
2007 #outlier_loc_index = [k for k in range(bins_outliers_indexes[n]-50,bins_outliers_indexes[n+1]+50)]
1998 # for k in range(bins_outliers_indexes[n]-self.profileMargin,bins_outliers_indexes[n+1]+self.profileMargin):
2008 for k in range(bins_outliers_indexes[n]-self.profileMargin,bins_outliers_indexes[n+1]+self.profileMargin):
1999 # outlier_loc_index.append(k)
2009 outlier_loc_index.append(k)
2000
2001 outlier_loc_index = [e for n in range(len(bins_outliers_indexes)-1) for e in range(bins_outliers_indexes[n]-self.profileMargin,bins_outliers_indexes[n+1]+self.profileMargin) ]
2010
2002
2011 outlier_loc_index = numpy.asarray(outlier_loc_index)
2003 outlier_loc_index = numpy.asarray(outlier_loc_index)
2012 #print(numpy.unique(outlier_loc_index))
2004 #print(len(numpy.unique(outlier_loc_index)), numpy.unique(outlier_loc_index))
2013
2005
2014
2006
2015
2007
General Comments 0
You need to be logged in to leave comments. Login now