PRO trial2 SET_PLOT, 'X' ;************************ ;READ IN SNOW TEMP DATA * ;************************ date=FLTARR(1000) time=FLTARR(1000) xlon=FLTARR(1000) ylat=FLTARR(1000) tsnow=FLTARR(1000) scolor=STRARR(1000) ;* FIND NUMBER OF LINES IN FILE openr,1,'testvalues.txt' a='' i= 0 WHILE NOT EOF(1) DO BEGIN readf,1,a i = i +1 endwhile close,1 ;* READ DATA INTO ARRAYS openr,1,'testvalues.txt' data = FLTARR(11,i) readf,1,data close,1 date=STRARR(i) time=STRARR(i) xlon=FLTARR(i) ylat=FLTARR(i) tsnow=FLTARR(i) FOR J = 0, i-1 DO BEGIN date = data[0,j] time = data[1,j] xlon[j] = data[2,j] ylat[j] = data[3,j] tsnow[j] = data[4,j] *9/5 + 32 ENDFOR ;* create color table ; NOTES: ; The color table assignments are as follows ; Entry Color ; ----- ----- ; 0 => Black ; 1 => Magenta ; 2 => Cyan ; 3 => Yellow ; 4 => Green ; 5 => Red ; 6 => Blue ; 7 => White ; 8 => Navy ; 9 => Gold ; 10 => Pink ; 11 => Aquamarine ; 12 => Orchid ; 13 => Gray ; 14 => Sky ; 15 => Beige ;- Check keyword values start = 0 ;- Load graphics colors (derived from McIDAS) r = [0,255,0,255,0,255,0,255,0,255,255,112,219,127,0,255] g = [0,0,255,255,255,0,0,255,0,187,127,219,112,127,163,171] b = [0,255,255,0,0,0,255,255,115,0,127,147,219,127,255,127] tvlct, r, g, b, start ;names = [ $ ; 'Black', 'Magenta', 'Cyan', 'Yellow', 'Green', 'Red', 'Blue', 'White', $ ; 'Navy', 'Gold', 'Pink', 'Aquamarine', 'Orchid', 'Gray', 'Sky', 'Beige' ] values = byte( indgen( 16 ) + start ) FOR j = 0, i-1 DO BEGIN ;*Red Wax IF tsnow[j] GT 34.0 THEN scolor[j] = values[5] ;*Violet Wax IF tsnow[j] LT 35.0 AND tsnow[j] GT 29 THEN scolor[j] = values[1] ;*Blue Wax IF tsnow[j] LT 30.0 AND tsnow[j] GT 17 THEN scolor[j] = values[6] ;*Green Wax IF tsnow[j] LT 18.0 AND tsnow[j] GT 4 THEN scolor[j] = values[4] ENDFOR ERASE SET_PLOT, 'X' ; DEVICE, SET_resolution = [800,625] ; ERASE !P.FONT=2 !X.RANGE=[40.30,40.40] !Y.RANGE=[-111.3,-111.4] ; DEVICE, FILE='ice.ps', /TIMES,/INCHES,$ ; YSIZE=10, XSIZE=7.5, XOFFSET=0.5,YOFFSET=0.5 plot, xlon, ylat, TITLE="Cross Country Ski Snow Temperature", $ CHARSIZE=1.5 ; oplot,psym=6, xlon,ylat,THICK=3.0 FOR J = 1, i-1 DO BEGIN x1 = xlon[J] x2 = xlon[J] y1 = ylat[J] y2 = ylat[J] oplot, psym=1, [x1,x2],[y1,y2],color = scolor[J], THICK=2.5 ENDFOR xyouts, xlon[0]-13,ylat[0]+31, date[0],align=1, color = scolor[0] xyouts, xlon[0],ylat[0],"", align=1,color = scolor[0] FOR J = 1, i-1 DO BEGIN print, j, scolor[j] xyouts, xlon[J],ylat[J],"", align=1, color = scolor[J] xyouts, xlon[J],ylat[J],"", align=1, color = scolor[J] ENDFOR image = tvrd() WRITE_GIF,'snowtemp.gif',image,r,g,b END