Re: svdcov_sv

From: Ahmad Farsyud <a.farsyud_at_nyahnyahspammersnyahnyah>
Date: Wed Jul 24 2013 - 14:53:38 MDT

Thank you expert, for your kind hints. this function consumed so much time
to work in ncl, though!! One last question how could i calculate a squared
covariance (sc) for each svd analysis in each mode? and also how could i
get the values in anomalies from each mode, in eof is really clear how to
do that.

thank you so much,

AF

On Thursday, July 18, 2013, Dennis Shea wrote:

> ??? 2d fields [timexlatxlon] <=== this is 3d
>
>
> [1]
> Let x(time,lat,lon) ; sizes ==> (ntim,nlat,mlon)
> y(time,lat,lon)
>
> nxy = nlat*mlon
> ; reorder so time varying fastest
> X = x(lat|:,lon|:,time|:) ; sizes ===>(nlat,mlon,ntim)
> X2 = onedtond( ndtooned(X), (/ nxy, ntim /) ) ; (:,:)
>
> Y = ...
> Y2 = ...
> delete( [/x,y,X,Y/])
>
> nsvd = ...
>
> svLeft = new((/nsvd,nxy/),typeof(x)) ; pre-allocate space
> svRight = new((/nsvd,nxy/),typeof(x))
>
> pc = svdcov_sv(X2,Y2,nsvd,svLeft,**svRight)
>
> printVarSummary(pc)
>
>
> [2]
> No. You can write your own plot code.
>
> do ns=0,nsvd-1
> left = onedtond(svLeft(ns,:) , (/nlat,mlon/) ) ; reshape
> rght = onedtond(svRight(ns,:), (/nlat,mlon/) )
>
> left!0 = "lat"
> left!1 = "lon"
> left&lon = x&lon
> left&lat = x&lat
>
> rght!0 = "lat"
> rght!1 = "lon"
> rght&lon = x&lon
> rght&lat = x&lat
>
> ; plot code here
>
>
> end do
>
> [3] lags .. the following is untested
>
> ntim = dimsizes(x&time)
>
> nlag = 3
>
> nxStrt = 0
> nxLast = ntim-1-nlag
> nxTime = nxLast-nxStrt+1
> X = x(lat|:,lon|:,time|nxStrt:**nxLast) ; sizes ===>(nlat,mlon,ntim)
> X2 = onedtond( ndtooned(X), (/ nxy, nxTime /) ) ; (:,:)
>
> nyStrt = nlag
> nyLast = ntim-1
> nyTime = nyLast-nyStrt+1
> Y = y(lat|:,lon|:,time|nyStrt:**nyLast) ; sizes ===>(nlat,mlon,ntim)
> Y2 = onedtond( ndtooned(X), (/ nxy, nyTime /) ) ; (:,:)
>
> X2 leads Y2 by 'nlag' time steps
>
> ++++++++++++++++++++++++++++++**+++++++++++++
> ++++++++++++++++++++++++++++++**+++++++++++++
> NOTE: I do not have the time for multiple emails.
> You will have to figure the rest out yourself.
> ++++++++++++++++++++++++++++++**+++++++++++++
> ++++++++++++++++++++++++++++++**+++++++++++++
>
> On 07/11/2013 12:31 AM, Ahmad Farsyud wrote:
>
>> Hi NCL,
>>
>> I have several question regarding this function "svdcov_sv":
>> http://www.ncl.ucar.edu/**Document/Functions/Built-in/**svdcov_sv.shtml<http://www.ncl.ucar.edu/Document/Functions/Built-in/svdcov_sv.shtml>
>> 1. How could I apply this function for 2d fields [timexlatxlon]
>> 2. Is there any example of the display output using this function in NCL?
>> 3. One can give me suggestion , what should I do if I want to use svd
>> for time-lagged analysis?
>>
>> Thank you,
>> - AF
>>
>>
>> ______________________________**_________________
>> ncl-talk mailing list
>> List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/**mailman/listinfo/ncl-talk<http://mailman.ucar.edu/mailman/listinfo/ncl-talk>
>>
>>
>

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Wed Jul 24 14:53:53 2013

This archive was generated by hypermail 2.1.8 : Thu Jul 25 2013 - 21:02:42 MDT