Re: Cross correlation between two zonally averaged variables

From: Noel Aloysius <noel.aloysius_at_nyahnyahspammersnyahnyah>
Date: Fri Apr 06 2012 - 09:45:05 MDT

Hi Adam,

Thanks for the reply.

A) Zonal average

I checked the output summary of the cross correlations. The zonal averge
output dimentions are [lat | 35] x [month | 12] wheras the cross-corr
dimensions are [35]. Does escorc computes the correlations across 12-months
and gives a single value for each lat? If this is the case, how can I get
the cross correlations for each lat by month, ie with the same dimension as
[lat | 35] x [month | 12].

B) Max values of a variable along lat

>From the zonal average, Pzone1 and 2, I want to get the max value along the
latitudes for each month, identify the latitiude at which the max occurs
and create an xy plot that shows the magnitude and location.
    i) The max value can be computed using dim_max, but how can I get the
lat value index.
   ii) How can I combine these two and create a single xy plot, with month
on x axis and lat on y axis.

The script I developed so far is attached. Lines 56-58 and 90-93 shows I
how compute climatology, zonal average and max values.

Thank you again for the assistance,

Noel

On Thu, Apr 5, 2012 at 7:40 PM, Adam Phillips <asphilli@ucar.edu> wrote:

> Hi Noel,
> Striping out some lines from your code:
> Pzone1 = dim_avg_Wrap(Pclm(lat|:,month|:,lon|:))
> Pzone2 = dim_avg_Wrap(Pclm(lat|:,month|:,lon|:))
> ..... (So both Pzone1 and Pzone2 are dimensioned lat x month
> ccr = escorc(Pzone1,Pzone2)
> .....
> plot(0) = gsn_csm_lat_time(wks, ccr, res)
>
> The output array (ccr) from escorc will be a 1D array of size
> dimsizes(Pzone1&lat). ccr will also not contain any associated coordinate
> variables. gsn_csm_lat_time expects a 2D array dimensioned lat x time, and
> that is why you are getting that error message. Try using printVarSummary
> after the lines above to see what I mean.
>
> I'm not 100% sure that this is what you want, but if you want to correlate
> the corresponding time series (at each latitude) and then plot the
> correlation coefficients at each latitude, you can do that with a line
> plot. gsn_csm_xy should do the trick.
>
> Hope that helps. If not, or if you have further queries, please let
> ncl-talk know.
> Adam
>
>
> On 04/05/2012 12:44 PM, Noel Aloysius wrote:
>
> Hello NCL-talk,
>
> I want to create a plot of cross-correlation between two zonally averaged
> variables. I used clmMonTLL and dim_avg_Wrap to create the zonal averages
> and then used escorc function to compute the correlation. When I tried to
> plot results I get the following error. I will appreciate any help to
> resolve this,
>
> (0) check_for_y_lat_coord: Warning: Data either does not contain a
> valid latitude coordinate array or doesn't contain one at all.
> (0) A valid latitude coordinate array should have a 'units' attribute
> equal to one of the following values:
> (0) 'degrees_north' 'degrees-north' 'degree_north' 'degrees north'
> 'degrees_N' 'Degrees_north' 'degree_N' 'degreeN' 'degreesN' 'deg north'
>
> The script is attached. Thank you in advance,
> Noel
>
>
>
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
> --
> ______________________________________________________________
> Adam Phillips asphilli@ucar.edu
> NCAR/Climate and Global Dynamics Division (303) 497-1726
> P.O. Box 3000
> Boulder, CO 80307-3000 http://www.cgd.ucar.edu/cas/asphilli
>
>
> _______________________________________________
> 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 Fri Apr 6 09:45:18 2012

This archive was generated by hypermail 2.1.8 : Mon Apr 09 2012 - 13:43:03 MDT