set_plot,'x' window,0,xsize=800,ysize=500 ;read radiosonde data from cart colour_hp !P.font=-1 !p.background=1 !P.multi=[0,3,1] files=strarr(10) name=' ' ascfile='aerigoes_sonde.lst' openw, 1, ascfile read, prompt = 'Please Input Day on Interest (yymmdd): ', Date date=long(date) spawn,'ls -1 /home3/waynef/public_html/camexiii/archive/sondes/uwvai/x'+$ strcompress(string(date),/remove_all)+'*.cdf > sonde.lst' openr, lun, 'sonde.lst', /get_lun n=0 l=0 while not eof (lun) do begin readf, lun, name, format='(a)' files(n)=strcompress( name, /remove_all) n=n+1 endwhile free_lun, lun close,lun for m=0,n-1 do begin sondfile=files(m) fid = ncdf_open(sondfile) ncdf_varget, fid, 'base_time', basetime ncdf_varget, fid, 'time_offset', time_offset ncdf_varget, fid, 'pres', sonde_pr ncdf_varget, fid, 'tdry', sonde_t ncdf_varget, fid, 'dp', sonde_td ncdf_varget, fid, 'alt', sonde_alt time_convert,basetime+time_offset,sonde_date,time=sonde_time ; SONDE QC presdiff=sonde_pr-shift(sonde_pr,1) result=where((presdiff le -0.5) and (presdiff gt -10.0),sonde_nl) sonde_pr=sonde_pr(result) sonde_t=sonde_t(result) sonde_td=sonde_td(result) sonde_alt=sonde_alt(result) sonde_time=sonde_time(result) sonde_t=sonde_t+273.19 sonde_td=sonde_td+273.19 sonde_mr=fltarr(sonde_nl) ; Convert t and dt to mixing ratio sonde_mr(*)=wvmr(sonde_pr(*),sonde_t(*),sonde_td(*)) sonde_stime=strcompress(string(sonde_time(0)),/remove_all) sonde_sdate=strcompress(string(sonde_date(0)),/remove_all) totpre,reverse(sonde_pr), reverse(sonde_mr), sonde_nl,sonde_int_tpw,$ sonde_total_tpw stsonde_pw=string(sonde_total_tpw) ncdf_close,fid ;#################################################### goesfile='/home3/waynef/camexiii/andros/cdffile/'+sonde_sdate+'AG.cdf' fid2 = ncdf_open(goesfile) ncdf_varget, fid2, 2, goesaeri_alt ncdf_varget, fid2, 3, goesaeri_pr ncdf_varget, fid2, 4, goesaeri_t ncdf_varget, fid2, 5, goesaeri_td ncdf_varget, fid2, 6, goesaeri_mr ncdf_varget, fid2, 7, goesaeri_time ncdf_close,fid2 goesaeri_stime=strcompress(string(goesaeri_time),/remove_all) goesaeri_nl=n_elements(goesaeri_alt) ;#################################################### goesfile='/home3/waynef/camexiii/andros/'+sonde_sdate+'/'+sonde_sdate+'FG.cdf' fid3 = ncdf_open(goesfile) ncdf_varget, fid3, 2, goesaeri_g_alt ncdf_varget, fid3, 3, goesaeri_g_pr ncdf_varget, fid3, 4, goesaeri_g_t ncdf_varget, fid3, 5, goesaeri_g_td ncdf_varget, fid3, 6, goesaeri_g_mr ncdf_varget, fid3, 7, goesaeri_g_time ncdf_close,fid3 goesaeri_g_stime=strcompress(string(goesaeri_g_time),/remove_all) goesaeri_g_nl=n_elements(goesaeri_g_alt) ;############################################################ goesorg='/home3/waynef/sgpcart/goesret/ADS/netcdf/'+sonde_sdate+'gp.cdf' fid3 = ncdf_open(goesorg) ncdf_varget, fid3, 1, basetime ncdf_varget, fid3, 2, goes_pr ncdf_varget, fid3, 3, time_offset ncdf_varget, fid3, 10, goes_surfpr ncdf_varget, fid3, 11, goes_surft ncdf_varget, fid3, 12, goes_surftd ncdf_varget, fid3, 14, goes_t ncdf_varget, fid3, 15, goes_td goes_nrec=n_elements(time_offset) goes_nl=n_elements(goes_pr) goes_mr=fltarr(goes_nl) time_convert,basetime+time_offset,goes_date,time=goes_time goes_surfmr=fltarr(goes_nrec) goes_mr=fltarr(goes_nl,goes_nrec) goes_alt=fltarr(goes_nl) sdate=strcompress(string(goes_date(0)),/remove_all) goes_stime=strcompress(string(goes_time),/remove_all) for i=0,goes_nrec-1 do begin if goes_surfpr(i) lt 1000.0 then goes_pr(0) = goes_surfpr(i) goes_surfmr(i)=wvmr(goes_surfpr(i),goes_surft(i),goes_surftd(i)) goes_mr(*,i)=wvmr(goes_pr(*),goes_t(*,i),goes_td(*,i)) goes_alt = prtoalt(goes_pr(*),goes_t(*,i),goes_mr(*,i)) endfor ncdf_close,fid3 ;############################################################ goesaeri_difftime=abs(goesaeri_time-sonde_time(0)) goesaeri_mintime=min(goesaeri_difftime) goesaeri_match_time=where(goesaeri_mintime eq goesaeri_difftime) goes_difftime=abs(goes_time-sonde_time(0)) goes_mintime=min(goes_difftime) goes_match_time=where(goes_mintime eq goes_difftime) totpre,reverse(goesaeri_pr(0:45)), reverse(goesaeri_mr(0:45,goesaeri_match_time)), $ goesaeri_nl-2,goesaeri_int_tpw,goesaeri_total_tpw totpre,reverse(goesaeri_g_pr(0:45)), reverse(goesaeri_g_mr(0:45,goesaeri_match_time)), $ goesaeri_g_nl-2,goesaeri_g_int_tpw,goesaeri_g_total_tpw totpre,reverse(goes_pr), reverse(goes_mr(*,goes_match_time)), goes_nl,goes_int_tpw,$ goes_total_tpw sminute=fix((sonde_time(0)-fix(sonde_time(0)))*60.0) if sminute lt 10 then title_time=strcompress(string(fix(sonde_time(0)))+':0'+string(sminute),/remove_all) if sminute ge 10 then title_time=strcompress(string(fix(sonde_time(0)))+':'+string(sminute),/remove_all) if sminute lt 10 then file_time=strcompress(string(fix(sonde_time(0)))+'0'+string(sminute),/remove_all) if sminute ge 10 then file_time=strcompress(string(fix(sonde_time(0)))+string(sminute),/remove_all) stime=strcompress(string(sonde_time(0)),/remove_all) stime=strmid(stime,0,4) title='Sonde VS AERI/GOES Retrieval '+sdate+' '+title_time+' UTC' toggle,/color skewt_blowup, [-10, 40], everyT=10, everyDA=10, everySA=2, everyW=2,title=title plot_skewt, sonde_t(*),sonde_td(*),sonde_pr(*),0 plot_skewt, goesaeri_t(0:45,goesaeri_match_time),goesaeri_td(0:45,goesaeri_match_time),goesaeri_pr(0:45,goesaeri_match_time),5 ;plot_skewt, goes_t(*,goes_match_time),goes_td(*,goes_match_time),goes_pr(*,goes_match_time),4 legend,['Radiosonde','AERI+GOES'],color=[0,5],line=[0,0],textcolor=[0,5],$ position=[.08,.9],charsize=.7 toggle printf, 1, files(m) ;tvlct,r,g,b,/Get ;giffile=tvrd() ;write_gif, '~/public_html/camexiii/archive/quicklooks/'+sdate+'/'+sdate+'_'+strcompress(string(l),/remove_all)+'_sonde_aerigoes.gif', giffile, r, g, b l=l+1 ;endif endfor i=1 ;if l gt 3 then i=2 ;tvlct,r,g,b,/Get ;giffile=tvrd() ;write_gif, '~/public_html/camexiii/archive/quicklooks/'+sdate+'/'+sdate+'_goesaeri.gif', giffile, r, g, b close, 1 end