[Thread Prev][Thread Next][Index]

Re: [ferret_users] Problems with eof_space first mode



Hi Aideen,

I can't see anything wrong with your script. Perhaps it is just the way you are visualizing or interpreting the results. I would remove the "/levels=" from the shade command for the ire_uk case to let the field choose the contour range. Even if the space_eof has all negative (or all positive) values it is not necessarily wrong.

Attached is a demo that I think illustrates the point. Suppose there is a large spatial scale behavior that covers Europe and a finer-scale variability (with a scale closer to that of Ire-UK). Then it is quite possible if the amplitude of the large scale signal exceeds that of the fine, that the Ire-UK region be all the same sign in each snapshot. This would carry over into the first mode eof of the subregion. The eof_tfunc allows the pattern in the subregion to swing from the (all) positive to the (all) negative phase. A higher mode that represents the finer scale variability will probably have an eof_space distribution that spans zero.

On the other hand, if the amplitude of the fine space scale structure is great enough to result a sign change in any snapshot of the subregion, then this behavior will likely appear in the first mode, and perhaps the second mode will have the single signed property.

In the demo script that is attached the signal is made up of three parts: vxy0 - large scale, vxy1-finer scale, and a normal random noise component. The composite signal modulates the first two components with an annual signal and has amplitude factors "ampf" and "ampn" to modify the size of the fine scale and normal components relative to the large scale.

With ampf=0.1 (and ampn=0.01) the large scale signal dominates and both individual January snapshots and the first mode eof are single-signed over Ire-UK. Mode-2 is what captures the fine scale signal and spans zero.

If you crank up to ampf=10, the fine scale signal becomes the dominant one an the situation is reversed: Mode one spans zero while mode-2 (now representing the large spatial scale signal) is essentially single-signed.

Hope this is some help; other EOF-an(atics) in the user-group may spot something or amplify/correct my interpretation.
Good luck,
   Mick
----------
Aideen Foley wrote:
Hi Mick,
It's a small world, isn't it? Nice to meet you!
Ok, here are details of what I've tried... !!!!! start of script !!!!! cancel data/all use mask_data.nc <http://mask_data.nc>
let mask = if fr_land[d=1] lt 0.5 then fr_land[d=1]/0 else 1
use test_file.nc <http://test_file.nc> ! gridded temperature data for Europe
let masked_temp = t2m*mask[l=1]
let eof_europe_jan = eof_space(masked_temp[t=1:240:12, i=10:90:2, j=10:80:2], 1) set view ul; shade/palette=mine/levels=(-4,4,0.5) eof_europe_jan[l=1]; go land ! produces a plot based on 20 Januaries for Europe
! (domain and resolution somewhat constrained to overcome memory issues
! positive and negative eigenfunctions, as expected

let eof_gb_and_ire_jan = eof_space(masked_temp[t=1:240:12, i=10:35:1, j=30:50:1], 1) set view ur; shade/palette=mine/levels=(-4,4,0.5) eof_gb_and_ire_jan[l=1]; go land

! plot based on UK and Ireland
! all negative eigenfunctions
let eof_ire_jan = eof_space(masked_temp[t=1:240:12, i=11:19:1, j=33:42:1], 1) set view ll; shade/palette=mine/levels=(-4,4,0.5) eof_ire_jan[l=1]; go land

! plot based on Ireland
! all negative eigenfunctions

!!!!! end of script !!!!!
I tried saving the subregion as a seperate file also.... !!!!! start of script !!!!!

use test_file_ire ! masked_temp[t=1:240:12, i=11:19:1, j=33:42:1] saved as seperate file let eof_ire_jan = eof_space(temp_ire, 1) set view lr; shade/palette=mine/levels=(-4,4,0.5) eof_ire_jan[l=1]; go land

! same result as previous (all negative eigenfunctions)
!!!!! end of script !!!!!
If anyone can tell me what's going on here I'd appreciate it.
Thanks,
Aideen
On Fri, Feb 27, 2009 at 7:11 PM, mick spillane <Mick.Spillane@xxxxxxxx <mailto:Mick.Spillane@xxxxxxxx>> wrote:

    Hi Aideen,
      It would help if you cut and paste the commands that work (whole
    dataset) and those that give suspect results (the subregion).  If
    memory serves, you need to explicitly state the subregion and, if
    you provide the details of what you tried, someone will spot the
    problem. Another avenue to follow might be to write a netCDF file
    of your subregion and try the "whole dataset" commands on that
    reduced file.
      I've been a ferreter for many years and was intrigued at the
    "nuim.ie <http://nuim.ie/>" as well as your name. As a fellow
    NUIer (UCC 1974) it was great to see Ferret in use in the
    Geography Dept at Maynooth (if I got the Dept right).  I work in
    Tsunami research in Seattle but a good friend (similarly aged)
    from my home town, Fermoy Co.Cork, is a Maynooth grad.
      Good luck in your research - I'm sure an answer to your problem
    will be forthcoming as the ferret eof tools are tried and true.
      Regards,
         Mick Spillane
    ----------------------

    Aideen Foley wrote:

        I have a strange problem with the eof functions (in v5.51) and
        I wonder can anyone help me?
        When I plot the first spatial mode for my data, it just
        doesn't make sense. I get an entirely negative plot, no
        gradients, yet this explains over 90% of the variance in the
        data. The second is more so what I would have expected the
        first mode to be.
        I have tried this on numerous datasets and different
        variables. My data is for all of Europe, and when I run
        eof_space on the larger domain, I get good results, but when I
        try to extract the smaller domain I am interested in, I run
        into all this trouble.
        Has anyone encountered anything like this before? If anyone
        can describe to me exactly how ferret processes data for the
        eof functions, that might help.
        Thanks so much.




! test of eof routines

set mem/size=500
let twopi=8*atan(1.)

use etopo60                       ! I'm using this to define a land mask
let mask=if(rose[d=1] gt 0)then 1

! a 20-year monthly time axis ...
def axis/t=15-jan-1981:15-dec-2000/npoints=240/units=days/t0=15-jan-1981 tax

! ... together with the 1 degree lat-lon of etopo define my demo grid
def grid/x=ETOPO60X/y=ETOPO60Y/t=tax grd

! define large-scale and finer-scale fields over land
let xx=x[g=grd] ; let yy=y[g=grd] ; let tt=t[g=grd]
let vxy0=mask*cos(twopi*(xx-15)/120)*sin(twopi*(yy-45)/60)
let vxy1=mask*sin(twopi*(xx-20)/30)*cos(twopi*(yy-45)/15)

! look at the functions over european area
region/x=-15:45/y=30:60

! ... and define suitable upper & lower viewports
ppl size 8 10.5 ; ppl axlen 6 4.25 ; ppl origin 0.75 0.75
def view/size=1/orig=0.03125,0.452381/clip=0.96875,1 vhi
def view/size=1/orig=0.03125,0/clip=0.96875,0.547619 vlo

set view vhi ; shade/nolab vxy0 ; label/nouser 5.8 0.2 1 0 0.25 Large-scale Signal
set view vlo ; shade/nolab vxy1 ; label/nouser 5.8 0.2 1 0 0.25 Fine-scale Signal
message ; ppl shaset reset

! combine the fields with an annual cycle and some noise (the large-scale signal
! has unit amplitude, the fine-scale amp is "ampf" and the noise amp "ampn" 

let europe=vxy0*cos(twopi*tt/365)+ampf*vxy1*sin(twopi*(tt-25)/365)+ampn*randn(vxy1*tt)

! define the nw subregion as ireuk
let ireuk=if(xx lt 2 and yy gt 48)then europe

! CASE A - the large-scale signal dominates
let ampf=0.1 ; let ampn=0.01

! look at the first snapshot
set view vhi ; shade/nolab/l=1 europe ; label/nouser 5.8 0.2 1 0 0.25 Full region
label/nouser 3 4.4 0 0 0.25 January 1981 for case AMPF=0.1
set view vlo ; shade/nolab/l=1 ireuk  ; label/nouser 5.8 0.2 1 0 0.25 Sub-region
message ; ppl shaset reset

let europe_space=eof_space(europe[t=1:240:12],1)
let ireuk_space=eof_space(ireuk[t=1:240:12],1)

! look at the first mode of each
set view vhi ; shade/nolab/l=1 europe_space ; label/nouser 5.8 0.2 1 0 0.25 Mode 1 full region
label/nouser 3 4.4 0 0 0.25 Large Spatial Scale Signal Dominant 
set view vlo ; shade/nolab/l=1 ireuk_space  ; label/nouser 5.8 0.2 1 0 0.25 Mode 1 subregion
message ; ppl shaset reset

! ... and the 2nd mode of each
set view vhi ; shade/nolab/l=2 europe_space ; label/nouser 5.8 0.2 1 0 0.25 Mode 2 full region
label/nouser 3 4.4 0 0 0.25 Large Spatial Scale Signal Dominant
set view vlo ; shade/nolab/l=2 ireuk_space  ; label/nouser 5.8 0.2 1 0 0.25 Mode 2 subregion
message ; ppl shaset reset

! CASE B - the fine-scale signal dominates
let ampf=10.0 ; let ampn=0.01

! look at the first snapshot
set view vhi ; shade/nolab/l=1 europe ; label/nouser 5.8 0.2 1 0 0.25 Full region
label/nouser 3 4.4 0 0 0.25 January 1981 for case AMPF=10.0
set view vlo ; shade/nolab/l=1 ireuk  ; label/nouser 5.8 0.2 1 0 0.25 Sub-region
message ; ppl shaset reset

let europe_space=eof_space(europe[t=1:240:12],1)
let ireuk_space=eof_space(ireuk[t=1:240:12],1)

! look at the first mode of each
set view vhi ; shade/nolab/l=1 europe_space ; label/nouser 5.8 0.2 1 0 0.25 Mode 1 full region
label/nouser 3 4.4 0 0 0.25 Fine Spatial Scale Signal Dominant
set view vlo ; shade/nolab/l=1 ireuk_space  ; label/nouser 5.8 0.2 1 0 0.25 Mode 1 subregion
message ; ppl shaset reset

! ... and the 2nd mode of each
set view vhi ; shade/nolab/l=2 europe_space ; label/nouser 5.8 0.2 1 0 0.25 Mode 2 full region
label/nouser 3 4.4 0 0 0.25 Fine Spatial Scale Signal Dominant
set view vlo ; shade/nolab/l=2 ireuk_space  ; label/nouser 5.8 0.2 1 0 0.25 Mode 2 subregion

[Thread Prev][Thread Next][Index]

Contact Us
Dept of Commerce / NOAA / OAR / PMEL / TMAP

Privacy Policy | Disclaimer | Accessibility Statement