[ncl-talk] cross-correlation
Dennis Shea
shea at ucar.edu
Fri Feb 23 08:21:45 MST 2018
As we have said before, you must read the error message and then look at
the function being called and the day being used. Further, looking at the
Examples helps a lot.
===
fatal:esccr: the rightmost dimension of x and y must be the same
fatal:["Execute.c":8640]:Execute: Error occurred at or near line 141 in
file ccr.ncl
===
look at line 141
ccr = esccr(ts1,ts2,maxlag) ; calc cross correlations
at lines 133,134, you have
ts1 = data_single(:)
ts2 = data_subset(:,:,:)
*Variable: data_single ==> ts1Dimensions and sizes: [time | 96]*
*Variable: data_subset ==> ts2Dimensions and sizes: [time | 96] x
[lat | 1185] x [lon | 1071]*
As noted in the function documentation,
*x*: An array of any numeric type or size. The rightmost dimension is
usually time.
*y: *An array of any numeric type or size. The rightmost dimension is
usually time. *The size of the rightmost dimension must be the same as x. *
====
Clearly. the "rightmost" dimension of 'ts1' [size=1071'] does not match the
size of ts1' [size=96]
Example 2 in the documentation, show how the address this situation. Use,
NCL's dimension reordering:
ccr = esccr(ts1,ts2(lat|:,lon|:,time|:), maxlag)
On Fri, Feb 23, 2018 at 4:07 AM, Kunal Bali <kunal.bali9 at gmail.com> wrote:
> Dear NCL user,
>
> I am using the attached script to calculate the cross-correlation between
> single grid cell to neighbor grid cells with time.
>
> I am getting an error
> fatal:esccr: the rightmost dimension of x and y must be the same
> fatal:["Execute.c":8640]:Execute: Error occurred at or near line 141 in
> file ccr.ncl
>
> ---
> The summary is here:
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> *Copyright (C) 1995-2017 - All Rights Reserved University Corporation for
> Atmospheric Research NCAR Command Language Version 6.4.0 The use of this
> software is governed by a License Agreement. See http://www.ncl.ucar.edu/
> <http://www.ncl.ucar.edu/> for more details.Variable: totcType: floatTotal
> Size: 2025086976 <(202)%20508-6976> bytes 506271744 valuesNumber
> of Dimensions: 3Dimensions and sizes: [time | 96] x [lat | 2112] x [lon
> | 2497]Coordinates: time:
> [35430.125..104813.7916666667] lat:
> [5.0078125..37.9921875] lon: [ 59.. 98]Number Of Attributes:
> 8 long_name : AOT at 0.55 micron hdfeos_name : Optical_Depth_055
> projection : Albers Conical Equal_Area unit : None
> _FillValue_original : -28672 _FillValue : -28672
> missing_value_original : -28672 missing_value : -28672Variable:
> data_subsetType: floatTotal Size: 487347840 bytes 121836960
> valuesNumber of Dimensions: 3Dimensions and sizes: [time | 96] x [lat |
> 1185] x [lon | 1071]Coordinates: time:
> [35430.125..104813.7916666667] lat:
> [23.5078125..5.0078125] lon: [72.78125..89.5]Number Of
> Attributes: 8 missing_value : -28672 missing_value_original :
> -28672 _FillValue : -28672 _FillValue_original : -28672 unit :
> None projection : Albers Conical Equal_Area hdfeos_name :
> Optical_Depth_055 long_name : AOT at 0.55 micron(0) nearest
> location: k=0 n=541 m=1291 13.4609375 79.17187499999999(0)
> -----Variable: data_singleType: floatTotal Size: 384 bytes 96
> valuesNumber of Dimensions: 1Dimensions and sizes: [time |
> 96]Coordinates: time: [35430.125..104813.7916666667]Number Of
> Attributes: 10 lon : 79.171875 lat : 13.4609375 missing_value :
> -28672 missing_value_original : -28672 _FillValue : -28672
> _FillValue_original : -28672 unit : None projection : Albers
> Conical Equal_Area hdfeos_name : Optical_Depth_055 long_name : AOT
> at 0.55 micron(0) -----*
> fatal:esccr: the rightmost dimension of x and y must be the same
> fatal:["Execute.c":8640]:Execute: Error occurred at or near line 141 in
> file ccr.ncl
>
>
> ---
> Kunal Bali
>
>
>
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20180223/2ca5b258/attachment.html>
More information about the ncl-talk
mailing list