[ncl-talk] cross-correlation

Kunal Bali kunal.bali9 at gmail.com
Sat Feb 24 02:30:03 MST 2018


Dear Dennis Sir,

Thanks for this explanation.

After changing/or reorder the dimension name then script ran successfully
but with a warming


*warning:esccr: Non-fatal conditions encountered: all missing or constant
values*
After searching this query most of the users said

The warning massage is generally occurred if one or several time,
series have all the same values. The correlation coefficient is
calculated by dividing standard deviation. If all values are same,
the standard deviation is zero.


One user also said it could be ignored (
https://www.ncl.ucar.edu/Support/talk_archives/2010/0175.html).
So can we really ignore this warning? if yes, then is there any possibility
to remove this warning.



*Query regarding :*
*The last dimension of x must be equal to the last dimension of y*
In the previous mail, this query removed by changing the order of
dimensions name. But if the only dimension size is given not dimension name
then how can we set the dimension.

Such as

Variable: CoD_final
Type: float
Total Size: 5076540 bytes
            1269135 values
Number of Dimensions: 2
*Dimensions and sizes:    [1185] x [1071]*
Coordinates:
Number Of Attributes: 1
  _FillValue :    -28672
(0)    min=0   max=1

Variable: ccr
Type: float
Total Size: 5076540 bytes
            1269135 values
Number of Dimensions: 3
*Dimensions and sizes:    [1185] x [1071] x [1]*
Coordinates:
Number Of Attributes: 1
  _FillValue :    -28672
*(0)    min=-2.13598   max=2.74001  ===> also, I am getting correaltion
values greater than 1*




*I tried to calculate covarience usingccv = escovc(CoD_final,ccr(time|:,
lat|:, lon|:))*

*then fatal:(lon) is not a dimension name in variable (ccr), could not
determine dimension number*


*the I triedccv = escovc(CoD_final,ccr(:,:,0))*

But after trying this I got several warning

warning:escovc: Non-fatal conditions encountered in series or xstd = 0.0
(0)    is_valid_latlon2d_attr: Warning: The 'lat2d' attribute must either be
(0)    the same dimension sizes as the data, or one element larger in both
directions.
(0)    Your data will most likely not be overlaid on the map correctly.
(0)    check_for_y_lat_coord: Warning: Data either does not contain
(0)    a valid latitude coordinate array or doesn't contain one at all.
(0)    A valid latitude coordinate array should have a 'units'
(0)    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'
(0)    is_valid_latlon2d_attr: Warning: The 'lon2d' attribute must either be
(0)    the same dimension sizes as the data, or one element larger in both
directions.
(0)    Your data will most likely not be overlaid on the map correctly.
(0)    check_for_lon_coord: Warning: Data either does not contain
(0)    a valid longitude coordinate array or doesn't contain one at all.
(0)    A valid longitude coordinate array should have a 'units'
(0)    attribute equal to one of the following values:
(0)        'degrees_east' 'degrees-east' 'degree_east' 'degrees east'
'degrees_E' 'Degrees_east' 'degree_E' 'degreeE' 'degreesE' 'deg east'
(0)    Error: scalar_field: If the input data is 1-dimensional, you must
set sfXArray and sfYArray to 1-dimensional arrays of the same length.
warning:create: Bad HLU id passed to create, ignoring it




---
Kunal Bali




On Fri, Feb 23, 2018 at 8:51 PM, Dennis Shea <shea at ucar.edu> wrote:

> 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
>> <079%201666%206667>]            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 <079%201666%206667>]            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
>> <079%201666%206667>]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/20180224/4444ae6d/attachment.html>


More information about the ncl-talk mailing list