Re: About masking using RANGS_GSHHS database.

From: Adam Phillips <asphilli_at_nyahnyahspammersnyahnyah>
Date: Wed Jan 13 2010 - 20:31:10 MST

Hi Shinx,
Make sure you capitalize the "C" in mpLandFillColor and mpOceanFillColor,
as the error message is hinting that you didn't.

Also, it is strongly recommended that you upgrade your version of NCL to
the current version, 5.1.1. Numerous enhancements have been implemented
since 4.3.1.
Best regards,
Adam

> Thanks dave
>
>
>
> I added them but still got gray land and transparent ocean, and it
> resulted
> in the message below:
>
>
>
> warning:mpLandFillcolor is not a valid resource in map at this time
>
> warning:mpOceanFillcolor is not a valid resource in map at this time
>
>
>
> Should I turn on some resources before res@mpOceanFillColor and
> res@mpLandFillColor ?
>
>
>
> Ps. My NCL version is 4.3.1
>
>
>
> shinx
>
>
>
> _____
>
> From: David Brown [mailto:dbrown@ucar.edu]
> Sent: Thursday, January 14, 2010 9:34 AM
> To: ¼B©¨ªY
> Cc: ncl-talk@ucar.edu
> Subject: Re: About masking using RANGS_GSHHS database.
>
>
>
> By default, gsn_csm_contour_map draws land as filled and ocean
> transparent,
> but you can do the reverse by adding the following resource settings:
>
>
>
> res@mpOceanFillColor = "gray"
>
> res@mpLandFillColor = "transparent"
>
>
>
> Good luck.
>
> -dave
>
>
>
>
>
> On Jan 13, 2010, at 6:03 PM, ¼B©¨ªY wrote:
>
>
>
> 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
>
>
>
> _______________________________________________
> 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 20:32:50 2010

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