<div dir="ltr">Hi Priyanka,<div>There might be other methods, but the one that I have used in the past to regress ENSO out is:</div><div>1) Use wgt_areaave (and weight data by cosine of the latitude to take into account differing sizes of grid boxes) to form the nino3.4 index. This is more precise that averaging over the latitude/longitude dimensions. (Results in a 1-dimensional array) </div><div>2) Normalize the nino3.4 index by using dim_standardize. (Result in a 1-dimensional array) </div><div>3) Regress your SST array against the normalized nino3.4 index. (Results is a 2-dimensional lat x lon array.)</div><div>4) Run a do loop over every timestep, multiplying the value of 2) times the spatial pattern of 3). (Results in a 3-dimensional array time x lat x lon.)</div><div>5) Subtract 4) from your original SST array to get the residual. (Results in a 3-dimensional array time x lat x lon.)</div><div><br></div><div>Here's a snippet of my code that has done this:</div><div><div>(The following is unchecked, make sure you understand what the code does before using it.)</div><div>; The sst array is dimensioned time x lat x lon</div><div> </div><div>pi=4.*atan(1.0)</div><div>rad=(pi/180.)</div><div>coswgt=cos(rad*sst&lat)</div><div>coswgt!0 = "lat"</div><div>coswgt&lat= sst&lat </div><div>llats = -5.</div><div>llatn = 5.</div><div>llonw = 190.</div><div>llone = 240.</div><div>nino34 = wgt_areaave(sst(:,{llats:llatn},{llonw:llone}),coswgt({llats:llatn}),1.0,0) ; step 1<br></div></div><div>nino34 = dim_standardize_Wrap(nino34,0) ; step 2<br></div><div><br></div><div><div>enso_sst = sst(0,:,:)</div><div>enso_sst = (/ regCoef_n(nino34,sst,0,0) /) ; step 3</div></div><div><br></div><div>fin_enso = sst</div><div>fin_enso = fin_enso@_FillValue</div><div>do gg = 0,dimsizes(sst&time)-1</div><div> fin_enso(gg,:,:) = (/ enso_sst*nino34(gg) /) ; step 4</div><div>end do</div><div><br></div><div><div>sst_noenso = sst ; calculate residual...</div><div>sst_noenso = (/ sst - fin_enso /) ; step 5</div></div><div><br></div><div>Hopefully that points you in the right direction. If you have any further questions please include the ncl-talk email list in any replies.</div><div>Adam</div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Sep 9, 2017 at 1:06 AM, Priyanka Silva <span dir="ltr"><<a href="mailto:priyankakeraminiya6@gmail.com" target="_blank">priyankakeraminiya6@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><span style="font-size:12.8px">Dear all,</span><br></div><div><span style="font-size:12.8px">I want to remove ENSO index from all SST data and use the residual SST to plot correlation between residual SST and area averaged (15S- 08N, 95E-130E) rainfall index.</span></div><div><span style="font-size:12.8px">My residual SST has only time dimension so I cannot plot the correlation map.I tried to find the residual SST as follows. Is there any other method or how can I plot the correlation map. </span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">Thank you for your help.</span><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">Priyanka.</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px"><br></span></div><div><br></div><div><br></div><div>begin</div><div>;*****************************<wbr>******************************<wbr>********************</div><div> ;Seasonal mean precipitation averaged over the domain</div><div>;*****************************<wbr>******************************<wbr>******************</div><div>f = "<a href="http://mon.precip.nc" target="_blank">mon.precip.nc</a>"</div><div>fin = addfile(f, "r")</div><div>time = fin->time</div><div>ymd = cd_calendar(time,2)</div><div>iTim = ind (<a href="http://ymd.ge.19790101.and.ymd.lt">ymd.ge.19790101.and.ymd.lt</a>.<wbr>20130101)</div><div>preci = fin->precip(iTim,{8:-15},{95:<wbr>130})</div><div>;printVarSummary(precip)</div><div>pano = rmMonAnnCycTLL(preci)</div><div>;*****************************<wbr>******************************<wbr>********</div><div> ;area averaged rainfall index</div><div>;*****************************<wbr>******************************<wbr>*********</div><div>index =dim_avg_Wrap (dim_avg_Wrap (pano(time|:,lat|:,lon|:)))</div><div>;printVarSummary(index)</div><div>xNew = dim_standardize(index, 1)</div><div>xNew!0="time"</div><div>xNew&time = index&time</div><div>printVarSummary(xNew)</div><div>;-----------------------------<wbr>------------------------------<wbr>-------------</div><div>f1 = "HadISST_ssta.nc"<br></div><div>fin1 = addfile(f1, "r")</div><div>time2 = fin1->time</div><div>ymd2 = cd_calendar(time2,2)</div><div>iTim2 = ind (<a href="http://ymd2.ge.19790101.and.ymd2.lt">ymd2.ge.19790101.and.ymd2.lt</a>.<wbr>20130101)</div><div>sst = fin1->ssta(iTim2,:,:)</div><div><br></div><div>;*****************************<wbr>******************************<wbr>********</div><div> ;ENSO index</div><div>;*****************************<wbr>******************************<wbr>*******</div><div>NINO = fin1->ssta(iTim2,{-5:5},{-120:<wbr>-170})</div><div>Nino_index = dim_avg_Wrap (dim_avg_Wrap(NINO(time|:,<wbr>latitude|:,longitude|:)))</div><div>;printVarSummary(Nino_index)</div><div><br></div><div>;---------------Remove ENSO index from SST;--------------------------<wbr>-</div><div>SST = dim_avg_Wrap (dim_avg_Wrap(sst(time|:,<wbr>latitude|:,longitude|:)))</div><div>Residula_SST = SST - Nino_index</div><div>Residula_SST!0 = "time"</div><div>printVarSummary(Residula_SST)</div><div>end</div><div><br></div></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>