;Purpose: Create ASCII files containing MMCR reflectivities ; in order to calibrate the S-band radar ; ;-------------------------------------------------------------- days=['2008219','2008229','2008243','2008250'] outfiles=['20080806','20080816','20080830','20080906']+'.ascosmmcr.txt' hours=strarr(4,4) hours[0,*]=['02','03','04','05'] hours[1,*]=['04','05','06','07'] hours[2,*]=['04','05','06','07'] hours[3,*]=['00','01','02','03'] for i=0,3 do begin ;Read data for this day for j=0,3 do begin arg=days[i]+hours[i,j]+'*MMCRMom.nc' file=findfile(arg) fid=ncdf_open(file[0]) ncdf_varget,fid,'base_time',bt ncdf_varget,fid,'time_offset',to ncdf_varget,fid,'Reflectivity',re ncdf_varget,fid,'ModeDescription',md ncdf_varget,fid,'Heights',ht ncdf_varget,fid,'ModeNum',mn ncdf_close,fid tm=basetime_to_time(bt,to) ind=fix(where(string(md) eq 'Stratus')) wh=where(mn eq ind[0]) if j eq 0 then begin hts=ht[*,ind] dbz=re[*,wh] time=tm[wh] endif else begin dbz=[[dbz],[re[*,wh]]] time=[time,tm[wh]] endelse endfor wh=where(hts lt 7000,numh) hts=hts[wh] dbz=dbz[wh,*] num=n_elements(time) ;Write ASCII file openw,lun,/get_lun,outfiles[i] for k=0,num-1 do begin for m=0,numh-1 do begin printf,lun,time[k],hts[m],dbz[m,k],format="(f10.7,I5,f10.5)" endfor endfor free_lun,lun endfor end