<div dir="ltr"><div><div><div><div>[1] You did not follow Alan's suggested code<br></div><div>[2] NCL's printed message told you exactly what the issue is<br><br></div><div> check_for_y_lat_coord ....<br> check_for_x_lon_coord ....</div>
<div><br></div><div>Alan's code:<br><br>lsm =<b>landsea_mask</b>(lsdata, data&lat, data&lon)<br>land_only =<a href="https://www.ncl.ucar.edu/Document/Functions/Built-in/mask.shtml" target="_blank"><b>mask</b></a>(data,lsm.ge.1,True)<br>
copyVarCoords(data, land_only) ; <======== copy coordinates<br><br>=======<br></div>In fact, it would be instructive to you to do the following<br><br>land_only =<a href="https://www.ncl.ucar.edu/Document/Functions/Built-in/mask.shtml" target="_blank"><b>mask</b></a>(data,lsm.ge.1,True)<br>
</div>printVarSummary(land_only) ; examine output<br><br>copyVarCoords(data, land_only) ; <======== copy coordinates<br>printVarSummary(land_only) ; examine output<br><br>================================================<br>
<br></div>Please read the Mini-Language Manual. In particular, the part about coordinate arrays. <br> <a href="http://www.ncl.ucar.edu/Document/Manuals/">http://www.ncl.ucar.edu/Document/Manuals/</a><br><br></div>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.<br>
<div><div><div><div><div><br><br><br><br><div><br><br></div></div></div></div></div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Aug 29, 2014 at 10:00 PM, Kunal Bali <span dir="ltr"><<a href="mailto:kunal.bali9@gmail.com" target="_blank">kunal.bali9@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Dear Alan<br><br></div>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 ??<br>
</div><div class="gmail_extra"><div class="">
<br clear="all"><div><div dir="ltr"><div>Kunal Bali<br></div><div>Research Scholar <br></div><div>Radio & Atmospheric Science Division <br></div><div>CSIR - National Physical Laboratory<br></div><div>New Delhi - 110012<br>
<br></div><div><br></div><div><br></div><div><br></div><div><p style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;border-collapse:collapse;font-family:Tahoma,Verdana;font-size:12px"><font color="#1F497D"><br>
</font></p></div></div></div>
<br><br></div><div><div class="h5"><div class="gmail_quote">On Sat, Aug 30, 2014 at 3:40 AM, Alan Brammer <span dir="ltr"><<a href="mailto:abrammer@albany.edu" target="_blank">abrammer@albany.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<p dir="ltr"><a href="https://www.ncl.ucar.edu/Document/Functions/Shea_util/landsea_mask.shtml" target="_blank">https://www.ncl.ucar.edu/Document/Functions/Shea_util/landsea_mask.shtml</a></p>
<p dir="ltr"><a href="https://www.ncl.ucar.edu/Document/Functions/Built-in/mask.shtml" target="_blank">https://www.ncl.ucar.edu/Document/Functions/Built-in/mask.shtml</a></p>
<p dir="ltr">This is based on a 1x1 land sea file, if you have higher res data then you might want a more accurate mask. <br><br></p>
<p dir="ltr">load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"<br>
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"<br>
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl" load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/<a href="https://www.ncl.ucar.edu/Document/Functions/Shea_util/shea_util.shtml" target="_blank">shea_util.ncl</a>"</p>
<p dir="ltr">ncl 2> begin<br>
ncl 3> in = addfile("/home/kunal/<a href="http://14-01.nc/" target="_blank">14-01.</a><a href="http://14-01.nc/" target="_blank">nc</a>","r")<br>
ncl 4> data = in->TotCH4_A(:,:) <br>
ncl 5><br>
printVarSummary(data) ; check coords are named lat lon</p>
<p dir="ltr">a =<a href="https://www.ncl.ucar.edu/Document/Functions/Built-in/addfile.shtml" target="_blank"><b>addfile</b></a>("$NCARG_ROOT/lib/ncarg/data/cdf/<a href="http://landsea.nc" target="_blank">landsea.nc</a>","r") lsdata = a->LSMASK<br>
lsm =<b>landsea_mask</b>(lsdata,data&lat,data&lon)<br>
land_only =<a href="https://www.ncl.ucar.edu/Document/Functions/Built-in/mask.shtml" target="_blank"><b>mask</b></a>(data,lsm.ge.1,True)<br>
copyVarCoords(data, land_only) ; in case mask doesn't do this</p>
<p dir="ltr">ncl 7><br>
ncl 8> wks = gsn_open_wks("x11","mask")<br>
ncl 9> gsn_define_colormap(wks,"BlAqGrYeOrRe")<br>
ncl 10> res = True<br>
ncl 11> res@cnFillOn = True<br>
ncl 12> res@cnLinesOn = False<br>
ncl 13> res@gsnSpreadColors = True<br>
ncl 14> res@gsnSpreadColorStart = 10<br>
ncl 15> res@gsnSpreadColorEnd = 96 <br>
ncl 16> res@cnLevelSpacingF = 3<br>
ncl 17> res@lbLabelString = 4<br>
ncl 18> res@tiMainString = "Land Only"<br>
ncl 19> plot = gsn_csm_contour_map_ce(wks,land_only,res)<br>
ncl 20> end</p>
<div class="gmail_quote"><div><div>On 29 Aug 2014 15:26, "Kunal Bali" <<a href="mailto:kunal.bali9@gmail.com" target="_blank">kunal.bali9@gmail.com</a>> wrote:<br type="attribution"></div></div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div>
<div dir="ltr"><div><div>Could anyone provdies me the scripts for attached file.<br><br></div>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 <br>
<br></div>SO please provides me here if you can. Or i can send one file if anyone interested ??<br><div><br clear="all"><div><div><div><div dir="ltr"><div>Kunal Bali<br></div><div>Research Scholar <br></div><div>Radio & Atmospheric Science Division <br>
</div><div>CSIR - National Physical Laboratory<br></div><div>New Delhi - 110012<br><br></div><div><br></div><div><br></div><div><br></div><div><p style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;border-collapse:collapse;font-family:Tahoma,Verdana;font-size:12px">
<font color="#1F497D"><br></font></p></div></div></div>
</div></div></div></div>
<br></div></div>_______________________________________________<br>
ncl-talk mailing list<br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div>
</blockquote></div><br></div></div></div>
<br>_______________________________________________<br>
ncl-talk mailing list<br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>