Re: How to get pcvar_varimax when using eofunc_varimax?

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Wed, 5 Sep 2007 06:01:13 -0600 (MDT)

Dear Yi-chao,

Unfortunately, the person who would be able to answer this question
is out. If you downloaded V4.3.1 of NCL, then there's nothing
else that you need to do.

You should be using "eofunc_varimax" and not "eof_varimax",
as the latter one has been deprecated.

The person who wrote the eofunc_varimax code ran many tests to make
sure this function was working, so can you be more specific about what
you mean by the pcvar_varimax values not being correct?

Thanks,

--Mary

On Tue, 4 Sep 2007, [big5] Yi-chao Wu (§d©y¬L) wrote:

> Hi,
>
> I used eofunc_varimax to do a rotated EOF analysis but the variance returned were alwasy the same. I noticed that in your reply to other people who asked the same question in April, you indicated that the new version will solve this problem. So I downloaded the latest version (ncl-4.3.1.Linux_i686_gcc3) and replaced the old NCL library with the new one (all files in the directory lib/ncarg and "libnclapi.a" are updated). However, neither eofunc_varimax nor eof_varimax returnes the correct pcvar_varimax. Is this because I updated the library only but not the entire NCL package? Or is there somthing
> else missing?
>
> Below is my code and the responses. Thanks.
>
> Yi-chao Wu
>
> ------------------------------------------------------------------------------------------
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl"
>
> begin
>
>
> f=addfile("strm85.nc","r")
> str85=f->str85
>
> printVarSummary(str85)
>
>
> st85=str85(latitude|:,longitude|:,time|:) ;indian
>
>
> time=ispan(1958,2005,1)
> lat1=st85&latitude
> lon1=st85&longitude
>
> neval =3
> ev_cor = eofunc(st85,neval,1)
> ev_ts = eofcor_ts(st85,ev_cor)
> printVarSummary(ev_cor)
> print(ev_cor_at_pcvar)
> ev_rot = eofunc_varimax(ev_cor,1)
> ev_rot_ts = eofcor_ts(st85,ev_rot)
> ; eof_varimax_reorder ( ev_rot ) ; reorder the information
> ; printVarSummary(ev_rot)
>
>
> ev_cor!1="lat"
> ev_cor!2="lon"
>
> ev_cor&lat=lat1
> ev_cor&lon=lon1
>
> ev_rot!0="Rotated EOF"
> ev_rot!1="lat"
> ev_rot!2="lon"
>
> ev_rot&lat=lat1
> ev_rot&lon=lon1
>
>
> printVarSummary(ev_rot)
> print(ev_rot_at_pcvar_varimax(0))
> print(ev_rot_at_pcvar_varimax(1))
> print(ev_rot_at_pcvar_varimax(2))
>
> ------------------------------------------------------------------------------------------------
>
> Copyright (C) 1995-2006 - All Rights Reserved
> University Corporation for Atmospheric Research
> NCAR Command Language Version 4.2.0.a034
> The use of this software is governed by a License Agreement.
> See http://www.ncl.ucar.edu/ for more details.
>
>
> Variable: str85
> Type: float
> Total Size: 205632 bytes
> 51408 values
> Number of Dimensions: 3
> Dimensions and sizes: [time | 48] x [latitude | 21] x [longitude | 51]
> Coordinates:
> time: [ 0.. 47]
> latitude: [-12.5..37.5]
> longitude: [ 95.. 220]
> Number Of Attributes: 9
> comments : Unknown1 variable comment
> long_name : stream function (850 mb)
> units :
> grid_name : grid-1
> grid_type : linear
> level_description : Earth surface
> time_statistic : instantaneous
> missing_value : -9.99e+33
> _FillValue : -9.99e+33
>
>
> Variable: ev_cor
> Type: float
> Total Size: 12852 bytes
> 3213 values
> Number of Dimensions: 3
> Dimensions and sizes: [3] x [21] x [51]
> Coordinates:
> Number Of Attributes: 5
> _FillValue : -9.99e+33
> method : transpose
> matrix : covariance
> pcvar : <aRRAY>
> eval : <aRRAY>
> (0) 61.65483
> (1) 11.9065
> (2) 8.448109
>
>
> Variable: ev_rot
> Type: float
> Total Size: 12852 bytes
> 3213 values
> Number of Dimensions: 3
> Dimensions and sizes: [Rotated EOF | 3] x [lat | 21] x [lon | 51]
> Coordinates:
> lat: [-12.5..37.5]
> lon: [ 95.. 220]
> Number Of Attributes: 1
> pcvar_varimax : <aRRAY>
> (0) 0.09337068
> (0) 0.09337068
> (0) 0.09337068
>
>

_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Wed Sep 05 2007 - 06:01:13 MDT

This archive was generated by hypermail 2.2.0 : Wed Sep 05 2007 - 07:49:00 MDT