Re: correlating two arrays

From: Erik Noble <enoble_at_nyahnyahspammersnyahnyah>
Date: Fri, 25 Jan 2008 16:56:21 -0500

Dear Dennis.
Thank you for this.
If I am not concerned about weight, (i.e. Small region), then I should
proceed with example 5?
I notice that example 8 does not use the escorc function at all.

-Erik

On 1/21/08 7:59 PM, "Dennis Shea" <shea_at_ucar.edu> wrote:

>
> Assuming you want a areal weighted pattern correlation, see Example 8
> http://www.ncl.ucar.edu/Document/Functions/Built-in/escorc.shtml
>
>
> The "wgt" variable in this example is assumed to be the cos latitude
>
> lat(lat)
> rad = 4.*atan(1.)/180.
> wgt = cos(rad*lat)
>
> Then proceed as in example 8
> ===============================
> If the lat/lon arrays are 2D, say, XLAT, XLONG
>
>
> wgt = cos(rad*XLAT) ; wgt[*][*]
>
>
> xAvgArea = x*wgt/sum(wgt) ; weighted area average
> yAvgArea = y*wgt/sum(wgt) **
> <http://www.ncl.ucar.edu/Document/Functions/Built-in/wgt_areaave.shtml>
>
> xAnom = x - xAvgArea ; anomalies
> yAnom = y - yAvgArea
>
> covxy = *sum*
> <http://www.ncl.ucar.edu/Document/Functions/Built-in/sum.shtml>(xAnom*yAnom*wg
> t) ; weighted anomaly covariance
>
> r = covxy/( *sqrt*
> <http://www.ncl.ucar.edu/Document/Functions/Built-in/sqrt.shtml>(*sum*
> <http://www.ncl.ucar.edu/Document/Functions/Built-in/sum.shtml>(wgt*xAnom^2))
> **sqrt* <http://www.ncl.ucar.edu/Document/Functions/Built-in/sqrt.shtml>(*sum*
> <http://www.ncl.ucar.edu/Document/Functions/Built-in/sum.shtml>(wgt*yAnom^2))
> )
>
>
> Erik Noble wrote:
>> Hi.
>>
>> I have two 2D arrays:
>>
>>>> whos Model1
>>>>
>> Name Size Bytes Class Attributes
>>
>> Model1 30x79 18960 double
>>
>>
>>>> whos Obs
>>>>
>> Name Size Bytes Class Attributes
>>
>> Obs 30x79 18960 double
>>
>> I want to correlate these two arrays. Which set of NCL functions does this?
>>
>
>
>

_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Fri Jan 25 2008 - 14:56:21 MST

This archive was generated by hypermail 2.2.0 : Mon Jan 28 2008 - 17:01:44 MST