<div dir="ltr">Hi Kunal,<div>I can&#39;t speak about the last error with the information provided, but the previous two error messages are indicating that nptxy and tval are not attributes of the rc array. You are creating the rc array similar to the examples on the regCoef documentation page like this correct:</div><div>rc   = regCoef(x,y)<br></div><div><span style="font-size:12.8px">df    = rc@nptxy-2   ; degrees of freedom</span><br style="font-size:12.8px"><span style="font-size:12.8px">tval  = rc@tval      ; t-statistic</span><br style="font-size:12.8px"><span style="font-size:12.8px">prob  = betainc(df/(df+tval^2),df/2.0,</span><wbr style="font-size:12.8px"><span style="font-size:12.8px">0.5) </span><br></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">If you have any further questions please reply to the ncl-talk email list.</span></div><div><span style="font-size:12.8px">Adam</span></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jan 12, 2017 at 9:27 AM, Kunal Bali <span dir="ltr">&lt;<a href="mailto:kunal.bali9@gmail.com" target="_blank">kunal.bali9@gmail.com</a>&gt;</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><div><div>  after applying the prob functions <br> <br>  df    = rc@nptxy-2   ; degrees of freedom<br>   tval  = rc@tval      ; t-statistic<br>   prob  = betainc(df/(df+tval^2),df/2.0,<wbr>0.5) <br><br><br></div>I am receiving some errors<br><br>warning:Attempt to reference attribute (nptxy) which is undefined<br>warning:Attempt to reference attribute (tval) which is undefined<br>(0)    Error: scalar_field: If the input data is 1-dimensional, you must set sfXArray and sfYArray to 1-dimensional arrays of the same length.<br><br><br></div>So how can I define these errors ?<br><br></div><div><div><br></div></div></div><div class="gmail_extra"><br clear="all"><div><div class="m_-7433046326469668859gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>Kunal Bali<br></div><div>Research Scholar <br></div><div>Radio &amp; Atmospheric Science Division <br></div><div>CSIR - National Physical Laboratory<br></div><div>New Delhi - 110012<br></div><div>India<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>
<br><div class="gmail_quote">On Wed, Jan 4, 2017 at 2:02 AM, Dennis Shea <span dir="ltr">&lt;<a href="mailto:shea@ucar.edu" target="_blank">shea@ucar.edu</a>&gt;</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><div>Please read the regCoef documentation. See Example 1<br><br></div>Even above:<br><br>Variable: rc<br></div>[SNIP]<span><span class="m_-7433046326469668859m_-7665898043697166395gmail-im"><br></span><div><span class="m_-7433046326469668859m_-7665898043697166395gmail-im">  nptxy :    &lt;ARRAY of 3216 elements&gt;<br>  rstd :    &lt;ARRAY of 3216 elements&gt;<br>  yintercept :    &lt;ARRAY of 3216 elements&gt;<br>  tval :    &lt;ARRAY of 3216 elements&gt;<br><br></span></div></span><div><span class="m_-7433046326469668859m_-7665898043697166395gmail-im">From the documentation:<br><br></span><br>Now use the information to calculate the probability.
<pre>  
                        ; for clarity only, explicitly assing to a new variable
   df    = rc@nptxy-2   ; degrees of freedom
   tval  = rc@tval      ; t-statistic
   prob  = <a href="http://www.ncl.ucar.edu/Document/Functions/Built-in/betainc.shtml" target="_blank"><strong>betainc</strong></a>(df/(df+tval^2),df/2.0,<wbr>0.5)   
  </pre></div></div><div class="m_-7433046326469668859HOEnZb"><div class="m_-7433046326469668859h5"><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jan 3, 2017 at 11:53 AM, Kunal Bali <span dir="ltr">&lt;<a href="mailto:kunal.bali9@gmail.com" target="_blank">kunal.bali9@gmail.com</a>&gt;</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>Thanks Dennis<br><br></div>It worked very well. <br>Can we get the p values of the given data ? <br></div><div class="gmail_extra"><span><br clear="all"><div><div class="m_-7433046326469668859m_-7665898043697166395m_-9044587640441829136gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>Kunal Bali<br></div><div>Research Scholar <br></div><div>Radio &amp; Atmospheric Science Division <br></div><div>CSIR - National Physical Laboratory<br></div><div>New Delhi - 110012<br></div><div>India<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>
<br></span><div><div class="m_-7433046326469668859m_-7665898043697166395h5"><div class="gmail_quote">On Tue, Jan 3, 2017 at 11:36 PM, Dennis Shea <span dir="ltr">&lt;<a href="mailto:shea@ucar.edu" target="_blank">shea@ucar.edu</a>&gt;</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>;=======<br></div>; SCRIPT: tst_regCoef.ncl<br>;=======<br><div>   diri = &quot;./&quot;<br>   fili = &quot;<a href="http://test.nc" target="_blank">test.nc</a>&quot;<br>   pthi = diri+fili<br>   f    = addfile(pthi, &quot;r&quot;)<br><br>   y    = f-&gt;TOTEXTTAU               ; (time, lat, lon)<br>   printVarSummary(y)            <wbr>    ; [time | 36] x [lat | 67] x [lon | 48]<br>   print(&quot;==========&quot;)<br><br>  ;dimy = dimsizes(y)<br>  ;ntim = dimy(0)<br>  ;nlat = dimy(1)<br>  ;mlon = dimy(2)<br><br>   printVarSummary(y(lat|:,lon|:,<wbr>time|:))   ; [lat | 67] x [lon | 48] x [time | 36]<br>   print(&quot;==========&quot;)<br><br>   rc   = regCoef(y&amp;time, y(lat|:,lon|:,time|:))<span><br><br>   copy_VarCoords(y(0,:,:), rc)<br>   printVarSummary(rc)<br>   printMinMax(rc,1)<br><br></span>==============================<wbr>==============================<wbr>===========<br>OUTPUT<br>==============================<wbr>==============================<wbr>===========<br>%&gt; ncl tst_regCoef.ncl<br> Copyright (C) 1995-2015 - All Rights Reserved<br> University Corporation for Atmospheric Research<span><br> NCAR Command Language Version 6.3.0<br></span> The use of this software is governed by a License Agreement.<br> See <a href="http://www.ncl.ucar.edu/" target="_blank">http://www.ncl.ucar.edu/</a> for more details.<br><br>Variable: y<br>Type: float<br>Total Size: 463104 bytes<br>            115776 values<br>Number of Dimensions: 3<br>Dimensions and sizes:    [time | 36] x [lat | 67] x [lon | 48]<br>Coordinates: <br>            time: [526680..18934200]<span><br>            lat: [   5..  38]<br>            lon: [68.125..97.5]<br>Number Of Attributes: 7<br></span>  standard_name :    Total Aerosol Extinction AOT [550 nm]<br>  long_name :    Total Aerosol Extinction AOT [550 nm]<br>  units :    1<br>  _FillValue :    1e+15<br>  fmissing_value :    1e+15<br>  vmax :    1e+15<br>  vmin :    -1e+15<span><br>(0)    ==========<br><br>Variable: y (subsection)<br>Type: float<br></span>Total Size: 463104 bytes<br>            115776 values<br>Number of Dimensions: 3<br>Dimensions and sizes:    [lat | 67] x [lon | 48] x [time | 36]<br>Coordinates: <br><span>            lat: [   5..  38]<br>            lon: [68.125..97.5]<br></span>            time: [526680..18934200]<span><br>Number Of Attributes: 7<br>  vmin :    -1e+15<br>  vmax :    1e+15<br>  fmissing_value :    1e+15<br>  _FillValue :    1e+15<br></span>  units :    1<br>  long_name :    Total Aerosol Extinction AOT [550 nm]<br>  standard_name :    Total Aerosol Extinction AOT [550 nm]<br>(0)    ==========<br><br>Variable: rc<br>Type: double<br>Total Size: 25728 bytes<span><br>            3216 values<br>Number of Dimensions: 2<br>Dimensions and sizes:    [lat | 67] x [lon | 48]<br>Coordinates: <br></span><span>            lat: [   5..  38]<br>            lon: [68.125..97.5]<br></span>Number Of Attributes: 5<br>  _FillValue :    999999986991104<span><br>  nptxy :    &lt;ARRAY of 3216 elements&gt;<br>  rstd :    &lt;ARRAY of 3216 elements&gt;<br>  yintercept :    &lt;ARRAY of 3216 elements&gt;<br>  tval :    &lt;ARRAY of 3216 elements&gt;<br>(0)     <br></span>(0)    min=-1.660007214663053e-09   max=2.459720467540745e-08<br></div></div><div class="m_-7433046326469668859m_-7665898043697166395m_-9044587640441829136HOEnZb"><div class="m_-7433046326469668859m_-7665898043697166395m_-9044587640441829136h5"><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jan 2, 2017 at 9:36 PM, Kunal Bali <span dir="ltr">&lt;<a href="mailto:kunal.bali9@gmail.com" target="_blank">kunal.bali9@gmail.com</a>&gt;</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 Dennis, <br>Thanks for all the suggestions. <br>I have attached a test file. So you can try on that.<br><br></div>Thanks <br></div><div class="gmail_extra"><span><br clear="all"><div><div class="m_-7433046326469668859m_-7665898043697166395m_-9044587640441829136m_226346907866851350m_9116501929336920820gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>Kunal Bali<br></div><div>Research Scholar <br></div><div>Radio &amp; Atmospheric Science Division <br></div><div>CSIR - National Physical Laboratory<br></div><div>New Delhi - 110012<br></div><div>India<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>
<br></span><div><div class="m_-7433046326469668859m_-7665898043697166395m_-9044587640441829136m_226346907866851350h5"><div class="gmail_quote">On Tue, Jan 3, 2017 at 3:20 AM, Dennis Shea <span dir="ltr">&lt;<a href="mailto:shea@ucar.edu" target="_blank">shea@ucar.edu</a>&gt;</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>tst_regCoef.Kunal_Bali.ncl   contains:<br><br>;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%<wbr>%%%%%%%%<br></div>   ntim = 13149<br>   nlat = 67<br>   mlon = 48<br>   x    = ispan(1,ntim,1)<br>   x!0  = &quot;time&quot;<br>   printVarSummary(x)<br>   print(&quot;==========&quot;)<br><br>   y    = random_uniform(100,200, (/ntim,nlat,mlon/))<br>   y!0  = &quot;time&quot;<br>   y!1  = &quot;lat&quot;<br>   y!2  = &quot;lon&quot;<br>   printVarSummary(y)     ; [time | 13149] x [lat | 67] x [lon | 48]<br>   print(&quot;==========&quot;)<br><br>   printVarSummary(y(lat|:,lon|:,<wbr>time|:))   ; [lat | 67] x [lon | 48] x [time | 13149]<br>   print(&quot;==========&quot;)<br><br>   rc   = regCoef(x,y(lat|:,lon|:,time|:<wbr>))<br><br>   copy_VarCoords(y(0,:,:), rc)<br>   printVarSummary(rc)<br>   printMinMax(rc,1)<br><div>;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%<wbr>%%%%%%%%%<br><br>%&gt; ncl tst_regCoef.Kunal_Bali.ncl<br><br> NCAR Command Language Version 6.3.0<br><br><br>Variable: x<br>Type: integer<br>Total Size: 52596 bytes<span><br>            13149 values<br>Number of Dimensions: 1<br>Dimensions and sizes:    [time | 13149]<br>Coordinates: <br></span>(0)    ==========<span><br><br>Variable: y<br>Type: float<br>Total Size: 169148736 bytes<br>            42287184 values<br>Number of Dimensions: 3<br>Dimensions and sizes:    [time | 13149] x [lat | 67] x [lon | 48]<br>Coordinates: <br></span>(0)    ==========<br><br>Variable: y (subsection)<span><br>Type: float<br>Total Size: 169148736 bytes<br>            42287184 values<br>Number of Dimensions: 3<br></span>Dimensions and sizes:    [lat | 67] x [lon | 48] x [time | 13149]<br>Coordinates: <br>(0)    ==========<br><br>Variable: rc<br>Type: float<br>Total Size: 12864 bytes<br>            3216 values<br>Number of Dimensions: 2<br>Dimensions and sizes:    [lat | 67] x [lon | 48]<br>Coordinates: <br>Number Of Attributes: 5<br>  _FillValue :    9.96921e+36<br>  nptxy :    &lt;ARRAY of 3216 elements&gt;<br>  rstd :    &lt;ARRAY of 3216 elements&gt;<br>  yintercept :    &lt;ARRAY of 3216 elements&gt;<br>  tval :    &lt;ARRAY of 3216 elements&gt;<br>(0)     <br>(0)    min=-0.000292889   max=0.000215768<br><br>==============================<wbr>====<br><br></div><div>There are no logged bug fixes for regCoef. Hence, not sure of the issus.<br><br>==============================<wbr>=====<br></div><div>You can ftp the data file but we can not use old NCL versions:<br><br></div><div>ftp <a href="http://ftp.cgd.ucar.edu" target="_blank">ftp.cgd.ucar.edu</a><br></div><div>anonymous<br></div><div>your_email<br></div><div>cd incoming<br></div><div>put your_data_file<br></div><div>quit<br><br></div><div>Notify ncl-talk after successful transfer of the file.<br><br><br></div><div><br><br></div><div><br></div></div><div class="m_-7433046326469668859m_-7665898043697166395m_-9044587640441829136m_226346907866851350m_9116501929336920820HOEnZb"><div class="m_-7433046326469668859m_-7665898043697166395m_-9044587640441829136m_226346907866851350m_9116501929336920820h5"><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jan 2, 2017 at 12:05 PM, Kunal Bali <span dir="ltr">&lt;<a href="mailto:kunal.bali9@gmail.com" target="_blank">kunal.bali9@gmail.com</a>&gt;</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><div>The summarty shows <br><br><b>Variable: y<br>Type: float<br>Total Size: 169148736 bytes<br>            42287184 values<br>Number of Dimensions: 3<br>Dimensions and sizes:    [time | 13149] x [lat | 67] x [lon | 48]<br>Coordinates: <br>            time: [1080..18934200]<br>            lat: [   5..  38]<br>            lon: [68.125..97.5]<br>Number Of Attributes: 7<br>  vmin :    -1e+15<br>  vmax :    1e+15<br>  fmissing_value :    1e+15<br>  _FillValue :    1e+15<br>  units :    W m-2<br>  long_name :    toa_net_downward_shortwave_flu<wbr>x_assuming_clear_sky<br>  standard_name :    toa_net_downward_shortwave_flu<wbr>x_assuming_clear_sky</b><br><br>Variable: x<br>Type: double<br>Total Size: 105192 bytes<br>            13149 values<br>Number of Dimensions: 1<br>Dimensions and sizes:    [time | 13149]<br>Coordinates: <br>Number Of Attributes: 3<br>  standard_name :    time<br>  units :    minutes since 1980-01-01 00:30:00<br>  calendar :    standard<span><br>fatal:regCoef: The rightmost dimension of x must be equal to the rightmost dimension of y<br></span>fatal:[&quot;Execute.c&quot;:8567]:Execu<wbr>te: Error occurred at or near line 37 in file trend.ncl<br><br><br><br></div>And the script is <br><br>  <b> tmp  = a-&gt;SWTNTCLR<br>   y   = tmp(time|:,lat|:,lon|:)       <wbr>        ; reorder variable<span><br><br>   delete(tmp)                   <wbr>               ; no longer needed<br><br><br>;*****************************<wbr>*******************<br>; create x and calculate the regression coefficients (slopes, trends)    <br>;*****************************<wbr>*******************<br></span>   x         = y&amp;time   <br>   printVarSummary(y)<br>   printVarSummary(x)<br>               <br>   rc           = regCoef(x,y)     <br><br><br></b></div><b>So how to set the x (which is time) with y (which is time|lat|lon)<span class="m_-7433046326469668859m_-7665898043697166395m_-9044587640441829136m_226346907866851350m_9116501929336920820m_747290511169588846HOEnZb"><font color="#888888"><br></font></span></b><span class="m_-7433046326469668859m_-7665898043697166395m_-9044587640441829136m_226346907866851350m_9116501929336920820m_747290511169588846HOEnZb"><font color="#888888"><div><b>   </b><br><div><div><br></div></div></div></font></span></div><div class="gmail_extra"><span class="m_-7433046326469668859m_-7665898043697166395m_-9044587640441829136m_226346907866851350m_9116501929336920820m_747290511169588846HOEnZb"><font color="#888888"><br clear="all"><div><div class="m_-7433046326469668859m_-7665898043697166395m_-9044587640441829136m_226346907866851350m_9116501929336920820m_747290511169588846m_-4619085922763679081gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>Kunal Bali<br></div><div>Research Scholar <br></div><div>Radio &amp; Atmospheric Science Division <br></div><div>CSIR - National Physical Laboratory<br></div><div>New Delhi - 110012<br></div><div>India<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></font></span><div><div class="m_-7433046326469668859m_-7665898043697166395m_-9044587640441829136m_226346907866851350m_9116501929336920820m_747290511169588846h5">
<br><div class="gmail_quote">On Mon, Jan 2, 2017 at 11:38 PM, Dennis Shea <span dir="ltr">&lt;<a href="mailto:shea@ucar.edu" target="_blank">shea@ucar.edu</a>&gt;</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><div><div><div>I believe ncl-talk has been down his raod with you before. Please look at the error messages and *always* include printVarSummary of the the variables used. Place the <b>**before**</b> the line where the error occurs.<br></div><br></div>printVarSummary(x)<br></div>printVarSummary(y)<br></div>or <br>printVarSummary(y<span class="m_-7433046326469668859m_-7665898043697166395m_-9044587640441829136m_226346907866851350m_9116501929336920820m_747290511169588846m_-4619085922763679081m_-2949817932421431838gmail-im">(lat|:,lon|:,<wbr>time|:) )<br><br></span><span><span class="m_-7433046326469668859m_-7665898043697166395m_-9044587640441829136m_226346907866851350m_9116501929336920820m_747290511169588846m_-4619085922763679081m_-2949817932421431838gmail-im">rc   = <b>regCoef</b>(x, y(lat|:,lon|:,time|:) )</span><br></span><div><div><div><span class="m_-7433046326469668859m_-7665898043697166395m_-9044587640441829136m_226346907866851350m_9116501929336920820m_747290511169588846m_-4619085922763679081m_-2949817932421431838gmail-im">  <br>The error message state:</span><span><br><pre><b><span class="m_-7433046326469668859m_-7665898043697166395m_-9044587640441829136m_226346907866851350m_9116501929336920820m_747290511169588846m_-4619085922763679081m_-2949817932421431838gmail-im">fatal:regCoef: The rightmost dimension of x must be <br></span>equal to the rightmost dimension of y<br><br></b></pre></span><pre>Please look  ....<b><br></b></pre><pre>What are the sizes of &#39;x&#39; and the rightmost dimension of &#39;y&#39; ?<b><br><br></b></pre><br></div></div></div></div><div class="m_-7433046326469668859m_-7665898043697166395m_-9044587640441829136m_226346907866851350m_9116501929336920820m_747290511169588846m_-4619085922763679081HOEnZb"><div class="m_-7433046326469668859m_-7665898043697166395m_-9044587640441829136m_226346907866851350m_9116501929336920820m_747290511169588846m_-4619085922763679081h5"><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jan 2, 2017 at 10:45 AM, Kunal Bali <span dir="ltr">&lt;<a href="mailto:kunal.bali9@gmail.com" target="_blank">kunal.bali9@gmail.com</a>&gt;</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>I have 6.2.0 NCL version<br><br></div>I tried with <br><span>  <br>rc   = <b>regCoef</b>(x, y(lat|:,lon|:,time|:) )<br><pre></pre></span><pre>but still getting some error<br><b><span>fatal:regCoef: The rightmost dimension of x must be <br></span>equal to the rightmost dimension of y</b><br><br></pre><br><div><br></div><div class="gmail_extra">regards<span class="m_-7433046326469668859m_-7665898043697166395m_-9044587640441829136m_226346907866851350m_9116501929336920820m_747290511169588846m_-4619085922763679081m_-2949817932421431838HOEnZb"><font color="#888888"><br clear="all"></font></span></div><div class="gmail_extra"><span class="m_-7433046326469668859m_-7665898043697166395m_-9044587640441829136m_226346907866851350m_9116501929336920820m_747290511169588846m_-4619085922763679081m_-2949817932421431838HOEnZb"><font color="#888888"><div><div class="m_-7433046326469668859m_-7665898043697166395m_-9044587640441829136m_226346907866851350m_9116501929336920820m_747290511169588846m_-4619085922763679081m_-2949817932421431838m_-6920874904743519709gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>Kunal Bali<br></div><br><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></font></span><div><div class="m_-7433046326469668859m_-7665898043697166395m_-9044587640441829136m_226346907866851350m_9116501929336920820m_747290511169588846m_-4619085922763679081m_-2949817932421431838h5">
<br><div class="gmail_quote">On Mon, Jan 2, 2017 at 9:24 PM, Dennis Shea <span dir="ltr">&lt;<a href="mailto:shea@ucar.edu" target="_blank">shea@ucar.edu</a>&gt;</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><div><div><div>I would recommend:<br></div><div><br><a href="http://www.ncl.ucar.edu/Document/Functions/Built-in/regCoef_n.shtml" target="_blank">http://www.ncl.ucar.edu/Docume<wbr>nt/Functions/Built-in/regCoef_<wbr>n.shtml</a><br><br></div><div>This is the most recent version. As noted in the documentation:<br>Note: with NCL V6.2.1 or later, you can use <a href="http://www.ncl.ucar.edu/Document/Functions/Built-in/regCoef_n.shtml" target="_blank"><b>regCoef_n</b></a>
to avoid having to reorder the arrays first:

<pre>   rc   = <a href="http://www.ncl.ucar.edu/Document/Functions/Built-in/regCoef_n.shtml" target="_blank"><b>regCoef_n</b></a>(x, y, 0, 0)
</pre>===<br></div><div><br></div>****PLease See: Example 2***<br><br><pre>rc   = <b>regCoef_n</b>(time, ts, 0, 0) ; <b>rc(nlat,mlon)</b></pre>copy_VarCoords(ts(0,:,),rc)<br></div>printVarSummary(rc)<br><br>=====<br></div>Using the original regCoef rather than regCoef_n may require the arrays to be reordered.<br><br><a href="http://www.ncl.ucar.edu/Document/Functions/Built-in/regCoef-1.shtml" target="_blank">http://www.ncl.ucar.edu/Docume<wbr>nt/Functions/Built-in/regCoef-<wbr>1.shtml</a><br><br></div>****See: Examples 2 and 3***<br><br><pre>   rc   = <b>regCoef</b>(x, y(lat|:,lon|:,time|:) )    
</pre>If <i>y</i> has <a href="http://www.ncl.ucar.edu/Document/Language/cv.shtml" target="_blank">coordinate variables</a>
these may readily be assigned via NCL syntax: 
<pre>   rc!0   = &quot;lat&quot;    ; name dimensions
   rc!1   = &quot;lon&quot;
   rc&amp;lat = y&amp;lat    ; assign coordinate values to named dimensions
   rc&amp;lon = y&amp;lon
</pre><br><br></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="m_-7433046326469668859m_-7665898043697166395m_-9044587640441829136m_226346907866851350m_9116501929336920820m_747290511169588846m_-4619085922763679081m_-2949817932421431838m_-6920874904743519709h5">On Mon, Jan 2, 2017 at 3:01 AM, Kunal Bali <span dir="ltr">&lt;<a href="mailto:kunal.bali9@gmail.com" target="_blank">kunal.bali9@gmail.com</a>&gt;</span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="m_-7433046326469668859m_-7665898043697166395m_-9044587640441829136m_226346907866851350m_9116501929336920820m_747290511169588846m_-4619085922763679081m_-2949817932421431838m_-6920874904743519709h5"><div dir="ltr"><div><div><div><div>Dear NCL users,<br><br></div>I have the data with time steps &gt; 1000<br><br></div>I want to plot the spatial map of trend analysis of the given dataset. <br></div>So I tried the script given below for getting the desired plot but couldn&#39;t successed.<br><br></div><div>the given error is <br><b>fatal:regCoef: The rightmost dimension of x must be at least 2<br>fatal:[&quot;Execute.c&quot;:8567]:Execu<wbr>te: Error occurred at or near line 32 in file trend.ncl<br></b><br> <br></div><div>Could anyone please help me out<br></div><br><br>  <br>   tmp  = a-&gt;SWTNTCLR<br>   ts   = tmp(time|:,lat|:,lon|:)       <wbr>        ; reorder variable<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&amp;time                       ; days since 1850-01-01<br>   rc           = regCoef(time,ts)             <br>   <br>   rc@long_name = &quot;regression coefficient (trend)&quot;<br>   rc@units     = ts@units+&quot;/day&quot;    <br>;   copy_VarCoords(ts(:,:,0), rc)                ; copy lat,lon coords<br><br><br>;*****************************<wbr>*******************<br>; plotting parameters <br>;*****************************<wbr>*******************<br>   wks  = gsn_open_wks(&quot;ps&quot; ,&quot;regress&quot;) <br>   gsn_define_colormap(wks,&quot;ViBlG<wbr>rWhYeOrRe&quot;)    ; choose colormap<br>   <br>   res                       = True     <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            = &quot;RasterFill&quot;<br><br>;   res@cnLevelSelectionMode  = &quot;ManualLevels&quot;   ; set manual contour levels<br>;   res@cnMinLevelValF        =  -1.00           ; set min contour level<br>;   res@cnMaxLevelValF        =   1.00           ; set max contour level<br>   res@cnLevelSpacingF       =   0.10           ; 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_ce(wks,rc,<wbr>res)    <br>  end<br><br><br>  <br><div><div><div><div><br><br><br><br><br></div><div>Regards<span class="m_-7433046326469668859m_-7665898043697166395m_-9044587640441829136m_226346907866851350m_9116501929336920820m_747290511169588846m_-4619085922763679081m_-2949817932421431838m_-6920874904743519709m_-4635776282400146547HOEnZb"><font color="#888888"><br clear="all"></font></span></div><span class="m_-7433046326469668859m_-7665898043697166395m_-9044587640441829136m_226346907866851350m_9116501929336920820m_747290511169588846m_-4619085922763679081m_-2949817932421431838m_-6920874904743519709m_-4635776282400146547HOEnZb"><font color="#888888"><div><div><div><div class="m_-7433046326469668859m_-7665898043697166395m_-9044587640441829136m_226346907866851350m_9116501929336920820m_747290511169588846m_-4619085922763679081m_-2949817932421431838m_-6920874904743519709m_-4635776282400146547m_6420530442664993331gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>Kunal Bali<br></div><br><div><br></div><div><br></div><div><p style="margin:0px;border-collapse:collapse;font-family:tahoma,verdana;font-size:12px"><font color="#1F497D"><br></font></p></div></div></div></div></div></div>
</div></div></font></span></div></div></div></div>
<br></div></div>______________________________<wbr>_________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu" target="_blank">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/mailma<wbr>n/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>
</blockquote></div><br></div></div></div></div>
<br>______________________________<wbr>_________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu" target="_blank">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/mailma<wbr>n/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>
</div></div></blockquote></div><br></div></div></div>
<br>______________________________<wbr>_________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu" target="_blank">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/mailma<wbr>n/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>
</div></div></blockquote></div><br></div></div></div>
<br>______________________________<wbr>_________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu" target="_blank">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/mailma<wbr>n/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>
</div></div></blockquote></div><br></div></div></div>
<br>______________________________<wbr>_________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu" target="_blank">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/mailma<wbr>n/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>
</div></div></blockquote></div><br></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><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div><div><span><font color="#888888">Adam Phillips <br></font></span></div><span><font color="#888888">Associate Scientist,  </font></span><span><font color="#888888">Climate and Global Dynamics Laboratory, NCAR<br></font></span></div></div><div><span><font color="#888888"><a href="http://www.cgd.ucar.edu/staff/asphilli/" target="_blank">www.cgd.ucar.edu/staff/asphilli/</a>   </font></span><span><font color="#888888">303-497-1726 </font></span></div><span><font color="#888888"></font></span><div><div><span><font color="#888888"><br></font></span><div><span><font color="#888888"><a href="http://www.cgd.ucar.edu/staff/asphilli" target="_blank"></a></font></span></div></div></div></div></div></div></div></div></div></div></div>
</div>