;+ ; prep_df.pro <file desc here> ; ; :Author: ; Philippe Zarka ; ; :History: ; 2006/02/22: Created ; ; 2006/02/22: Last Edit ;- ; ;+ ; prep_df is a procedure that <behavior desc here> ; ; :Uses: ; auto_db, cal, freq_abc, lit_hfr_liste ; ; :Params: ; aaaajjj: in, required, type=sometype ; A parameter named aaaajjj ; hd: in, required, type=sometype ; A parameter named hd ; hf: in, required, type=sometype ; A parameter named hf ; bande: in, required, type=sometype ; A parameter named bande ; vv: in, required, type=sometype ; A parameter named vv ; xts: in, required, type=sometype ; A parameter named xts ; xf: in, required, type=sometype ; A parameter named xf ; msec: in, required, type=sometype ; A parameter named msec ;- pro PREP_DF, aaaajjj, hd, hf, bande, vv,xts,xf,msec ; lit les donnees "analyse" (Kronos ~NewBench) d'une liste de fichiers ; (de 'liste.scratch'), calibre, et remplit le tableau VV ; = VV*[+X,Z,-X,Z] Re,Im(VV*)[+X,Z] Re,Im(VV*)[-X,Z] ; a pleine resolution temporelle, avec phases recepteurs corrigees ; xts & xf = rampes de temps (sec) et de frequences (kHz) ; msec = temps d'integration des mesures (en msec - pour info / selection) ; bande : A=0, B=1, C=2, H1=3, H2=4 common KRONOSCAL, a1h1,a1h2,ai,dbcal_abc,dbcal_h ; ,v0 LIT_HFR_LISTE, aaaajjj, hd, hf, bande, bande, z print & print,'selection des donnees DF ...' test=where(z.bande eq bande and z.df gt 10 and z.agc1 ne 255b and $ z.agc2 ne 255b and z.auto1 ne 255b and z.auto2 ne 255b and $ z.cross1 ne -999 and z.cross2 ne -999) if test(0) ne -1 then z=z(test) else stop help,z ; preparation tableaux xts & xf nz = n_elements(z) xts = dblarr(nz) & xf=fltarr(nz) for i=0L,nz-1L do xts(i)=total(transpose(z(i).time)#[3600.0,60.0,1.0,0.01]) if bande le 2 then begin nfilt=z(0).filters & freq = freq_ABC(nfilt) for i=0L,nz-1L do begin if z(i).filters ne nfilt then begin nfilt=z(i).filters & freq = freq_ABC(nfilt) endif xf(i)=freq(bande*nfilt+z(i).filter) endfor endif else xf=z.channel+25*z.filter/z.filters ; remplissage tableau data (vv) df1=where(z.df eq 11) & ndf=n_elements(df1) & df2=lonarr(ndf) for i=0L,ndf-1L do begin ii=df1(i) & i1=min([ii+1L,nz-1L]) & i2=min([ii+z(ii).filters,nz-1L]) jj=where(xf(i1:i2) eq xf(ii) and xts(i1:i2) eq xts(ii) $ and z(i1:i2).df eq 12) jj=jj(0) & if jj ne -1 then jj=jj+i1 df2(i)=jj endfor test=where(df2 ne -1) if n_elements(test) lt ndf then if test(0) ne -1 then begin df1=df1(test) & df2=df2(test) & ndf=n_elements(df1) endif z1=z(df1) & z2=z(df2) xf=xf(df1) & xts=xts(df1) & msec=z1.msec*10 vv=fltarr(ndf,8) ; VV*[+X,Z,-X,Z] Re,Im(VV*)[+X,Z] Re,Im(VV*)[-X,Z] restore,getenv('ROOT_RPWS')+'/pro/phases.xdr' ; AXX+ buf=cal(z1.agc1,z1.auto1,z1.bande,z1.df-11b,z1.channel,z1.filters,z1.filter) vv(*,0)=10.^(buf/10.) ; AZZ(+) buf=cal(z1.agc2,z1.auto2,z1.bande,z1.df-8b,z1.channel,z1.filters,z1.filter) vv(*,1)=10.^(buf/10.) ; AXX- buf=cal(z2.agc1,z2.auto1,z2.bande,z2.df-11b,z2.channel,z2.filters,z2.filter) vv(*,2)=10.^(buf/10.) ; AZZ(-) buf=cal(z2.agc2,z2.auto2,z2.bande,z2.df-9b,z2.channel,z2.filters,z2.filter) vv(*,3)=10.^(buf/10.) ; Re(+XZ) & Im(+XZ) ax=10.^(auto_db(z1.auto1)/10.) & az=10.^(auto_db(z1.auto2)/10.) cr=z1.cross1 & cr=cr/abs(cr)*(10.^(auto_db(abs(cr))/10.)) ci=z1.cross2 & ci=ci/abs(ci)*(10.^(auto_db(abs(ci))/10.)) cr=cr/sqrt(ax*az) ci=ci/sqrt(ax*az) cm=sqrt(cr^2+ci^2) thph=atan(ci,cr)*!radeg ph=fltarr(ndf) & att=intarr(ndf) ; hyp. = sans attenuation if bande le 2 then for i=0L,ndf-1L do ph(i)=phases_abc(z1(i).filter, $ (z1(i).df mod 10)-1b,z1(i).bande, $ fix(alog(z1(i).filters*1.)/alog(2.)+0.5)-3) if bande eq 3 then begin freq=z1.channel test=where(freq gt 4300) if test(0) ne -1 then freq(test)=4300 for i=0L,ndf-1L do ph(i)=ph_h1((z1(i).df mod 10)-1b,fix(freq(i)/25),0)+ $ phases_h(z1(i).filter,fix(alog(z1(i).filters*1.)/alog(2.)+0.5)) endif if bande eq 4 then begin freq=z1.channel test=where(freq gt 16075) if test(0) ne -1 then freq(test)=16075 for i=0L,ndf-1L do $ ph(i)=ph_h2((z1(i).df mod 10)-1b,fix((freq(i)-25)/50),0)+ $ phases_h(z1(i).filter,fix(alog(z1(i).filters*1.)/alog(2.)+0.5)) endif th=(thph-ph)/!radeg cr=cm*cos(th) ci=cm*sin(th) ; Re(+XZ) vv(*,4)=cr ; Im(+XZ) vv(*,5)=ci ; Re(-XZ) & Im(-XZ) ax=10.^(auto_db(z2.auto1)/10.) & az=10.^(auto_db(z2.auto2)/10.) cr=z2.cross1 & cr=cr/abs(cr)*(10.^(auto_db(abs(cr))/10.)) ci=z2.cross2 & ci=ci/abs(ci)*(10.^(auto_db(abs(ci))/10.)) cr=cr/sqrt(ax*az) ci=ci/sqrt(ax*az) cm=sqrt(cr^2+ci^2) thph=atan(ci,cr)*!radeg ph=fltarr(ndf) & att=intarr(ndf) ; hyp. = sans attenuation if bande le 2 then for i=0L,ndf-1L do ph(i)=phases_abc(z2(i).filter, $ (z2(i).df mod 10)-1b,z2(i).bande, $ fix(alog(z2(i).filters*1.)/alog(2.)+0.5)-3) if bande eq 3 then begin freq=z2.channel test=where(freq gt 4300) if test(0) ne -1 then freq(test)=4300 for i=0L,ndf-1L do ph(i)=ph_h1((z2(i).df mod 10)-1b,fix(freq(i)/25),0)+ $ phases_h(z2(i).filter,fix(alog(z2(i).filters*1.)/alog(2.)+0.5)) endif if bande eq 4 then begin freq=z2.channel test=where(freq gt 16075) if test(0) ne -1 then freq(test)=16075 for i=0L,ndf-1L $ do ph(i)=ph_h2((z2(i).df mod 10)-1b,fix((freq(i)-25)/50),0)+ $ phases_h(z2(i).filter,fix(alog(z2(i).filters*1.)/alog(2.)+0.5)) endif th=(thph-ph)/!radeg cr=cm*cos(th) ci=cm*sin(th) ; Re(-XZ) vv(*,6)=cr ; Im(-XZ) vv(*,7)=ci help, vv,xts,xf,msec return end