<div dir="ltr">Hi Kunal,<div>Your use of esccr is correct as far as I can tell. It matches up with example #2 on the esccr documentation site:</div><div><a href="http://www.ncl.ucar.edu/Document/Functions/Built-in/esccr.shtml">http://www.ncl.ucar.edu/Document/Functions/Built-in/esccr.shtml</a><br></div><div>Adam</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Sep 9, 2016 at 1:28 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><br>I have the data over the central arabian sea with the time steps = 31.<br><br></div>With the given script, could you please let me know am I doing the corss-correlation in a wright way <br><br>;*****************************<wbr>********************<br>; corel_3.ncl<br>;<br>; Concepts illustrated:<br>;   - Calculating a two-dimensional correlation in time<br>;   - Reordering an array<br>;   - Copying attributes from one variable to another<br>;   - Copying coordinate arrays from one variable to another<br>;<br>;*****************************<wbr>*******************<br>;<br>; These files are loaded by default in NCL V6.2.0 and newer<br>load &quot;$NCARG_ROOT/lib/ncarg/<wbr>nclscripts/csm/gsn_code.ncl&quot;
<br>load &quot;$NCARG_ROOT/lib/ncarg/<wbr>nclscripts/csm/gsn_csm.ncl&quot;
<br>load &quot;$NCARG_ROOT/lib/ncarg/<wbr>nclscripts/csm/contributed.<wbr>ncl&quot;<br>begin<br>;*****************************<wbr>*******************<br>; open file and read in variable<br>;*****************************<wbr>******************<br>  in1  = addfile(&quot;/media/Local Disk/NPL2/cross_corr_spatial/<a href="http://var1.nc" target="_blank">v<wbr>ar1.nc</a>&quot;,&quot;r&quot;)<br>  in2  = addfile(&quot;/media/Local Disk/NPL2/cross_corr_spatial/<a href="http://var2.nc" target="_blank">v<wbr>ar2.nc</a>&quot;,&quot;r&quot;)<br>  <br><br>  tmp1 = in1-&gt;DUD<br>  tmp2 = in2-&gt;SRT<br>;*****************************<wbr>*******************<br>; reorder to get time as right most dimension<br>;*****************************<wbr>******************<br>  ts1 = tmp1(latitude|:,longitude|:,<wbr>time|:)<br>  ts2 = tmp2(latitude|:,longitude|:,<wbr>time|:)<br>;*****************************<wbr>*******************<br>; calculate cross correlations<br>;*****************************<wbr>*******************<br>  maxlag = 3                             <wbr>    ; set lag<br>; note, the max lag should not be more than N/4<br>  <br>  ccr = esccr(ts1,ts2,maxlag)         <wbr>          ; calc cross correlations<br><br>; copy meta data and coordinate variables using contributed functions<br>  copy_VarAtts(ts1, ccr)                    <br>  copy_VarCoords_1(ts2,ccr)<br>;*****************************<wbr>*******************<br>; plot the correlations<br>;*****************************<wbr>*******************<br>;*****************************<wbr>*******************<br> ;---Open workstation and change color map
<br>  wks_type = &quot;png&quot;                       
<br>  wks        = gsn_open_wks(wks_type, &quot;CCR_2_lag3&quot;)<br>;*****************************<wbr>*******************
<br><br> <br>  res                      = True                ; make plot mods<br>  res@gsnLeftString     = &quot;&quot;
<br>  res@gsnRightString    = &quot;&quot;<br>  res@gsnAddCyclic       = False<br>  res@cnFillOn             = True                ; turn on color<br>  res@cnFillPalette        = &quot;BlWhRe&quot;            ; set color map<br><br>  res@cnLinesOn            = False               ; turn off contour lines<br>  res@cnLevelSelectionMode = &quot;ManualLevels&quot;      ; manually set cn levels<br>  res@cnMinLevelValF       = -1.                 ; min level<br>  res@cnMaxLevelValF       =  1.                 ; max level<br>  res@cnLevelSpacingF      = .1                  ; contour level spacing<br><br>  lag                      = 3<br>  res@tiMainString         = &quot;Correlations at lag &quot;+lag<br><br>  res@mpMinLonF = 59.8
<br>  res@mpMaxLonF = 69.8
<br>  res@mpMinLatF = 16.5
<br>  res@mpMaxLatF = 25.0<br>  <br>  plot = gsn_csm_contour_map(wks,ccr(:,<wbr>:,lag),res) <br>;*****************************<wbr>*******************<br>end<br>  <br><div><div> <br></div></div></div><div class="gmail_extra"><br clear="all"><div><div 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 Fri, Sep 9, 2016 at 12:28 PM, Will Hobbs <span dir="ltr">&lt;<a href="mailto:will.hobbs@utas.edu.au" target="_blank">will.hobbs@utas.edu.au</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">







<div bgcolor="white" link="#0563C1" vlink="#954F72" lang="EN-US">
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:Calibri">Kunal<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:Calibri"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:Calibri">At least one of the data points in the arrays that you are correlating has every single value as ‘missing’ or the same value throughout. This usually occurs if your data includes some masked
 regions, e.g. ocean data with a spatial domain that includes land.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:Calibri"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:Calibri">Another possible valid condition would be precipitation data where one or more data points has been in drought for the entire time period, i.e. P = 0 throughout<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:Calibri"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:Calibri">If you’re expecting you input data to include masked areas or similar physical conditions then it’s probably nothing to worry about (although that doesn’t mean you shouldn’t check). If
 you’re not expecting any missing values in your data then you may have a problem with your input arrays – but that’s not really an NCL problem.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:Calibri"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:Calibri">Will<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:Calibri"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:Calibri"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:Calibri"><u></u> <u></u></span></p>
<div style="border:none;border-top:solid #b5c4df 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span style="font-family:Calibri;color:black">From: </span>
</b><span style="font-family:Calibri;color:black">&lt;<a href="mailto:ncl-talk-bounces@ucar.edu" target="_blank">ncl-talk-bounces@ucar.edu</a>&gt; on behalf of Kunal Bali &lt;<a href="mailto:kunal.bali9@gmail.com" target="_blank">kunal.bali9@gmail.com</a>&gt;<br>
<b>Date: </b>Friday, 9 September 2016 at 4:46 PM<br>
<b>To: </b>&quot;<a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a>&quot; &lt;<a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a>&gt;<br>
<b>Subject: </b>[ncl-talk] cross_corr_query<u></u><u></u></span></p>
</div><div><div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<div>
<div>
<div>
<div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt">Dear NCL users,<u></u><u></u></p>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt">I am trying to plot the cross-correlation map. While doing this, I have baeen facing one error
<br>
<br>
warning:esccr: Non-fatal conditions encountered: all missing or constant values<u></u><u></u></p>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt">Could anyone please let me know, how to fix it.
<br>
<br>
<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">Regards<u></u><u></u></p>
</div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<p class="MsoNormal">Kunal Bali<u></u><u></u></p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div></div></div>
<p style="font-size:10pt;line-height:10pt;font-family:Calibri,sans-serif"><br>
<br>
University of Tasmania Electronic Communications Policy (December, 2014). <br>
This email is confidential, and is for the intended recipient only. Access, disclosure, copying, distribution, or reliance on any of it by anyone outside the intended recipient organisation is prohibited and may be a criminal offence. Please delete if obtained
 in error and email confirmation to the sender. The views expressed in this email are not necessarily the views of the University of Tasmania, unless clearly intended otherwise.
</p>
</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>