
Empirical orthogonal functions
function eofcor(
data[*][*] : float,
neval[1] : integer
)
function eofcov(
data[*][*] : float,
neval[1] : integer
)
function eofcor_ts(
data[*][*] : float,
evec[*][*] : float
)
function eofcov_ts(
data[*][*] : float,
evec[*][*] : float
)
Both of these functions return the following attributes:
Both eofcov and eofcor will ignore missing values if data@_FillValue is set. It is assumed that all stations (grid points) have at least some data present. This is the user's responsibility. if data@_FillValue is set, then the return array will have the same attribute set to this value.
- trace (scalar, float)
- trace of the variance-covariance matrix
- eval (1D float array of length neval)
- eigenvalues in descending order
- pcvar (1D float array of length neval)
- percent variance associated with each eigenvalue
eofcor_ts computes the time series of eof amplitudes for each eigenvalue returned by eofcor and returns a 2D float array dimensioned neval x time. eofcov_ts computes the time series of eof amplitudes for each eigenvalue returned by eofcov and returns a 2D float array dimensioned neval x time.
begin
;
; Parameters
;
ncol = 7 ; # columns (stations or grid points)
ntime = 25 ; # time steps
;
; Read the ASCII file.
; ; open "data " as 2-dim array
data = asciiread ("data",(/ntime,ncol/), "float")
;
; Eof routines want "time" to be fastest varying dimension.
;
data!0 = "time"
data!1 = "ncol"
neval = 3
evecv = eofcov (data(ncol | :,time | :),neval)
evecv_ts = eofcov_ts (data(ncol | :,time | :),evecv)
print ("evecv@trace= " + evecv@trace)
print ("evecv@pcvar= " + evecv@pcvar)
;
; here is another way to do the calls
;
data2 = data(ncol | :,time | :)
evecr = eofcor (data2,neval)
evecr_ts = eofcor_ts (data2,evecr)
print ("evecr@trace= " + evecr@trace)
print ("evecr@pcvar= " + evecr@pcvar)
end
NG4.1 Home, Index, Examples, Glossary, Feedback, Ref Contents, Ref WhereAmI?