<div dir="ltr"><div><span style="color:rgb(0,0,0);font-size:14px">Hi Saurabh,</span><br></div><div><br></div><div>You used <span style="color:rgb(0,0,255);font-size:14px">plot = <b>gsn_csm_contour_map</b>(wks,rc,</span><wbr style="color:rgb(0,0,255);font-size:14px"><span style="color:rgb(0,0,255);font-size:14px">res) </span><span style="font-size:14px"><font color="#000000">to plot a 2-D variable with LEV and LAT coordinates. </font></span></div><div><br></div><span style="font-size:14px"><div><font color="#000000">Please note that if you plot a 2-D variable using the function</font><span style="color:rgb(34,34,34);font-size:14px"><font color="#000000"> </font></span><span style="font-size:14px"><font><b><font color="#0000ff">gsn_csm_contour_map</font></b><font color="#000000">,</font><b style="color:rgb(34,34,34)"> </b><span style="color:rgb(34,34,34)">its leftmost (zero) and rightmost (first) dimension should be latitude and longitude with specified named coordinates</span><font color="#0000ff">. </font><font color="#000000">This is why you got the error message about the coordinates.</font></font></span></div><div><font style="font-size:small" color="#000000"><span style="font-size:14px"><br></span></font></div><div><font style="font-size:small" color="#000000"><span style="font-size:14px">For details, please refer to the menu: <a href="http://ncl.ucar.edu/Document/Graphics/Interfaces/gsn_csm_contour_map.shtml">http://ncl.ucar.edu/Document/Graphics/Interfaces/gsn_csm_contour_map.shtml</a></span></font></div></span><div><br></div><div><div><div><div><div><div><font color="#000000"><span style="font-size:14px">In your case, y</span></font><span style="font-size:14px;color:rgb(0,0,0)">ou may simply use gsn_csm_contour (i.e., without map) to plot </span><i style="font-size:14px;color:rgb(0,0,0)">rc</i><span style="font-size:14px;color:rgb(0,0,0)">, where the plot resource sets trYReverse = True (for ocean).</span></div></div></div></div></div></div><div><span style="font-size:14px;color:rgb(0,0,0)"><br></span></div><div><span style="color:rgb(0,0,0);font-size:14px">Cheers, Hoffman</span><br></div><div><span style="font-size:14px;color:rgb(0,0,0)"><br></span></div></div><div class="gmail_extra"><br><div class="gmail_quote">2017-01-03 7:53 GMT+01:00 saurabh rathore <span dir="ltr"><<a href="mailto:rohitsrb2020@gmail.com" target="_blank">rohitsrb2020@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_default" style="color:rgb(0,0,0)">Dear NCL users,<br><br></div><div class="gmail_default" style="color:rgb(0,0,0)">i am quite new to ncl, so i having a problem in plotting the trend of ocean heat. i am having my monthly data consists of time, latitude and level. There is no longitudes in my data. so i want to calculate the trend i.e. the map of regression coefficient in depth and latitudes and later on the significance test of this trend. <br></div><div class="gmail_default" style="color:rgb(0,0,0)">This is my script i am using to calculate the RC value.<br><br>;*****************************<wbr>********************
<br>load "$NCARG_ROOT/lib/ncarg/<wbr>nclscripts/csm/gsn_code.ncl"
<br>load "$NCARG_ROOT/lib/ncarg/<wbr>nclscripts/csm/gsn_csm.ncl"
<br>load "$NCARG_ROOT/lib/ncarg/<wbr>nclscripts/csm/contributed.<wbr>ncl"
<br> <br>begin
<br>;*****************************<wbr>*******************
<br>; create pointer to file and read in temperature
<br>;*****************************<wbr>*******************
<br> diri = "./"
<br> fili = "<a href="http://heat_gm.nc" target="_blank">heat_gm.nc</a>"
<br> in = addfile(diri+fili,"r")
<br>
<br> tmp = in->HEAT_G
<br> printVarSummary(tmp)
<br> ts = tmp(LEV |:, LAT28_153 |:, TIME |:)<br><br>delete(tmp) <wbr> ; no longer needed
<br> <br>;*****************************<wbr>*******************
<br>; create x and calculate the regression coefficients (slopes, trends)
<br>;*****************************<wbr>*******************
<br> time = ts&TIME ; days since 1850-01-01
<br> ;time=ispan(1, 1800, 1)
<br> rc = regCoef(time,ts)
<br> <br>;*****************************<wbr>*******************
<br>; for illustration: change units to j/m^2/year
<br>;*****************************<wbr>******************
<br> <br> rc@long_name = "regression coefficient (trend)"
<br> copy_VarCoords(ts(:,:,0), rc) ; copy lat,lon coords
<br> rc = rc*365 ; (Pa/day)*(365_day/year)
<br> rc@units = "j/m^2/year"
<br> <br> tval = onedtond(rc@tval , dimsizes(rc))
<br> df = onedtond(rc@nptxy, dimsizes(rc)) - 2
<br> b = tval ; b must be same size as tval (and df)
<br> b = 0.5
<br> prob = 1-betainc(df/(df+tval^2),df/2.<wbr>0,b) ; prob(nlat,nlon)
<br> copy_VarCoords(rc, prob)
<br>
<br> rc@long_name = "regression coefficient"
<br> prob@long_name = "probability"
<br> printVarSummary(prob)
<br> printVarSummary(rc)<br><br>;*****************************<wbr>*******************
<br>; plotting parameters
<br>;*****************************<wbr>*******************
<br> wks = gsn_open_wks("png" ,"regress_t-test_test")
<br> ;gsn_define_colormap(wks,"<wbr>ViBlGrWhYeOrRe") ; choose colormap
<br>
<br> res = True
<br> res@gsnFrame=False
<br> res@gsnDraw=False
<br> ;res@gsnMaximize = True ; make large
<br> <br> res@cnFillOn = True ; turn on color
<br> res@cnLinesOn = False ; turn off contour lines
<br> res@cnLineLabelsOn = False ; turn off contour line labels
<br> ;;res@cnFillMode = "RasterFill"
<br> <br> res@cnLevelSelectionMode = "ManualLevels" ; set manual contour levels
<br> res@cnMinLevelValF = -5 ; set min contour level
<br> res@cnMaxLevelValF = 5 ; set max contour level
<br> res@cnLevelSpacingF = 1 ; set contour interval
<br> <br> ;res@mpFillOn = False ; turn off default background gray
<br> ;res@mpCenterLonF = 210
<br>
<br> res@tiMainString = fili
<br> plot = gsn_csm_contour_map(wks,rc,<wbr>res)
<br> <br>prob_p=where (prob.ge.0.95,1,0)
<br>copy_VarCoords(prob, prob_p)
<br>;print(prob_p)
<br>rescn=True
<br>rescn@gsnFrame=False
<br>rescn@gsnDraw=False
<br>rescn@cnLevelSelectionMode = "ManualLevels"
<br>rescn@cnMinLevelValF = -0.5
<br>rescn@cnMaxLevelValF = 1.5
<br>rescn@cnLevelSpacingF = 1.
<br>rescn@cnFillOn = True
<br> rescn@cnMonoFillColor = True
<br> rescn@cnMonoFillPattern = False
<br> rescn@cnConstFEnableFill = False
<br> rescn@cnFillScaleF = 0.55
<br> rescn@cnFillDotSizeF = 0.002
<br> rescn@cnFillColor = "black"
<br> rescn@cnFillPatterns = (/-1,-1,17,-1/)
<br> rescn@cnLinesOn = False
<br> rescn@lbLabelBarOn =False
<br> rescn@cnInfoLabelOn = False
<br> ;rescn@cnInfoLabelFont = 21
<br> <br>;rescn@mpCenterLonF = 210
<br>plotB=gsn_csm_contour(wks,<wbr>prob_p,rescn)
<br> <br>overlay(plot, plotB)
<br>draw(plot)
<br>frame(wks)
<br>end<br><br><br><br></div><div class="gmail_default" style="color:rgb(0,0,0)">After running this script i am getting this error<br><br><br><br clear="all"></div><div style="color:rgb(0,0,0)" class="gmail_default">Variable: tmp<br>Type: double<br>Total Size: 3864672 bytes<br> 483084 values<br>Number of Dimensions: 3<br>Dimensions and sizes: [TIME | 142] x [LEV | 27] x [LAT28_153 | 126]<br>Coordinates: <br> TIME: [731962..736253]<br> LEV: [ 0..2000]<br> LAT28_153: [-62.5..62.5]<br>Number Of Attributes: 5<br> missing_value : -9.999999999999999e+33<br> _FillValue : -9.999999999999999e+33<br> long_name : HEAT_ANM_ALL[X=@DIN]/10^10<br> long_name_mod : X=0E:0E(360)<br> history : From heat_anm_all<br><br>Variable: prob<br>Type: double<br>Total Size: 27216 bytes<br> 3402 values<br>Number of Dimensions: 2<br>Dimensions and sizes: [LEV | 27] x [LAT28_153 | 126]<br>Coordinates: <br> LEV: [ 0..2000]<br> LAT28_153: [-62.5..62.5]<br>Number Of Attributes: 1<br> long_name : probability<br><br>Variable: rc<br>Type: double<br>Total Size: 27216 bytes<br> 3402 values<br>Number of Dimensions: 2<br>Dimensions and sizes: [LEV | 27] x [LAT28_153 | 126]<br>Coordinates: <br> LEV: [ 0..2000]<br> LAT28_153: [-62.5..62.5]<br>Number Of Attributes: 7<br> units : j/m^2/year<br> long_name : regression coefficient<br> _FillValue : -9.999999999999999e+33<br> nptxy : <ARRAY of 3402 elements><br> rstd : <ARRAY of 3402 elements><br> yintercept : <ARRAY of 3402 elements><br> tval : <ARRAY of 3402 elements><br>(0) check_for_y_lat_coord: Warning: Data either does not contain a valid latitude coordinate array or doesn't contain one at all.<br>(0) A valid latitude coordinate array should have a 'units' attribute equal to one of the following values: <br>(0) 'degrees_north' 'degrees-north' 'degree_north' 'degrees north' 'degrees_N' 'Degrees_north' 'degree_N' 'degreeN' 'degreesN' 'deg north'<br>(0) check_for_lon_coord: Warning: Data either does not contain a valid longitude coordinate array or doesn't contain one at all.<br>(0) A valid longitude coordinate array should have a 'units' attribute equal to one of the following values: <br>(0) 'degrees_east' 'degrees-east' 'degree_east' 'degrees east' 'degrees_E' 'Degrees_east' 'degree_E' 'degreeE' 'degreesE' 'deg east'<br>warning:ContourPlotDraw: out of range coordinates encountered; standard AreaFill rendering method may be unreliable;<br> consider setting the resource trGridType to "TriangularMesh" if coordinates contain missing values</div><br><br><div style="color:rgb(0,0,0)" class="gmail_default">please help me out as there is no such link in ncl user list to get rid of this problem. i want a plot of my regression coefficient variable in depth and latitude .<br><br></div><div style="color:rgb(0,0,0)" class="gmail_default">regards, saurabh<span class="HOEnZb"><font color="#888888"><br></font></span></div><span class="HOEnZb"><font color="#888888"><br>-- <br><div class="m_-7141249292146734051gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><font color="#0000ff" size="4"><b><br></b></font></div><div><font color="#0000ff" size="4"><b><br></b></font></div><font color="#0000ff" size="4" face="times new roman, serif"><b>REGARDS</b></font><div><font color="#0000ff" size="4" face="times new roman, serif"><b><br></b></font><div><font color="#0000ff" size="4" face="times new roman, serif"><b>Saurabh Rathore</b></font></div><div><font color="#0000ff" size="4" face="times new roman, serif"><b>Research Scholar (PhD.)</b></font></div><div><font color="#0000ff" size="4" face="times new roman, serif"><b>Centre For Oceans, Rivers, Atmosphere & Land Science Technology</b></font></div><div><font color="#0000ff" size="4" face="times new roman, serif"><b>Indian Institute Of Technology, Kharagpur</b></font></div><div><font color="#0000ff" size="4" face="times new roman, serif"><b>contact :- 91- 8345984434</b></font></div></div></div></div></div></div>
</font></span></div>
<br>______________________________<wbr>_________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/<wbr>mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>