Re: Cross correlation between two zonally averaged variables

From: Adam Phillips <asphilli_at_nyahnyahspammersnyahnyah>
Date: Thu Apr 05 2012 - 17:40:37 MDT

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
Received on Thu Apr 5 17:40:45 2012

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