[ncl-talk] How to calculate the escorc when the input array contain some series with all constant values?

Dennis Shea shea at ucar.edu
Tue Mar 1 09:59:56 MST 2016


Did you look at your output? NCL already does what you suggest.
N=10
x  = random_uniform(-1,1,(/2,N/))
y  = random_uniform( 0,N,(/2,N/))
r  = escorc(x,y)
print(r)

y(1,:) = 5.0           ; all constant
R  = escorc(x,y)

You get the *warning*
warning:escorc: Non-fatal conditions encountered in series or xstd equals
zero.
Possibly, all values of a series are constant.
warning:escorc: Most likely, one or more series consisted of all constant
values

ncl 8> print(R)
=====================
Variable: r
Type: float
Total Size: 8 bytes
            2 values
Number of Dimensions: 1
Dimensions and sizes:   [2]
Coordinates:
Number Of Attributes: 1
  _FillValue :  9.96921e+36
(0)     -0.1098938
(1)     -0.241365


Variable: R
Type: float
Total Size: 8 bytes
            2 values
Number of Dimensions: 1
Dimensions and sizes:   [2]
Coordinates:
Number Of Attributes: 1
  _FillValue :  9.96921e+36  <========
(0)     -0.1098938
(1)     9.96921e+36               <======


On Tue, Mar 1, 2016 at 8:18 AM, xianglin72 <xianglin72 at icloud.com> wrote:

> Hi, all
>
>
>
>          I'am dealing with the correlation between a index series and
> HadISST ice concentration gridded data.  And I
>
> got no results when using escorc function,  only with the following
> warning message :
>
>
> " warning:escorc: Non-fatal conditions encountered in series or xstd
> equals zero.
>
> Possibly, all values of a series are constant. "
>
>
> I suggest that it may be because  the grids in land are all _FillValue and
> the grids in the warm ocean are all constant
>
> zero values. How could I get the escorc results between the index series
> and the corresponding grids with variable values?
>
>
>       Besides, I also suggest that the escorc could add some function, to
> make the corresponding correaltion values to be _FillValue when the input
> grids contain all constant values.  Thank!
>
>
>
> The attached codes :
>
> ……. ********************************
>
> fi = addfile( data_path + data_filename ,"r")
>
> printVarSummary(fi)
>
> time    = fi->time
>
> yyyymm  = ut_calendar(time,-1)
>
> nt1     = ind(yyyymm.eq.ntStrt)
>
> nt2     = ind(yyyymm.eq.ntLast)
>
> ;lat     = fi->latitude
>
> ;lon     = fi->longitude
>
> x       = fi->sic(nt1:nt2,{-45.:-90.},:)
>
> x       = where(x.eq.0, x at _FillValue, x)
>
>
> ; ******************  read the AAO index series
> ********************************************
>
> data   =
>  asciiread("/Users/Data/indices/SAM/cpc.aao_197901-201312.txt",(/34*12,3/),"float")
>
> y      =  data(:,2)
>
> y!0    =  "time"
>
> print(y(34*12-1))
>
>
> ccr    =  escorc( y,x(latitude|:,longitude|:,time|:) )
>
> sig    =  rtest(ccr, 34*12, 0)
>
> print(" ok ")
>
>
>
> *********************************
>
>
> Thank!
>
>
>
>
> Lin
>
>
>
>
> _______________________________________________
> 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/20160301/2aa5f825/attachment.html 


More information about the ncl-talk mailing list