Re: About masking using RANGS_GSHHS database.

From: ¼B©¨ªY <shinx_at_nyahnyahspammersnyahnyah>
Date: Wed Jan 13 2010 - 18:03:00 MST

Hi,

 

I have tried the example below to mask land and it works.

But what about if I want to mask ocean (instead of land)?

(of course, at the same situation as Jerry, I am using RANGS_GSHHS database)

 

 

> 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

List instructions, subscriber options, unsubscribe:

http://mailman.ucar.edu/mailman/listinfo/ncl-talk

 

 

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Wed Jan 13 18:00:36 2010

This archive was generated by hypermail 2.1.8 : Fri Jan 15 2010 - 13:51:45 MST