;======================================================================== ; Routine to plot the temperature and dew point temperature sounding ; on top of a skew-T, Log(P) diagram. pro plot_skewt, t, td, p, color COMMON RANGES, trange, prange ; Find number of data levels szd = size(t) nlevels = szd(1) ; Define clipping space. clip=[trange(0),prange(0),trange(1),prange(1)] ; Ensure that temperatures are in Celsius. if ( (total(t)/nlevels) gt 100. ) then t = t - 273.16 if ( (total(td)/nlevels) gt 100. ) then td = td - 273.16 ; Overplot the data onto the digram. for i = 0, nlevels-2 do begin ; Plot temperature sounding data. x0 = tnew( t(i), p(i) ) y0 = p(i) x1 = tnew( t(i+1), p(i+1) ) y1 = p(i+1) plots, [x0, x1], [y0, y1], clip=clip, noclip=0, thick=2, color=color ; Plot dew point temperature sounding data. x0 = tnew( td(i), p(i) ) y0 = p(i) x1 = tnew( td(i+1), p(i+1) ) y1 = p(i+1) plots, [x0, x1], [y0, y1], clip=clip, noclip=0, thick=2, color=color endfor ; Close Postscript device, rename output file. if ( !d.name eq 'PS') then begin device, /close spawn, 'mv idl.ps skewt.ps' set_plot, 'X' endif end