;+ ; prep_df2.pro <file desc here> ; ; :Author: ; Philippe Zarka ; ; :History: ; 2006/02/22: Created ; ; 2006/02/22: Last Edit ;- ; ;+ ; prep_df2 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 ; xant: in, required, type=sometype ; A parameter named xant ; 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_DF2, aaaajjj, hd, hf, bande, vv,xant,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] VV*[Z] Re(VV*)[X,Z] Im(VV*)[X,Z] ; a pleine resolution temporelle, avec phases recepteur corrigees ; xant : +X=1, -X=2, D=3 ; 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 0 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, msec, xant 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 msec=z.msec*10 xant=z.df mod 10 ; remplissage tableau data (vv) vv=fltarr(nz,4) ; VV*[X] VV*[Z] Re(VV*)[X,Z] Im(VV*)[X,Z] ; AXX buf=cal(z.agc1,z.auto1,z.bande,xant-1b,z.channel,z.filters,z.filter) vv(*,0)=10.^(buf/10.) ; AZZ buf=cal(z.agc2,z.auto2,z.bande,bytarr(nz)+3b,z.channel,z.filters,z.filter) vv(*,1)=10.^(buf/10.) ; Re(XZ) & Im(XZ) ax=10.^(auto_db(z.auto1)/10.) & az=10.^(auto_db(z.auto2)/10.) cr=z.cross1 & cr=cr/abs(cr)*(10.^(auto_db(abs(cr))/10.)) ci=z.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 restore,getenv('ROOT_RPWS')+'/pro/phases.xdr' ph=fltarr(nz) & att=intarr(nz) ; hyp. = sans attenuation if bande le 2 then for i=0L,nz-1L do ph(i)=phases_abc(z(i).filter, $ xant(i)-1b,z(i).bande,fix(alog(z(i).filters*1.)/alog(2.)+0.5)-3) if bande eq 3 then begin freq=z.channel test=where(freq gt 4300) if test(0) ne -1 then freq(test)=4300 for i=0L,nz-1L do ph(i)=ph_h1(xant(i)-1b,fix(freq(i)/25),0)+ $ phases_h(z(i).filter,fix(alog(z(i).filters*1.)/alog(2.)+0.5)) endif if bande eq 4 then begin freq=z.channel test=where(freq gt 16075) if test(0) ne -1 then freq(test)=16075 for i=0L,nz-1L do ph(i)=ph_h2(xant(i)-1b,fix((freq(i)-25)/50),0)+ $ phases_h(z(i).filter,fix(alog(z(i).filters*1.)/alog(2.)+0.5)) endif th=(thph-ph)/!radeg cr=cm*cos(th) ci=cm*sin(th) ; Re(XZ) vv(*,2)=cr ; Im(XZ) vv(*,3)=ci help, vv,xant,xts,xf,msec return end