;+ ; NAME: CONTOUR1 ; PURPOSE: Generate contour plot with or without filling the contours. ; Provides a wrapper which calls CONTOUR and optionally POLYCONTR1. ; CATEGORY: Display ; CALLING SEQUENCE: Contour1, Z [, X, Y ,fill=fill and lots of other keywords] ; INPUTS: ; ; Z: Two dimensional data array used to generate the contours. ; ; OPTIONAL INPUT PARAMETERS: ; ; X = vector or 2 dimensional array specifying the X coordinates ; for the contour surface. If a vector, each element specifies the ; X coordinate for a column of Z (Example: X(0) specifies the X ; coordinate for Z(0,*)). If X is a two-dimensional array, each ; element of X specifies the X coordinate of the corresponding ; point in Z ( X(i,j) specifies the X coordinate for Z(i,j)). ; ; Y = as for X above, but for the Y coordinates. ; ; KEYWORD PARAMETERS: All keywords of contour, plus: ; ; COLOR_INDEX = color index array. Element i contains the color ; of contour level number i-1. Element 0 contains the ; background color. There must be one more color index than ; levels. ; FILL: If non-zero, contours are filled using POLYCNTR1 ; PATTERN = optional array of patterns, dimensioned (NX, NY, NPATTERN). ; OUTPUTS: None ; OPTIONAL OUTPUT PARAMETERS: None ; COMMON BLOCKS: None ; SIDE EFFECTS: Changes display. ; RESTRICTIONS: ; PROCEDURE: ; MODIFICATION HISTORY: Written PA Sterne (sterne1@llnl.gov) February 1993 ;- PRO contour1, Z, X, Y, $ ; ; "Essential" keywords ; fill=fill,color_index=color_index,pattern=pattern,$ c_colors=c_colors,follow=follow,noerase=noerase,path_filename=path_filename,$ ; ; Eliminatable keywords. Any of these may be commented out along with ; the corresponding keyword_set line below. Comment out at least 9 ; keywords of your choice to make it fit in PV-Wave's parameter limit. ; No such limit exists in IDL. ; background=background,charsize=charsize,clip=clip,color=color,$ c_annotation=c_annotation,c_charsize=c_charsize,c_labels=c_labels,$ c_linestyle=c_linestyle,c_thick=c_thick,data=data,device=device,fancy=fancy,$ font=font,levels=levels,max_value=max_value,nlevels=nlevels,$ noclip=noclip,nodata=nodata,normal=normal,overplot=overplot,$ position=position,psym=psym,spline=spline,subtitle=subtitle,$ symsize=symsize,t3d=t3d,thick=thick,ticklen=ticklen,title=title,$ xcharsize=xcharsize,xmargin=xmargin,xminor=xminor,xrange=xrange,$ xstyle=xstyle,xtickname=xtickname,xticks=xticks,xtickv=xtickv,xtitle=xtitle,$ ycharsize=ycharsize,ymargin=ymargin,yminor=yminor,yrange=yrange,$ ystyle=ystyle,ytickname=ytickname,yticks=yticks,ytickv=ytickv,ytitle=ytitle,$ ;zcharsize=zcharsize,zmargin=zmargin,zminor=zminor,zrange=zrange,$ ;zstyle=zstyle,ztickname=ztickname,zticks=zticks,ztickv=ztickv,ztitle=ztitle,$ zaxis=zaxis,zvalue=zvalue strkw = '' ; ; "Essential" keyword_set lines ; if keyword_set(noerase) then strkw = strkw+',noerase=noerase' if keyword_set(follow) then strkw = strkw+',follow=follow' ; ; Eliminatable keyword_set lines. Comment out in correspondence with ; keywords above. ; if keyword_set(background) then strkw = strkw+',background=background' if keyword_set(charsize) then strkw = strkw+',charsize=charsize' if keyword_set(clip) then strkw = strkw+',clip=clip' if keyword_set(color) then strkw = strkw+',color=color' if keyword_set(c_annotation) then strkw = strkw+',c_annotation=c_annotation' if keyword_set(c_charsize) then strkw = strkw+',c_charsize=c_charsize' if keyword_set(c_labels) then strkw = strkw+',c_labels=c_labels' if keyword_set(c_linestyle) then strkw = strkw+',c_linestyle=c_linestyle' if keyword_set(c_thick) then strkw = strkw+',c_thick=c_thick' if keyword_set(data) then strkw = strkw+',data=data' if keyword_set(device) then strkw = strkw+',device=device' if keyword_set(fancy) then strkw = strkw+',fancy=fancy' if keyword_set(font) then strkw = strkw+',font=font' if keyword_set(levels) then strkw = strkw+',levels=levels' if keyword_set(max_value) then strkw = strkw+',max_value=max_value' if keyword_set(nlevels) then strkw = strkw+',nlevels=nlevels' if keyword_set(noclip) then strkw = strkw+',noclip=noclip' if keyword_set(nodata) then strkw = strkw+',nodata=nodata' if keyword_set(normal) then strkw = strkw+',normal=normal' if keyword_set(overplot) then strkw = strkw+',overplot=overplot' if keyword_set(position) then strkw = strkw+',position=position' if keyword_set(psym) then strkw = strkw+',psym=psym' if keyword_set(spline) then strkw = strkw+',spline=spline' if keyword_set(subtitle) then strkw = strkw+',subtitle=subtitle' if keyword_set(symsize) then strkw = strkw+',symsize=symsize' if keyword_set(t3d) then strkw = strkw+',t3d=t3d' if keyword_set(thick) then strkw = strkw+',thick=thick' if keyword_set(ticklen) then strkw = strkw+',ticklen=ticklen' if keyword_set(title) then strkw = strkw+',title=title' if keyword_set(xcharsize) then strkw = strkw+',xcharsize=xcharsize' if keyword_set(xmargin) then strkw = strkw+',xmargin=xmargin' if keyword_set(xminor) then strkw = strkw+',xminor=xminor' if keyword_set(xrange) then strkw = strkw+',xrange=xrange' if keyword_set(xstyle) then strkw = strkw+',xstyle=xstyle' if keyword_set(xtickname) then strkw = strkw+',xtickname=xtickname' if keyword_set(xticks) then strkw = strkw+',xticks=xticks' if keyword_set(xtickv) then strkw = strkw+',xtickv=xtickv' if keyword_set(xtitle) then strkw = strkw+',xtitle=xtitle' if keyword_set(ycharsize) then strkw = strkw+',ycharsize=ycharsize' if keyword_set(ymargin) then strkw = strkw+',ymargin=ymargin' if keyword_set(yminor) then strkw = strkw+',yminor=yminor' if keyword_set(yrange) then strkw = strkw+',yrange=yrange' if keyword_set(ystyle) then strkw = strkw+',ystyle=ystyle' if keyword_set(ytickname) then strkw = strkw+',ytickname=ytickname' if keyword_set(yticks) then strkw = strkw+',yticks=yticks' if keyword_set(ytickv) then strkw = strkw+',ytickv=ytickv' if keyword_set(ytitle) then strkw = strkw+',ytitle=ytitle' ;if keyword_set(zcharsize) then strkw = strkw+',zcharsize=zcharsize' ;if keyword_set(zmargin) then strkw = strkw+',zmargin=zmargin' ;if keyword_set(zminor) then strkw = strkw+',zminor=zminor' ;if keyword_set(zrange) then strkw = strkw+',zrange=zrange' ;if keyword_set(zstyle) then strkw = strkw+',zstyle=zstyle' ;if keyword_set(ztickname) then strkw = strkw+',ztickname=ztickname' ;if keyword_set(zticks) then strkw = strkw+',zticks=zticks' ;if keyword_set(ztickv) then strkw = strkw+',ztickv=ztickv' ;if keyword_set(ztitle) then strkw = strkw+',ztitle=ztitle' if keyword_set(zaxis) then strkw = strkw+',zaxis=zaxis' if keyword_set(zvalue) then strkw = strkw+',zvalue=zvalue' xy = '' if n_params() eq 2 then xy = ',X' if n_params() eq 3 then xy = ',X ,Y' IF KEYWORD_SET(fill) THEN BEGIN ; fill contours filename = 'cntrwave.dat' if keyword_set(path_filename) then filename = path_filename str1 = 'contour, Z'+xy+', path_filename=filename'+strkw tr0 = execute(str1) ; call contour to generate path file strpl = 'polycntr1,filename,Z'+xy if keyword_set(color_index) then c_index = color_index $ else c_index = replicate(-1,30) strpl=strpl+',color_index=c_index' if keyword_set(pattern) then strpl = strpl+',pattern=pattern' tr = execute(strpl) ; call polycntr1 to shade contours if n_elements(c_colors) eq 0 then begin ;set contour line colors c_colors = c_index(1:n_elements(c_index)-1) tmp1 = where(c_colors gt max(c_colors)*0.6,ncnt1) tmp2 = where(c_colors le max(c_colors)*0.6,ncnt2) IF ncnt2 GT 0 THEN c_colors(tmp2) = 255b IF ncnt1 GT 0 THEN c_colors(tmp1) = 0b endif strkw = strkw+',c_colors=c_colors' ; set keywords for second contour call to overdraw and to ensure ; consistency with pathfile generating contour call. if keyword_set(noerase) eq 0 then strkw = strkw+',/noerase' if keyword_set(follow) eq 0 then strkw = strkw+',/follow' endif str2 = 'contour, Z'+xy+strkw+' tr1 = execute(str2) return end