Re: ShadeLtContour and ShadeLtGtContour

From: Takeshi Enomoto (eno AT XXXXXX)
Date: Tue Dec 23 2003 - 17:54:17 MST

  • Next message: Dave Kennison: "Re: Polygon plots"

    Dear Dennis,

    Thanks for your comments.

    On 2003/12/23, at 7:22, Dennis Shea wrote:

    > undef ("ShadeLtContour") ; undefine previous definition
    > function ShadeLtContour (plot:graphic, CnLt:float, FillPatLt:integer )
    > ;
    > put in the 'fix'
    > end

    So, it is .le. in ShadeLtContour that needs a fix.
    I still don't understand why levels >= CnGt
    rather than > CnGt are shaded.

    My problem is rather with the asymmetry between CnLt and CnGt in
    ShadeLtGtContour.
    In a trival example below, contours between 12000 and 12250 < cnlt
    and those >=cngt are shaded.
    Where does this asymmetry come from?
    I could not figure out from your ncl source.

    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
       mon = 8
       lev = 200.
       cint = 50.
       cmin = 12000.
       cmax = 12600.
       cnlt = 12300.
       cngt = 12500.

       path = "$HOME/data/NCEP/data/monthly/"

       f = addfile(path+"hgt.mon.ltm.nc", "r") ; data from CDC
       hgt = f->hgt(mon-1,{lev},:,:)

       wks = gsn_open_wks("x11", "hgt")

       res = True
       res@gsnDraw = False
       res@gsnFrame = False
       res@cnLevelSelectionMode = "ManualLevels"
       res@cnLevelSpacingF = cint
       res@cnMinLevelValF = cmin
       res@cnMaxLevelValF = cmax

       plot = gsn_csm_contour_map_ce(wks, hgt, res)
       plot = ShadeLtGtContour(plot,cnlt,6,cngt,17)
       draw(plot)
       frame(wks)
    end

    > if (fabs(x-y).lt.eps) then

    I meant this. We don't have to do this in ncl, right?

    -----
    Dr. Takeshi Enomoto
    eno@jamstec.go.jp
    Frontier Research System for Global Change

    _______________________________________________
    ncl-talk mailing list
    ncl-talk@ucar.edu
    http://mailman.ucar.edu/mailman/listinfo/ncl-talk



    This archive was generated by hypermail 2b29 : Wed Dec 24 2003 - 10:01:27 MST