<html> <head> <title>example9.gri</title> </head> <body bgcolor="#FFFFFF"> <pre> <font color=#B22222># Example 9 -- Plot dTdrho-rho section</font> <font color=#0000EE>`Initialize Parameters'</font> { <font color=#0000EE>\FILE_DATA =</font> <font color=#2F4F4F>"example9a.dat"</font> <font color=#B22222># T vs rho</font> <font color=#0000EE>\FILE_LOCN =</font> <font color=#2F4F4F>"example9b.dat"</font> <font color=#B22222># section distances</font> <font color=#B22222>#</font> <font color=#B22222># Following values from ~/eubex/processing/to_rho_bins/do_rho_inter</font> <font color=#0000EE>\RHO_MIN =</font> <font color=#2F4F4F>"28.1"</font> <font color=#0000EE>\RHO_MAX =</font> <font color=#2F4F4F>"27.5"</font> <font color=#0000EE>\RHO_INC =</font> <font color=#2F4F4F>"-0.002"</font> <font color=#0000EE>\NY =</font> <font color=#2F4F4F>"301"</font> set missing value -99.0 <font color=#0000EE>\xmin =</font> <font color=#2F4F4F>"350"</font> <font color=#0000EE>\xmax =</font> <font color=#2F4F4F>"0"</font> <font color=#0000EE>\xinc =</font> <font color=#2F4F4F>"-100"</font> <font color=#0000EE>\ymin =</font> <font color=#2F4F4F>"28.1"</font> <font color=#0000EE>\ymax =</font> <font color=#2F4F4F>"27.8"</font> <font color=#0000EE>\yinc =</font> <font color=#2F4F4F>"-0.1"</font> <font color=#0000EE>\zmin =</font> <font color=#2F4F4F>"-10"</font> <font color=#B22222># black</font> <font color=#0000EE>\zmax =</font> <font color=#2F4F4F>"0"</font> <font color=#B22222># white</font> } <font color=#0000EE>`Initialize Axes'</font> Set up axes. { set x name <font color=#2F4F4F>"km"</font> set x size 10 set x axis<font color=#0000EE> \xmin</font><font color=#0000EE> \xmax</font><font color=#0000EE> \xinc </font> set y size 5 set y name <font color=#2F4F4F>"$\sigma_T$"</font> set y axis label horizontal set y axis<font color=#0000EE> \ymin</font><font color=#0000EE> \ymax</font><font color=#0000EE> \yinc </font> set y format %.1lf draw axes none } <font color=#0000EE>`Initialize Files'</font> { query<font color=#0000EE> \data</font> <font color=#2F4F4F>"Data file? " ("\FILE_DATA"</font>) query<font color=#0000EE> \locn</font> <font color=#2F4F4F>"Station locn?" ("\FILE_LOCN"</font>) } <font color=#0000EE>`Read Data'</font> { <font color=#B22222># Read x-locations</font> <font color=#9400D3>system</font> <font color=#FF0000>awk '{print $2}' <<font color=#0000EE> \locn</font> > TMP</font> <font color=#9400D3>system</font> <font color=#FF0000>wc TMP | awk '{print $1}' > NUM</font> open NUM read<font color=#CDAD00> .gridx_number.</font> close <font color=#9400D3>system</font> <font color=#FF0000>rm NUM </font> open TMP read grid x<font color=#CDAD00> .gridx_number.</font> close <font color=#9400D3>system</font> <font color=#FF0000>rm TMP</font> <font color=#B22222># Create y-locations</font> set y grid<font color=#0000EE> \RHO_MIN</font><font color=#0000EE> \RHO_MAX</font><font color=#0000EE> \RHO_INC </font> <font color=#B22222>#</font> <font color=#B22222># Read data</font> open<font color=#0000EE> \data </font> read grid data<font color=#0000EE> \NY<font</font> color=#CDAD00> .gridx_number.</font> close } Initialize Parameters Initialize Axes Initialize Files Read Data set image range<font color=#0000EE> \zmin</font><font color=#0000EE> \zmax </font>set image colorscale hsb 0 1 1<font color=#0000EE> \zmin</font> hsb .6 1 1<font color=#0000EE> \zmax </font>convert grid to image box<font color=#0000EE> \xmin</font> <font color=#0000EE> \ymin</font><font color=#0000EE> \xmax</font><font color=#0000EE> \ymax </font><font color=#B22222>#</font> <font color=#B22222># Draw the image, then draw the axes. Note that the image has</font> <font color=#B22222># extends beyond the axes frame, so we will turn clipping</font> <font color=#B22222># on before drawing it, to make a clean picture.</font> set clip postscript on draw image set clip postscript off draw axes <font color=#B22222>#</font> <font color=#B22222># All done.</font> draw title <font color=#2F4F4F>"Example 9"</font> <font color=#9400D3>if</font> {<font color=#2F4F4F>"<font color=#0000EE>\dohisto" =</font>= "yes"</font>} draw title <font color=#2F4F4F>"Histogram enhanced grayscales"</font> <font color=#9400D3>end if</font> </pre> </body> </html>