##// END OF EJS Templates
update jroproc_parameters, cambios JULIADriftsEstimation, referencia v3.0-devel IVAN
Alexander Valdez -
r1700:20a5087b4329
parent child
Show More
@@ -12,6 +12,7 import itertools
12 12 from multiprocessing import Pool, TimeoutError
13 13 from multiprocessing.pool import ThreadPool
14 14 import time
15
15 16 from scipy.optimize import fmin_l_bfgs_b #optimize with bounds on state papameters
16 17 from .jroproc_base import ProcessingUnit, Operation, MPDecorator
17 18 from schainpy.model.data.jrodata import Parameters, hildebrand_sekhon
@@ -328,8 +329,6 class GaussianFit(Operation):
328 329 Operation.__init__(self)
329 330 self.i=0
330 331
331
332 # def run(self, dataOut, num_intg=7, pnoise=1., SNRlimit=-9): #num_intg: Incoherent integrations, pnoise: Noise, vel_arr: range of velocities, similar to the ftt points
333 332 def run(self, dataOut, SNRdBlimit=-9, method='generalized'):
334 333 """This routine will find a couple of generalized Gaussians to a power spectrum
335 334 methods: generalized, squared
@@ -715,6 +714,7 class Oblique_Gauss_Fit(Operation):
715 714
716 715 return gaussian(x, popt[0], popt[1], popt[2], popt[3]), popt[0], popt[1], popt[2], popt[3]
717 716
717
718 718 def Gauss_fit_2(self,spc,x,nGauss):
719 719
720 720
@@ -2979,34 +2979,44 class JULIADriftsEstimation(Operation):
2979 2979
2980 2980 def run(self, dataOut, zenith, zenithCorrection,heights=None, statistics=0, otype=0):
2981 2981
2982 dataOut.lat=-11.95
2983 dataOut.lon=-76.87
2982 2984 nCh=dataOut.spcpar.shape[0]
2983 2985 nHei=dataOut.spcpar.shape[1]
2984 2986 nParam=dataOut.spcpar.shape[2]
2985 # Solo las alturas de interes
2986 hei=dataOut.heightList
2987 hvalid=numpy.where([hei >= heights[0]][0] & [hei <= heights[1]][0])[0]
2988 nhvalid=len(hvalid)
2989 parm = numpy.zeros((nCh,nhvalid,nParam))
2990 parm = dataOut.spcpar[:,hvalid,:]
2987 # SelecciΓ³n de alturas
2988
2989 if not heights:
2990 parm = numpy.zeros((nCh,nHei,nParam))
2991 parm[:] = dataOut.spcpar[:]
2992 else:
2993 hei=dataOut.heightList
2994 hvalid=numpy.where([hei >= heights[0]][0] & [hei <= heights[1]][0])[0]
2995 nhvalid=len(hvalid)
2996 dataOut.heightList = hei[hvalid]
2997 parm = numpy.zeros((nCh,nhvalid,nParam))
2998 parm[:] = dataOut.spcpar[:,hvalid,:]
2999
3000
2991 3001 # Primer filtrado: Umbral de SNR
2992 3002 for i in range(nCh):
2993 dataOut.spcpar[i,hvalid,:] = self.data_filter(parm[i,:,:])[0]
3003 parm[i,:,:] = self.data_filter(parm[i,:,:])[0]
3004
2994 3005 zenith = numpy.array(zenith)
2995 3006 zenith -= zenithCorrection
2996 3007 zenith *= numpy.pi/180
2997 3008 alpha = zenith[0]
2998 3009 beta = zenith[1]
2999
3000 dopplerCH0 = dataOut.spcpar[0,:,0]
3001 dopplerCH1 = dataOut.spcpar[1,:,0]
3002 swCH0 = dataOut.spcpar[0,:,1]
3003 swCH1 = dataOut.spcpar[1,:,1]
3004 snrCH0 = 10*numpy.log10(dataOut.spcpar[0,:,2])
3005 snrCH1 = 10*numpy.log10(dataOut.spcpar[1,:,2])
3006 noiseCH0 = dataOut.spcpar[0,:,3]
3007 noiseCH1 = dataOut.spcpar[1,:,3]
3008 wErrCH0 = dataOut.spcpar[0,:,5]
3009 wErrCH1 = dataOut.spcpar[1,:,5]
3010 dopplerCH0 = parm[0,:,0]
3011 dopplerCH1 = parm[1,:,0]
3012 swCH0 = parm[0,:,1]
3013 swCH1 = parm[1,:,1]
3014 snrCH0 = 10*numpy.log10(parm[0,:,2])
3015 snrCH1 = 10*numpy.log10(parm[1,:,2])
3016 noiseCH0 = parm[0,:,3]
3017 noiseCH1 = parm[1,:,3]
3018 wErrCH0 = parm[0,:,5]
3019 wErrCH1 = parm[1,:,5]
3010 3020
3011 3021 # Vertical and zonal calculation according to geometry
3012 3022 sinB_A = numpy.sin(beta)*numpy.cos(alpha) - numpy.sin(alpha)* numpy.cos(beta)
@@ -3020,7 +3030,8 class JULIADriftsEstimation(Operation):
3020 3030
3021 3031 # for statistics150km
3022 3032 if statistics:
3023 print('Implemented offline.')
3033 print('Implemented offline.')
3034
3024 3035 if otype == 0:
3025 3036 winds = numpy.vstack((snr, drift, zonal, noise, sw, w_w_err, w_e_err)) # to process statistics drifts
3026 3037 elif otype == 3:
@@ -3034,6 +3045,10 class JULIADriftsEstimation(Operation):
3034 3045
3035 3046 dataOut.utctimeInit = dataOut.utctime
3036 3047 dataOut.outputInterval = dataOut.timeInterval
3048 try:
3049 dataOut.flagNoData = numpy.all(numpy.isnan(dataOut.data_output[0])) # NAN vectors are not written MADRIGAL CASE
3050 except:
3051 print("Check there is no Data")
3037 3052
3038 3053 return dataOut
3039 3054
General Comments 0
You need to be logged in to leave comments. Login now