Re: About masking using RANGS_GSHHS database.

From: Mary Haley (haley AT ucar.edu)
Date: Thu Aug 11 2005 - 08:37:30 MDT

  • Next message: jerry: "plot setting problem"

    On Thu, 11 Aug 2005, jerry wrote:

    > Hi,everyone,
    >
    > I have a 2D distributed grid dataset.
    > And also, trying to mask land data in using RANGS_GSHHS database.
    > But,NCL doesn't seem to support RANGS database in "mpAreaMasking".
    >
    > Does anyone know how to mask land in RANGS_GSHHS database with 2D data?

    Hi Jerry,

    You can get around the problem of not being able to use
    mpAreaMasking with the RANGS database by using the DrawOrder
    resources, or by drawing various pieces of your maps and contours
    one at a time, in the order you want to mask the other.

    For example, if you are just trying to mask land, and you are using
    one of the gsn_csm_xxxx functions, then you can use the
    cnFillDrawOrder resource, and set it to "PreDraw". This will cause the
    filled contours to be drawn before the filled map, and since he land
    part of the map is filled and the ocean part is left transparent, you
    will still see the contours over the ocean.

    Here's a short example:

    load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
    load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"

    begin

       f = addfile("$NCARG_ROOT/lib/ncarg/data/cdf/contour.cdf","r")

       t = f->T(0,0,:,:)

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

       res = True
       res@gsnAddCyclic = False

       res@cnFillOn = True
       res@cnFillDrawOrder = "PreDraw"

       res@mpDataBaseVersion = "HighRes"

       res@mpMinLatF = 20.
       res@mpMaxLatF = 50.
       res@mpMinLonF = -110.
       res@mpMaxLonF = -60.

       plot = gsn_csm_contour_map(wks,t,res)
    end
    _______________________________________________
    ncl-talk mailing list
    ncl-talk@ucar.edu
    http://mailman.ucar.edu/mailman/listinfo/ncl-talk



    This archive was generated by hypermail 2b29 : Thu Aug 11 2005 - 09:16:30 MDT