[ncl-talk] query

Alan Brammer abrammer at albany.edu
Fri Aug 29 16:10:20 MDT 2014


https://www.ncl.ucar.edu/Document/Functions/Shea_util/landsea_mask.shtml

https://www.ncl.ucar.edu/Document/Functions/Built-in/mask.shtml

This is based on a 1x1 land sea file, if you have higher res data then you
might want a more accurate mask.

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
<https://www.ncl.ucar.edu/Document/Functions/Shea_util/shea_util.shtml>"

ncl 2> begin
ncl 3> in = addfile("/home/kunal/14-01. <http://14-01.nc/>nc
<http://14-01.nc/>","r")
ncl 4> data = in->TotCH4_A(:,:)
ncl 5>
printVarSummary(data) ; check coords are named lat lon

a =*addfile*
<https://www.ncl.ucar.edu/Document/Functions/Built-in/addfile.shtml>
("$NCARG_ROOT/lib/ncarg/data/cdf/landsea.nc","r") lsdata = a->LSMASK
lsm =*landsea_mask*(lsdata,data&lat,data&lon)
land_only =*mask*
<https://www.ncl.ucar.edu/Document/Functions/Built-in/mask.shtml>
(data,lsm.ge.1,True)
copyVarCoords(data, land_only) ; in case mask doesn't do this

ncl 7>
ncl 8> wks = gsn_open_wks("x11","mask")
ncl 9> gsn_define_colormap(wks,"BlAqGrYeOrRe")
ncl 10> res = True
ncl 11> res at cnFillOn = True
ncl 12> res at cnLinesOn = False
ncl 13> res at gsnSpreadColors = True
ncl 14> res at gsnSpreadColorStart = 10
ncl 15> res at gsnSpreadColorEnd = 96
ncl 16> res at cnLevelSpacingF = 3
ncl 17> res at lbLabelString = 4
ncl 18> res at tiMainString = "Land Only"
ncl 19> plot = gsn_csm_contour_map_ce(wks,land_only,res)
ncl 20> end
On 29 Aug 2014 15:26, "Kunal Bali" <kunal.bali9 at gmail.com> wrote:

> Could anyone provdies me the scripts for attached file.
>
> If i have variable TotCH4_A , Latitude, Longitude. So what could be the
> scripts that one. If you write here that would be better because i have
> tried the example from NCL tutorials but getting errors
>
> SO please provides me here if you can. Or i can send one file if anyone
> interested ??
>
> Kunal Bali
> Research Scholar
> Radio & Atmospheric Science Division
> CSIR - National Physical Laboratory
> New Delhi - 110012
>
>
>
>
>
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20140829/51b75bab/attachment.html 


More information about the ncl-talk mailing list