[Thread Prev][Thread Next][Index]

Re: [ferret_users] EOf of 3d data

The computation itself has to load the whole 3D domain, XYT. The function works by inverting a matrix and so even if you ask to write one timestep at a time, the computation needs to be able to load the whole grid.

You could regrid to a coarser grid in any or all of the dimensions. Think what resolution is important for the spatial and temporal patterns you are trying to study by decomposing the data using the EOF. Also, do you need to get the result over the entire grid? Could you restrict the XY region to some subregion?

For these functions, restrict the grid within the function call:

EOF_STAT(var[x=140:230,y=10:50,t=1-jan-2000:1-jan-2001], 0.8)



On 7/4/2014 12:24 AM, Shreya Dhame wrote:

Thank you for the reply. I got this error message while saving my output:
**ERROR: request exceeds memory setting: A negative number of words were requested.
  *** NOTE: The current grid is most likely too large
I tried breaking up the output and saving it in groups of timesteps but still got the same error. Is there any other way out of this problem?

----- Original Message -----
From: "Ansley Manke" <ansley.b.manke@xxxxxxxx>
To: "ferret users" <ferret_users@xxxxxxxx>
Sent: Thursday, July 3, 2014 10:59:34 PM
Subject: Re: [ferret_users] EOf of 3d data

Yes, those functions expect the spatial variation to be in XY.   You
could do the calculation by defining a fake XY grid and using RESHAPE to
put your variable onto that grid.  Because Ferret grids are stored with
the data varying fastest in the X and then Y direction this will keep
the data order intact.

so, the new grid has an x axis the length of your grid's y axis, a y
axis the length of your z axis:

yes? def axis/x=1:`ny`:1 xfake
yes? def axis/y=1:`nz`:1 yfake

yes? let var_with_grid =  x[gx=xfake] + y[gy=yfake] +t[gt=T_20FLNNEW]
yes? let var_xyt = RESHAPE (T_20FLNNEW, var_with_grid)

Then call the EOF functions using var_xyt, and finally put the results
back on the original yz grid with another RESHAPE function.

Please have a look at the EOFSVD functions. They are faster than the EOF
family of functions.  As long as your data does not have gaps they are
the better choice.


On 7/2/2014 10:14 PM, Shreya Dhame wrote:

I want to use the method of Empirical Orthogonal Function (EOF) analysis to decompose the spatiotemporal data in orthogonal modes. My data is in 3d matrix in the form (time(t), lat(y), depth(z)). I tried the eof_space,eof_stat and eof_tfunc given in ef_eof_demo.jnl but did not get valid results.Are these functions only for x.y.t data?

USE merge7y.cdf

LET eofspace = eof_space(T_20FLNNEW, 0.5)
SAVE/CLOBBER/FILE=merge7y_eof_space.cdf eofspace

can variable/all

use merge7y_eof_space.cdf
set view ul; fill/l=1/title="eof 1" eofspace
set view ur; fill/l=2/title="eof 2" eofspace

USE merge7y.cdf

LET eofstat = eof_stat(T_20NEW, 0.5)
let nout =  eofstat[i=1,j=1]

SAVE/CLOBBER/FILE=merge7y_eof_stat.cdf eofstat[i=1:`nout`]

can var/all

use merge7y_eof_stat.cdf

let nout = eofstat[i=1,j=1,d=merge7y_eof_stat]
let pcts = eofstat[i=1:`nout`,j=2,d=merge7y_eof_stat]
let eigenv = eofstat[i=1:`nout`,j=3,d=merge7y_eof_stat]

list nout
list pcts
list eigenv

USE merge7y.cdf
LET eoftime = eof_tfunc(T_20NEW, 0.5)

SAVE/CLOBBER/FILE=M1215_eof_tfunc.cdf eoftime[i=1:`nout`]

can var/all
use merge7y_eof_tfunc.cdf
can view

set view ul; plot/k=1/title="time function 1" eoftime
set view ur; plot/k=2/title="time function 2" eoftime

set mode/last verify

--Thank you

[Thread Prev][Thread Next][Index]
Contact Us
Dept of Commerce / NOAA / OAR / PMEL / Ferret

Privacy Policy | Disclaimer | Accessibility Statement