<div dir="ltr"><div><div><div>Hi Adam,<br></div>Thanks for your reply. I appreciate your explanation about unit. <br> Reference: <a href="http://www.ncl.ucar.edu/Document/Functions/Built-in/eofunc.shtml">http://www.ncl.ucar.edu/Document/Functions/Built-in/eofunc.shtml</a><br></div>From example 7, what I understood is to retain same unit as data, EOF has to be denormalised. It means EOF has unit.<br></div><div>Is that right?<br></div><div>I have been trying to do EOF analysis for obervation temperature data. <br><br></div><div>evecv_ts = eofunc_ts_Wrap (o,evecv,False)<br></div><div>EOF time series result ranges from <br> min=-1693.35 max=1080.62<br></div><div>I would like to normalise these values to retain same unit as data. Since the input data contains stations and corresponding time, there is no latitude values to unweight and normalise as it is in the EOF sample program. I did understood to use dim_standardise function to normalise, but the unit is not retained as same as input data. What is the best way to normalise and retain same unit as input data? <br> I don't want to use regression at this point, because I am only looking into EOF time series. <br><br></div><div>Thank you<br><br></div><div><b>Example 7</b>
<p>
Area-weight the data prior to calculation. Let p be four-dimensional with
dimensions lat, lon, and time. The array lat contains the latitudes.
</p><pre>; calculate the weights using the square root of the cosine of the latitude and
; also convert degrees to radians
wgt = <a href="http://www.ncl.ucar.edu/Document/Functions/Built-in/sqrt.shtml"><strong>sqrt</strong></a>(<a href="http://www.ncl.ucar.edu/Document/Functions/Built-in/cos.shtml"><strong>cos</strong></a>(lat*0.01745329))
; <a href="http://www.ncl.ucar.edu/Document/Language/reorder.shtml">reorder</a> data so time is fastest varying
pt = p(lat|:,lon|:,time|:) ; (lat,lon,time)
ptw = pt ; create an array with metadata
; weight each point prior to calculation.
; <a href="http://www.ncl.ucar.edu/Document/Functions/Built-in/conform.shtml"><strong>conform</strong></a> is used to make wgt the same size as pt
ptw = pt*<a href="http://www.ncl.ucar.edu/Document/Functions/Built-in/conform.shtml"><strong>conform</strong></a>(pt, wgt, 0)
evec= <strong>eofunc</strong>(ptw,neval,80.)
; denormalize the EOFs
; print the % variance explained
do ne=0,neval-1
evec(ne,:,:) = evec(ne,:,:)*sqrt( evec@eval(ne) ) ; units same as <em>data</em>
<a href="http://www.ncl.ucar.edu/Document/Functions/Built-in/print.shtml"><strong>print</strong></a>("% var="+ evec@pcvar(ne) )
end do
</pre>
                                        
                                        </div><div><br></div>
<div><div><div><div><br></div></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, May 25, 2016 at 4:36 PM, Adam Phillips <span dir="ltr"><<a href="mailto:asphilli@ucar.edu" target="_blank">asphilli@ucar.edu</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">Hello,<div>I am not sure what you mean by your question. The values coming out of eofunc are unitless, while the values coming out of eofunc_ts are the original units. A common approach to get the original units on a pattern is to normalize the PC, and regress the original data onto the normalized PC. The resulting regression plot will be in the original units per standard deviation change in the PC.</div><div><br></div><div>Hope that makes sense. If not, please respond to the ncl-talk email list only and not to me personally.</div><div>Adam</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">On Wed, May 25, 2016 at 9:23 AM, Adv <span dir="ltr"><<a href="mailto:advita6@gmail.com" target="_blank">advita6@gmail.com</a>></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="h5"><div dir="ltr"><br><div class="gmail_quote"><div dir="ltr"><div><div>Hi ,<br></div>Could someone suggest me a way to normalise the PC values and retain the same unit?<br></div><div><br><br></div><div>Thanks <br><br><br></div>;time=41,sta=392<br><div>xx1 = dats(time | :,sta|:) ; reorder ... eofunc want 'time' as rightmost dimension<br>printVarSummary(xx1)<br>printMinMax(xx1,0)<br>o=dats(sta|:,time|:)<br>printVarSummary(o)<br>evecv = eofunc_Wrap (o,neval,False)<br>evecv_ts = eofunc_ts_Wrap (o,evecv,False)<br>print(evecv_ts(0,:))<br>printVarSummary(evecv)<br>printMinMax(evecv(0,:),0);Normalised<br>; ================================> ; SUM OF THE SQUARES<br> ; IF NORMALIZED, THEY SHOULD BE 1<br>; sumsqr = dim_sum(evecv^2)<br>; print("sum of squares: " + sumsqr)<br><br>;To retain same unit;Denormalise<br> do ne=0,neval-1<br> evecv(ne,:) = evecv(ne,:)*sqrt( evecv@eval(ne) )<br> end do<br>printMinMax(evecv(0,:),0);Normalised<br>evecv_ts = eofunc_ts_Wrap (o,evecv,False)<br><br>Output of min/max<br> min=-1693.35 max=1080.62<br></div><div><br></div></div>
</div><br></div>
<br></div></div>_______________________________________________<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/mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><span class="HOEnZb"><font color="#888888"><br><br clear="all"><div><br></div>-- <br><div><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>
</font></span></div>
</blockquote></div><br></div>