[ncl-talk] query

Dennis Shea shea at ucar.edu
Sat Aug 30 07:38:54 MDT 2014


[1] You did not follow Alan's suggested code
[2] NCL's printed message told you exactly what the issue is

          check_for_y_lat_coord ....
          check_for_x_lon_coord ....

Alan's code:

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)           ; <======== copy coordinates

=======
In fact, it would be instructive to you to do the following

land_only =*mask*
<https://www.ncl.ucar.edu/Document/Functions/Built-in/mask.shtml>
(data,lsm.ge.1,True)
printVarSummary(land_only)                 ; examine output

copyVarCoords(data, land_only)           ; <======== copy coordinates
printVarSummary(land_only)                 ; examine output

================================================

Please read the Mini-Language Manual. In particular, the part about
coordinate arrays.
   http://www.ncl.ucar.edu/Document/Manuals/

Without coordinates associated with a variable in some way (coordinate
arrays for rectilinear grids or the reserved attributes lat2d/lon2d), the
plotting code has no idea where to plot the data.








On Fri, Aug 29, 2014 at 10:00 PM, Kunal Bali <kunal.bali9 at gmail.com> wrote:

> Dear Alan
>
> please find the attached file . Here you can see all scripts with out put
> result. The out put is not coming within the coordinates. How to fix it ??
>
> Kunal Bali
> Research Scholar
> Radio & Atmospheric Science Division
> CSIR - National Physical Laboratory
> New Delhi - 110012
>
>
>
>
>
>
>
> On Sat, Aug 30, 2014 at 3:40 AM, Alan Brammer <abrammer at albany.edu> wrote:
>
>> 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
>>>
>>>
>
> _______________________________________________
> 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/20140830/fdb6f4da/attachment.html 


More information about the ncl-talk mailing list