@@ -23,6 +23,7 import warnings | |||
|
23 | 23 | from numpy import NaN |
|
24 | 24 | from scipy.optimize.optimize import OptimizeWarning |
|
25 | 25 | warnings.filterwarnings('ignore') |
|
26 | import pdb | |
|
26 | 27 | |
|
27 | 28 | |
|
28 | 29 | SPEED_OF_LIGHT = 299792458 |
@@ -2732,7 +2733,6 class SpectralFitting(Operation): | |||
|
2732 | 2733 | dataOut.nIncohInt= int(dataOut.nIncohInt) |
|
2733 | 2734 | dataOut.nProfiles = int(dataOut.nProfiles) |
|
2734 | 2735 | dataOut.nCohInt = int(dataOut.nCohInt) |
|
2735 | print('sale',dataOut.nProfiles,dataOut.nHeights) | |
|
2736 | 2736 | #dataOut.nFFTPoints=nprofs |
|
2737 | 2737 | #dataOut.normFactor = nprofs |
|
2738 | 2738 | dataOut.channelList = channelList |
@@ -2741,8 +2741,6 class SpectralFitting(Operation): | |||
|
2741 | 2741 | vmax = (300000000/49920000.0/2) / (dataOut.ippSeconds) |
|
2742 | 2742 | #dataOut.ippSeconds=ipp |
|
2743 | 2743 | absc = vmax*( numpy.arange(nProf,dtype='float')-nProf/2.)/nProf |
|
2744 | print('sale 2',dataOut.ippSeconds,M,N) | |
|
2745 | print('Empieza procesamiento offline') | |
|
2746 | 2744 | if path != None: |
|
2747 | 2745 | sys.path.append(path) |
|
2748 | 2746 | self.library = importlib.import_module(file) |
@@ -2786,6 +2784,7 class SpectralFitting(Operation): | |||
|
2786 | 2784 | jvelr = numpy.zeros(nHeights, dtype = 'float') |
|
2787 | 2785 | hvalid = [0] |
|
2788 | 2786 | coh2 = abs(dataOut.data_cspc[i,1:nProf,:])**2/(dataOut.data_spc[0+i*2,1:nProf-0,:]*dataOut.data_spc[1+i*2,1:nProf-0,:]) |
|
2787 | ||
|
2789 | 2788 | for h in range(nHeights): |
|
2790 | 2789 | smooth = clean_num_aver[i+1,h] |
|
2791 | 2790 | signalpn0 = (dataOut.data_spc[i*2,1:(nProf-0),h])/smooth |
@@ -2821,7 +2820,7 class SpectralFitting(Operation): | |||
|
2821 | 2820 | snr0 = numpy.sum(signal0/n0)/(nProf-1) |
|
2822 | 2821 | snr1 = numpy.sum(signal1/n1)/(nProf-1) |
|
2823 | 2822 | if snr0 > snrth and snr1 > snrth and clean_num_aver[i+1,h] > 0 : |
|
2824 | #Covariance Matrix | |
|
2823 | #Covariance Matrix | |
|
2825 | 2824 | D = numpy.diag(d**2) |
|
2826 | 2825 | ind = 0 |
|
2827 | 2826 | for pairs in listComb: |
@@ -2846,27 +2845,23 class SpectralFitting(Operation): | |||
|
2846 | 2845 | LT=L.T |
|
2847 | 2846 | |
|
2848 | 2847 | dp = numpy.dot(LT,d) |
|
2849 | #Initial values | |
|
2848 | #Initial values | |
|
2850 | 2849 | data_spc = dataOut.data_spc[coord,:,h] |
|
2851 | 2850 | w = data_spc/data_spc |
|
2852 | 2851 | if filec != None: |
|
2853 | 2852 | w = self.weightf.weightfit(w,tini.tm_year,tini.tm_yday,index,h,i) |
|
2854 | 2853 | if (h>6)and(error1[3]<25): |
|
2855 | p0 = dataOut.data_param[i,:,h-1] | |
|
2854 | p0 = dataOut.data_param[i,:,h-1].copy() | |
|
2856 | 2855 | else: |
|
2857 | 2856 | p0 = numpy.array(self.library.initialValuesFunction(data_spc*w, constants))# sin el i(data_spc, constants, i) |
|
2858 | #print("AQUI REEMPLAZAS CON EL fd0",fd0) | |
|
2859 | 2857 | p0[3] = fd0 |
|
2858 | ||
|
2860 | 2859 | if filec != None: |
|
2861 | 2860 | p0 = self.weightf.Vrfit(p0,tini.tm_year,tini.tm_yday,index,h,i) |
|
2862 | 2861 | |
|
2863 | #print("minP0-ANTES DE OPTIMIZE") | |
|
2864 | #print(p0) | |
|
2865 | 2862 | try: |
|
2866 | 2863 | #Least Squares |
|
2867 | 2864 | minp,covp,infodict,mesg,ier = optimize.leastsq(self.__residFunction,p0,args=(dp,LT,constants),full_output=True) |
|
2868 | print("VERIFICAR SI ESTA VARIANDO minp--------------------------------", minp[3]) | |
|
2869 | print("COMPARACION ---- p0[3],fd0",p0[3],fd0) | |
|
2870 | 2865 | #minp,covp = optimize.leastsq(self.__residFunction,p0,args=(dp,LT,constants)) |
|
2871 | 2866 | #Chi square error |
|
2872 | 2867 | error0 = numpy.sum(infodict['fvec']**2)/(2*N) |
@@ -2882,13 +2877,13 class SpectralFitting(Operation): | |||
|
2882 | 2877 | p0 = numpy.array(self.library.initialValuesFunction(data_spc, constants)) |
|
2883 | 2878 | minp = p0*numpy.nan |
|
2884 | 2879 | error0 = numpy.nan |
|
2885 |
error1 = p0*numpy.nan |
|
|
2880 | error1 = p0*numpy.nan | |
|
2886 | 2881 | if dataOut.data_param is None: |
|
2887 | 2882 | dataOut.data_param = numpy.zeros((nGroups, p0.size, nHeights))*numpy.nan |
|
2888 | 2883 | dataOut.data_error = numpy.zeros((nGroups, p0.size + 1, nHeights))*numpy.nan |
|
2889 | print("CLASE SF minp- ?????",minp) | |
|
2890 | 2884 | dataOut.data_error[i,:,h] = numpy.hstack((error0,error1)) |
|
2891 | 2885 | dataOut.data_param[i,:,h] = minp |
|
2886 | ||
|
2892 | 2887 | for ht in range(nHeights-1) : |
|
2893 | 2888 | smooth = coh_num_aver[i+1,ht] #datc[0,ht,0,beam] |
|
2894 | 2889 | dataOut.data_paramC[4*i,ht,1] = smooth |
@@ -2927,7 +2922,6 class SpectralFitting(Operation): | |||
|
2927 | 2922 | mom1 = self.moments(doppler,signalpn1_n1,nProf) |
|
2928 | 2923 | dataOut.data_paramC[2+4*i,ht,0] = (mom0[0]+mom1[0])/2. |
|
2929 | 2924 | dataOut.data_paramC[3+4*i,ht,0] = (mom0[1]+mom1[1])/2. |
|
2930 | ||
|
2931 | 2925 | dataOut.data_spc = jspectra |
|
2932 | 2926 | dataOut.spc_noise = my_noises*nProf*M |
|
2933 | 2927 | if numpy.any(proc): dataOut.spc_noise = my_noises*nProf*M |
@@ -3654,7 +3648,6 class EWDriftsEstimation(Operation): | |||
|
3654 | 3648 | else : |
|
3655 | 3649 | moments=numpy.vstack(([velRadialm[0,:]],[velRadialm[0,:]])) |
|
3656 | 3650 | dataOut.moments=moments |
|
3657 | print("CLASE EWD Estimation",moments) | |
|
3658 | 3651 | # Coherent |
|
3659 | 3652 | smooth_wC = ebufc[0,:] |
|
3660 | 3653 | p_w0C = rbufc[0,:] |
General Comments 0
You need to be logged in to leave comments.
Login now