@@ -1455,6 +1455,7 class SpectralMoments(Operation): | |||
|
1455 | 1455 | |
|
1456 | 1456 | for ind in range(nChannel): |
|
1457 | 1457 | data_param[ind,:,:] = self.__calculateMoments( data[ind,:,:] , absc , noise[ind], nicoh=nIncohInt, smooth=smooth, type1=type1, fwindow=fwindow) |
|
1458 | #print('snr:',data_param[:,0]) | |
|
1458 | 1459 | |
|
1459 | 1460 | if proc_type == 1: |
|
1460 | 1461 | dataOut.moments = data_param[:,1:,:] |
@@ -1963,68 +1964,52 class JULIADriftsEstimation(Operation): | |||
|
1963 | 1964 | |
|
1964 | 1965 | def run(self, dataOut, zenith, zenithCorrection,heights=None, statistics=0, otype=0): |
|
1965 | 1966 | |
|
1966 | nCh=dataOut.spcpar.shape[0] | |
|
1967 | ||
|
1968 | dataOut.lat=-11.95 | |
|
1969 | dataOut.lon=-76.87 | |
|
1967 | 1970 | |
|
1971 | nCh=dataOut.spcpar.shape[0] | |
|
1968 | 1972 | nHei=dataOut.spcpar.shape[1] |
|
1969 | 1973 | nParam=dataOut.spcpar.shape[2] |
|
1970 |
# S |
|
|
1971 | hei=dataOut.heightList | |
|
1972 | hvalid=numpy.where([hei >= heights[0]][0] & [hei <= heights[1]][0])[0] | |
|
1973 | nhvalid=len(hvalid) | |
|
1974 | parm = numpy.zeros((nCh,nhvalid,nParam)) | |
|
1975 | parm = dataOut.spcpar[:,hvalid,:] | |
|
1974 | # SelecciΓ³n de alturas | |
|
1975 | ||
|
1976 | if not heights: | |
|
1977 | parm = numpy.zeros((nCh,nHei,nParam)) | |
|
1978 | parm[:] = dataOut.spcpar[:] | |
|
1979 | else: | |
|
1980 | hei=dataOut.heightList | |
|
1981 | hvalid=numpy.where([hei >= heights[0]][0] & [hei <= heights[1]][0])[0] | |
|
1982 | nhvalid=len(hvalid) | |
|
1983 | dataOut.heightList = hei[hvalid] | |
|
1984 | parm = numpy.zeros((nCh,nhvalid,nParam)) | |
|
1985 | parm[:] = dataOut.spcpar[:,hvalid,:] | |
|
1986 | ||
|
1976 | 1987 | |
|
1977 | 1988 | # Primer filtrado: Umbral de SNR |
|
1978 | #snrth=-19 | |
|
1979 | 1989 | for i in range(nCh): |
|
1980 | #print('snr:',parm[i,:,2]) | |
|
1981 | #dataOut.spcpar[i,hvalid,:] = self.data_filter(parm[i,:,:],snrth)[0] | |
|
1982 | dataOut.spcpar[i,hvalid,:] = self.data_filter(parm[i,:,:])[0] | |
|
1983 | #print('dataOut.spcpar[0,:,2]',dataOut.spcpar[0,:,2]) | |
|
1984 | #print('dataOut.spcpar[1,:,2]',dataOut.spcpar[1,:,2]) | |
|
1990 | parm[i,:,:] = self.data_filter(parm[i,:,:])[0] | |
|
1991 | ||
|
1985 | 1992 | zenith = numpy.array(zenith) |
|
1986 | 1993 | zenith -= zenithCorrection |
|
1987 | 1994 | zenith *= numpy.pi/180 |
|
1988 | 1995 | alpha = zenith[0] |
|
1989 | 1996 | beta = zenith[1] |
|
1990 | ||
|
1991 |
dopplerCH |
|
|
1992 |
|
|
|
1993 |
swCH |
|
|
1994 |
s |
|
|
1995 |
snrCH |
|
|
1996 | snrCH1 = 10*numpy.log10(dataOut.spcpar[1,:,2]) | |
|
1997 |
noiseCH |
|
|
1998 |
|
|
|
1999 |
wErrCH |
|
|
2000 | wErrCH1 = dataOut.spcpar[1,:,5] | |
|
1997 | dopplerCH0 = parm[0,:,0] | |
|
1998 | dopplerCH1 = parm[1,:,0] | |
|
1999 | swCH0 = parm[0,:,1] | |
|
2000 | swCH1 = parm[1,:,1] | |
|
2001 | snrCH0 = 10*numpy.log10(parm[0,:,2]) | |
|
2002 | snrCH1 = 10*numpy.log10(parm[1,:,2]) | |
|
2003 | noiseCH0 = parm[0,:,3] | |
|
2004 | noiseCH1 = parm[1,:,3] | |
|
2005 | wErrCH0 = parm[0,:,5] | |
|
2006 | wErrCH1 = parm[1,:,5] | |
|
2001 | 2007 | |
|
2002 | 2008 | # Vertical and zonal calculation according to geometry |
|
2003 | 2009 | sinB_A = numpy.sin(beta)*numpy.cos(alpha) - numpy.sin(alpha)* numpy.cos(beta) |
|
2004 | 2010 | drift = -(dopplerCH0 * numpy.sin(beta) - dopplerCH1 * numpy.sin(alpha))/ sinB_A |
|
2005 | ''' | |
|
2006 | print('drift.shape:',drift.shape) | |
|
2007 | print('drift min:', numpy.nanmin(drift)) | |
|
2008 | print('drift max:', numpy.nanmax(drift)) | |
|
2009 | ''' | |
|
2010 | ||
|
2011 | ''' | |
|
2012 | print('shape:', dopplerCH0[hvalid].shape) | |
|
2013 | print('dopplerCH0:', dopplerCH0[hvalid]) | |
|
2014 | print('dopplerCH1:', dopplerCH1[hvalid]) | |
|
2015 | print('drift:', drift[hvalid]) | |
|
2016 | ''' | |
|
2017 | 2011 | zonal = (dopplerCH0 * numpy.cos(beta) - dopplerCH1 * numpy.cos(alpha))/ sinB_A |
|
2018 | ''' | |
|
2019 | print('zonal min:', numpy.nanmin(zonal)) | |
|
2020 | print('zonal max:', numpy.nanmax(zonal)) | |
|
2021 | ''' | |
|
2022 | #print('zonal:', zonal[hvalid]) | |
|
2023 | 2012 | snr = (snrCH0 + snrCH1)/2 |
|
2024 | ''' | |
|
2025 | print('snr min:', 10*numpy.log10(numpy.nanmin(snr))) | |
|
2026 | print('snr max:', 10*numpy.log10(numpy.nanmax(snr))) | |
|
2027 | ''' | |
|
2028 | 2013 | noise = (noiseCH0 + noiseCH1)/2 |
|
2029 | 2014 | sw = (swCH0 + swCH1)/2 |
|
2030 | 2015 | w_w_err= numpy.sqrt(numpy.power(wErrCH0 * numpy.sin(beta)/numpy.abs(sinB_A),2) + numpy.power(wErrCH1 * numpy.sin(alpha)/numpy.abs(sinB_A),2)) |
@@ -2033,7 +2018,7 class JULIADriftsEstimation(Operation): | |||
|
2033 | 2018 | # for statistics150km |
|
2034 | 2019 | if statistics: |
|
2035 | 2020 | print('Implemented offline.') |
|
2036 | ||
|
2021 | ||
|
2037 | 2022 | if otype == 0: |
|
2038 | 2023 | winds = numpy.vstack((snr, drift, zonal, noise, sw, w_w_err, w_e_err)) # to process statistics drifts |
|
2039 | 2024 | elif otype == 3: |
@@ -2042,13 +2027,14 class JULIADriftsEstimation(Operation): | |||
|
2042 | 2027 | winds = numpy.vstack((snrCH0, drift, snrCH1, zonal)) # to generic plot: 4 RTI's |
|
2043 | 2028 | |
|
2044 | 2029 | snr1 = numpy.vstack((snrCH0, snrCH1)) |
|
2045 | ||
|
2046 | 2030 | dataOut.data_output = winds |
|
2047 | 2031 | dataOut.data_snr = snr1 |
|
2048 | 2032 | |
|
2049 | 2033 | dataOut.utctimeInit = dataOut.utctime |
|
2050 | 2034 | dataOut.outputInterval = dataOut.timeInterval |
|
2051 | ||
|
2035 | ||
|
2036 | dataOut.flagNoData = numpy.all(numpy.isnan(dataOut.data_output[0])) # NAN vectors are not written | |
|
2037 | ||
|
2052 | 2038 | return dataOut |
|
2053 | 2039 | |
|
2054 | 2040 | class SALags(Operation): |
General Comments 0
You need to be logged in to leave comments.
Login now