; wcrproc script of WCR data quick looks and data quality processing ; After making the desired changes execute next line from idl ; @/wcrproc ; ; ATTENTION: Before processing a single file or a whole flight make sure ; all parameters defined below are correct. Parameters related ; to an experiment (edit once) are marked with ';/E' at the line ; ends. Mark ';/W' means parameters that may have to be edited for ; every run of wcrproc ;------------------------------------------------------------------------------ ; Define data directories ;------------------------------------------------------------------------------ ; If process the current date compile the flight directory in d (mmmdd) d=strlowcase(delchr(strmid(systime(),4,6),' ')) if strlen(d) eq 4 then d=strmid(d,0,3)+'0'+strmid(d,3,1) ; Define d if you process a day different than the current ; d='/' ; use for processing in the main expdir directory d='/apr21a/' ;/W ; WCR data disk (no end slash) hdisk='/sova4' ;/E ; Experiment name and main storage directory expname ="CIFEX 2004" ;/E expdir ='/cifex04' ;/E datdir = hdisk+expdir+d psdir = datdir+'ps/' pdfdir = datdir+'quicklooks' tstpdfdir = datdir+'dataquality' ;------------------------------------------------------------------------------ ; Antenna(s) configuration ;------------------------------------------------------------------------------ ; Antenna configurations (aconfig): ; 3 - up/side and down antennas (V-ch: down, H-ch: side/up) ; For different antenna configs during one flight make aconfig an array with ; relevant values aconfig=3 ;/W ;------------------------------------------------------------------------------ ; Activate journaling if desired ;------------------------------------------------------------------------------ journal_file='wcrproc.log' journal, datdir+journal_file ; comment this line out to skip journaling ;/E ;------------------------------------------------------------------------------ ; Cal coefficients for h-beam and v-beam at 250ns: [hhcal, vvcal] ; corrections for 100/500 ns (+2.5/-3.5) is applied in wcrzpsm ;------------------------------------------------------------------------------ calcoef3 = [53.0,50.0] ; CIFEX04, H: side/up, V: down, 250ns ;/E calcoef=fltarr(2,n_elements(aconfig)) for k=0,n_elements(aconfig)-1 do $ case aconfig[k] of & $ 0: calcoef[*,k]=calcoef0 & $ 1: calcoef[*,k]=calcoef1 & $ 2: calcoef[*,k]=calcoef2 & $ 3: calcoef[*,k]=calcoef3 & $ 4: calcoef[*,k]=calcoef4 & $ 5: calcoef[*,k]=calcoef5 & $ else: begin & $ message,'Invalid antenna configuration.' & $ stop & $ end & $ endcase journal_file='wcrproc.log' ;------------------------------------------------------------------------------ ; What to process ;------------------------------------------------------------------------------ ; 0 - nothing is produced procimgz =1 ; 1 - reflectivity quick looks (no profile averaging) ;/W ; 2 - quick looks (average round(aspectratio) profs, faster) proctstz =1 ; 1 - test data ;/W procimgv =0 ; 1 - corrected velocity quick looks procpdf =procimgz<1 ; 1 - convert quick looks ps files to pdf files proctstpdf=proctstz ; 1 - convert test ps plots to pdf ; ;------------------------------------------------------------------------------ ; Assign appropriate values to some input parameters ;------------------------------------------------------------------------------ printer = '' ; use printer name, or '' to skip printing ; Image Processing parameters fileid = '200' ;/W procz = 1 ; 0 - quick looks for spp,ppm,fft,dpfft (HH or ; VV if only V is transmitted) ; 1 - quick looks for ppmag HH and VV ; 2 - quick looks for ppmag or sppmag HH only ; 3 - quick looks for ppmag or sppmag VV only procv = 0 ; 0 - velocity quick looks for H-ch (if absent use V) ; 1 - velocity quick looks for V-ch (if absent use H) plotps = 1 ; create ps files for test plots (instead of using X) ; Reflectivity quick looks parameters acspeed = 90. ; AC mean ground speed (use for aspect calculations) mingates= 70 ; minimum number of range gates to be plotted minlimz = -45. ;-45 ; plot min reflectivity in dBZ maxlimz = +35. ;+35 ; plot max reflectivity in dBZ hcor = 0 ; 0 - no H-ch power slope correction vcor = 0 ; 0 - no V-ch power slope correction nosaveps= 0 ; 0 - save ps files setnoise= [10099,2.] ; set noise use for wcrzpsm (sppmag or ppmag) ; for fft setnoise=0 (nswin=99, nthresh=[-999,3]) ; is hardwired colortb = -99 ; color table for reflectivity images ; Data quality test parameters sm = 0 ; 0 - no curve smoothing in the plots noiso = 1 ; 1 - no isolation plots (not needed for multi antenna configs noleak = 0 ; 0 - plot leakage data nonoise = 0 ; 0 - plot noise data norg = 0 ; 0 - plot rangegate data rangeg = [0,1] ; range gates to be plotted (default 0,1,last) ppmnoav = 1 ; 1 - do not average the pulses for ppmag ; Velocity quick looks parameters minlimv = -32. ; plot min velocity, m/s maxlimv = +32. ; plot max velocity, m/s timehack= 0.0 ; velocity time hack, sec timecor = -13.+timehack ; time correction (usually GPS leap secs)+timehack ;/W COMMENT THIS LINE IF WE USE UTCWASPTIME threshv = 3. ; power threshold for velocity images ; positive, n, means n*stdev above minimum noise ; negative means absolute threshold in dBm colortbv= -99 ; color table for velocity images ;------------------------------------------------------------------------------ ; Process data ;------------------------------------------------------------------------------ ; Create quick look plots if procimgz gt 0 or procimgv gt 0 or proctstz gt 0 then begin & $ print,'datdir=',datdir & $ print,'psdir=',psdir & $ endif if procimgz eq 1 then $ wcrzpsm,datdir,printer=printer,tlabel=expname,timecor=timecor, $ calcoef=calcoef,proc=procz,fileid=fileid,psdir=psdir,minlim=minlimz, $ maxlim=maxlimz,hcor=hcor,vcor=vcor,setnoise=setnoise,mingates=mingates, $ aconfig=aconfig,acspeed=acspeed,colortb=colortb $ else if procimgz eq 2 then $ wcrzpsm1,datdir,printer=printer,tlabel=expname,timecor=timecor, $ calcoef=calcoef,proc=procz,fileid=fileid,psdir=psdir,minlim=minlimz, $ maxlim=maxlimz,hcor=hcor,vcor=vcor,setnoise=setnoise,mingates=mingates, $ aconfig=aconfig,colortb=colortb ; Convert quick looks ps files to pdf files if procpdf then begin & $ print,'*********** Converting ps to pdf ***************' & $ spawn,'mkdir '+pdfdir+' >& /dev/null' & $ spawn,'wcrps2pdf '+psdir+' '+pdfdir & $ endif ; Flight test data if proctstz then $ plotwcrtestm,datdir,printer=printer,tlabel=expname,plotps=plotps, $ nosaveps=nosaveps,indjump=ijump,fileid=fileid,timecor=timecor, $ noiso=noiso,noleak=noleak,nonoise=nonoise,rangeg=rangeg,norg=norg, $ hcor=hcor,vcor=vcor,smooth=sm,ppmnoav=ppmnoav,psdir=psdir ; Corrected Doppler velocity quick looks if procimgv then begin & $ print,kadir+kancf & $ ; timehack is always 0 (it is added to timecor) wcrvpsm,datdir,printer=printer,tlabel=expname,timecor=timecor, $ timehack=0,proc=procv,fileid=fileid,psdir=psdir,minlim=minlimv, $ maxlim=maxlimv,mingates=mingates,thresh=threshv,aconfig=aconfig, $ acfile=kadir+kancf,colortb=colortbv & $ endif ; Convert tst ps files to pdf if proctstpdf then begin & $ print,'**********Converting tst.ps to pdf **************' & $ spawn,'mkdir '+tstpdfdir+' >& /dev/null' & $ spawn,'wcrtst2pdf '+psdir+' '+tstpdfdir & $ endif ; flush, -1 ;for idl 5.4 only ; flush, -2 ;for idl 5.4 only ;------------------------------------------------------------------------------ ; Close the journal file if active ;------------------------------------------------------------------------------ junk=(fstat(!journal)).name pos=strpos(junk,'/', /reverse_search) if pos ne -1 then junk=strmid(junk,pos+1) if junk eq journal_file then journal print,'End WCRPROC' ;------------------------------------------------------------------------------ ; If the KingAir data file is available extract the radar mirror events in a ; text file ;------------------------------------------------------------------------------ ;kawcrmirrorprint,'/net/tiger/disk2/kingair_data/cifex04/processed/20040409_2.c1.nc'