    pro get_qvp,year,month,day
;
; *** Program to create new QVP scan only files.
;
    in_dir    = '/gpmraid/raw/NPOL/Newark/' + year + '/' + month + day + '/ppi/'
    syr  = strmid(year,2,2)
    
    wc = in_dir + '/np1' + syr + month + day + '*.gz'
    files = file_search(wc,COUNT=nf)
    if(nf eq 0) then begin
       print,'No files found for ' + wc
       goto,next_day
    endif    
;
; *** Make an output directory to copy organized files to
;
             temp_dir   = in_dir + '/temp'
;
; *** Found some files, now determine their scan modes
;         
             for i=0,nf-1 do begin
                file = files[i]
                print
                print,'Input file -->   ',file
   
                radar = rsl_anyformat_to_radar(file,/quiet,ERROR=error)
                if(ERROR) then begin
            		print,'Error loading radar: ' + file
	                printf,unit,'Error loading radar: ' + file
                        stop
	               goto,next_file
                endif
                 
                sweeps = radar.volume[0].h.nsweeps
                for k=0,sweeps-2 do begin
                    rsl_remove_sweep, radar, 0
                endfor
                fileb = file_basename(file)
                qvp_dir = '/gpmraid/raw/NPOL/Newark/' + year + '/' + month + day + '/qvp/'
                spawn,'mkdir -p ' + qvp_dir
                qvp_cf_file = qvp_dir + fileb + '.cf'
                print,'Output QVP only file -->  ',qvp_cf_file
                print
                rsl_radar_to_cfradial,radar,qvp_cf_file,catch=0,/UFFIELDS
next_file:
             endfor             ; Files
next_day:
    print,'Done.'
    stop
    end
