RE: plotting clouds

From: Jamie Scott <James.D.Scott_at_nyahnyahspammersnyahnyah>
Date: Thu, 03 Apr 2008 13:05:03 -0600

Dan,

I like to use fill patterns when transparency is desired. By varying
the density, you can get the effect you are talking about
(sort of). This example uses stippling, but there are other patterns.

-Jamie

ncl code:
::::::::::::::::::::::::::::::::::
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/contributed.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl"

begin

imgdir="/data2/$USER/CCSM3.5/" ; where to put ps files
diri="/data2/$USER/CCSM3.5/"

a=addfile(diri+"b31.001.cam2.0001-0100.CLDTOT.nc","r")
cldtot=a->CLDTOT(0,:,:)
b=addfile(diri+"b31.001.cam2.0001-0100.TS.nc","r")
sst=b->TS(0,:,:)

;plots
plot=new(1,graphic)

wks = gsn_open_wks("ps" ,imgdir+"cld.sst")
gsn_define_colormap(wks,"rainbow")
i = NhlNewColor(wks,0.60,0.60,0.60) ; add grey to color table
ii = NhlNewColor(wks,0.20,0.2,0.2) ;gray
iii = NhlNewColor(wks,0.80,0.80,0.80) ;gray
;*****************************
; create first plot
;*****************************
   resn = True ; create vector resource for color shaded
   res2 = True ; for contours

  resn_at_gsnDraw = False
  resn_at_gsnFrame = False
   resn_at_lbLabelBarOn= True
   resn_at_lbOrientation = "Horizontal" ; label bar
orientation
   resn_at_pmLabelBarOrthogonalPosF = 0.1 ; move label bar
   resn_at_lbLabelStride = 4
   resn_at_tmXBLabelFontHeightF=0.015
   resn_at_tmYLLabelFontHeightF=0.015

   resn_at_cnFillOn = True ; color fill
   resn_at_cnLinesOn=True
   resn_at_cnLineLabelsOn=False
   resn_at_cnLineLabelPlacementMode="Computed"
   resn_at_cnLabelMasking = True
   resn_at_cnLineLabelFontHeightF=0.010
   resn_at_cnLineLabelDensityF=2.5
   resn_at_cnLineLabelPerimSpaceF=0.3
   resn_at_cnLineLabelBackgroundColor=-1
   resn_at_gsnContourZeroLineThicknessF= 1.5

   resn_at_gsnSpreadColors = True ; spread out color table
   resn_at_gsnSpreadColorEnd = -4 ; don't use grey or green, purple in
colorspread

   resn_at_mpFillOn=False
   resn_at_mpMinLatF=-30.
   resn_at_mpMaxLatF=90.
   resn_at_mpMinLonF=60.
   resn_at_mpMaxLonF=300.
   resn_at_mpCenterLonF=180.
   resn_at_mpLimitMode="LatLon"
   resn_at_gsnAddCyclic=False
   resn_at_cnLineThicknessF=0.25
   res2_at_gsnDraw = False
   res2_at_gsnFrame = False

   res2_at_gsnAddCyclic=False
   res2_at_cnInfoLabelOn= False
   res2_at_cnInfoLabelOrthogonalPosF = -1.05 ; move contour
label up
   res2_at_cnInfoLabelParallelPosF = 1.0 ; move contour info to the left
   res2_at_cnInfoLabelFontHeightF=0.006
   res2_at_gsnLeftString=""
   res2_at_gsnRightString=""
   res2_at_gsnCenterString=""
   res2_at_cnFillOn= True
   res2_at_cnLinesOn=False
   res2_at_cnLineLabelPlacementMode="Computed"
   res2_at_cnLineLabelsOn=False
  res2_at_lbLabelBarOn= True
   res2_at_gsnAddCyclic=False
   res2_at_cnLevelSelectionMode = "ExplicitLevels"
   res2_at_cnLevels=(/0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9/)

  res2_at_cnFillPattern=17
  res2_at_cnMonoFillScale = False ; want different
densities
  res2_at_cnFillScales = (/
1.1,1.,0.9,0.8,0.7,0.6,0.5,0.4,0.3,0.2,0.1/) ; the densities
; res2_at_cnFillColor="white"
res2_at_cnFillColors=
(/"gray80","gray80","gray80","gray80","gray80","gray80","gray80","gray80
","gray80","gray80"/)

   resn_at_gsnLeftString= "CCSM b31.001 CLD/SST"
   resn_at_cnLevelSelectionMode ="ManualLevels"
   resn_at_cnMaxLevelValF = 330.
   resn_at_cnMinLevelValF = 250.
   resn_at_cnLevelSpacingF=2.5
   resn_at_gsnRightString="K"
   plot(0) = gsn_csm_contour_map(wks,sst,resn)

   plot2= gsn_csm_contour(wks,cldtot,res2)
   overlay(plot(0),plot2)
   draw(plot(0))
   frame(wks)

delete(a)
delete(b)
exit

end

:::::::::::::::::::::::::::::::::::

On Apr 3, 2008, at 12:00 PM, ncl-talk-request_at_ucar.edu wrote:
>
> Dear NCL users,
>
> I am attempting to plot mid-level integrated cloud fraction output
> from
> CAM, and I'm searching for advice on effective ways to demonstrate
> cloud
> cover outside of the regular color tables. Ideally, I would want 100%
> cloud to be 100% opaque white, 0% cloudy to be 0% opaque white, with a
> linear regression in between. However, I realize that NCL cannot
> handle
> opacity gradients. Has anyone found an interesting way to plot cloud
> fields? Thanks in advance.
>
> -Dan
>
>
> ------------------------------
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk_at_ucar.edu
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
> End of ncl-talk Digest, Vol 53, Issue 3
> ***************************************

_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Thu Apr 03 2008 - 13:05:03 MDT

This archive was generated by hypermail 2.2.0 : Fri Apr 04 2008 - 08:43:08 MDT