load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl" load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl" load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl" load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl" begin fin = "tahoe_lcc_clip.nc" f = addfile(fin,"r") Band1 = where(f->Band1.gt.255, 255, f->Band1) ; red channel Band2 = where(f->Band2.gt.255, 255, f->Band2) ; green channel Band3 = where(f->Band3.gt.255, 255, f->Band3) ; blue channel wks = gsn_open_wks("png", "test") ; Open a workstation. res = True res@gsnFrame = False ; Don't draw or advance res@gsnDraw = False ; frame yet. res@mpLimitMode = "Corners" res@mpLeftCornerLatF = 38.6813 res@mpLeftCornerLonF = -120.2626 res@mpRightCornerLatF = 39.3970 res@mpRightCornerLonF = -119.7898 res@mpProjection = "LambertConformal" res@mpLambertParallel1F = 38. res@mpLambertParallel2F = 38. res@mpLambertMeridianF = -121. res@tfDoNDCOverlay = True res@gsnMaximize = True res@cnFillOn = True ; Turn on filled rasters res@cnFillMode = "RasterFill" res@cnLevelSelectionMode = "EqualSpacedLevels" res@cnMinLevelValF = 0 res@cnMaxLevelValF = 255 res@cnMaxLevelCount = 254 res@cnFillBackgroundColor = (/ 1., 1., 1., 1./) res@cnLinesOn = False ; Turn off contour lines . res@cnLineLabelsOn = False ; Turn off contour labels res@cnInfoLabelOn = False ; Turn off info label res@gsnTickMarksOn = False ; Turn off tickmarks res@lbLabelBarOn = False ; Turn off labelbar res@gsnRightString = "" ; Turn off subtitles res@gsnLeftString = "" ;---Construct RGBA colormaps... ramp = fspan(0., 1., 255) reds = new((/255, 4/), float) greens = new((/255, 4/), float) blues = new((/255, 4/), float) reds = 0 greens = 0 blues = 0 reds(:,0) = ramp greens(:,1) = ramp blues(:,2) = ramp ; The red contour map is plotted fully opaque; the green and blue ; are plotted completely transparent. When overlain, the colors ; combine (rather magically). reds(:,3) = 1. greens(:,3) = 0 blues(:,3) = 0 res@cnFillColors = greens greenMap = gsn_csm_contour(wks, Band2, res) res@cnFillColors = blues blueMap = gsn_csm_contour(wks, Band3, res) ;---This will be our base, so make it a map plot. res@cnFillColors = reds res@gsnAddCyclic = False res@mpOutlineBoundarySets = "NoBoundaries" res@mpFillOn = False redMap = gsn_csm_contour_map(wks, Band1, res) ;---Overlay everything and draw overlay(redMap, greenMap) overlay(redMap, blueMap) draw(redMap) frame(wks) end