Re: correlation

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Tue Aug 30 2011 - 11:28:40 MDT

covcorm: Calculates a covariance or correlation matrix.

---
Prototype
	function covcorm (
		x [*][*] : numeric,
		iopt [2] : integer)
---
The 1st argument is prototyped as two-dimensions [*][*]
Your data is three-dimensional so
    T2 = f->T2
    dimT2 = dimsizes(T2)
    ntim  = dimT2(0)       ; 1096
    ndom  = dimT2(1)       ; 4
    nsta  = dimT2(2)       ; 6
    t2    = T2(domain|:,station|:,time|:)   ; reorder
    t2_2d = onedtond( ndtooned(t2), (/ndom*nsta, ntim/) )
    r     = covcorm( t2_2d, (/ 1, 1/) )    ; (24,24)
    r@long_name = "cross-correlation"
   ;r@units     = ""
    print(r)
On 8/30/11 11:07 AM, Estefanía Jiménez wrote:
> Hi everyone! I am trying to get the correlations between the
> temperatures (T2) of the domains of each station. I am looking at the
> covcorm function but is not very clear to me... Any suggestions??
> See my variable below:
>
> *
> Variable: T2
> Type: float
> Total Size: 105216 bytes
>              26304 values
> Number of Dimensions: 3
> Dimensions and sizes:   [time | 1096] x [domain | 4] x [station | 6]
> Coordinates:
>              time: [0..1095]
>              domain: [0..3]
>              station: [787600..787740]
> Number Of Attributes: 1
>    _FillValue :  -999
> (0,0,0) 300.9278
> (0,0,1) 295.8722
> (0,0,2) 295.15
> (0,0,3) 298.4278
> (0,0,4) 298.65
> (0,0,5) 300.5389
> (0,1,0) 300.2722
> (0,1,1) 292.1551
> (0,1,2) 292.1551
> (0,1,3) 293.8665
> (0,1,4) 297.5131
> (0,1,5) 298.0481
> (0,2,0) 300.5642
>           .
> *
> *         .*
> *         .*
>
> Thank you all!
> --
>
> /Estefanía Jiménez R./
>
> //Meteoróloga
>
> Departamento de Climatología e Investigaciones Aplicadas
>
> Instituto Meteorológico Nacional
>
> MINAET
>
> Tel: +506 2222 5616 ext 136
>
>
>
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> 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 Tue Aug 30 11:28:47 2011

This archive was generated by hypermail 2.1.8 : Wed Sep 07 2011 - 10:58:58 MDT