[ncl-talk] error in probability calculation

Barry Lynn barry.h.lynn at gmail.com
Tue Mar 7 10:13:13 MST 2017


Hi:

The error actually tells you the problem (or at least it appears to).

It seems to be saying that your input arrays must each have the same number
of dimensions (e.g., time, x, y) for this function to work.

Barry

On Tue, Mar 7, 2017 at 1:15 PM, Dhirendra Kumar <dhirendra.cub at gmail.com>
wrote:

> Dear folks
>
> I am trying to calculate significance of the regression coefficient for a
> gridded dataset.
> I have written the followin code:
>
> f=addfile("yearmean_monmean_selmon_JJAS_mergetime_1975_2015.nc","r")
> rain=f->rf(lat|:,lon|:,time|:)
> ; regression coefficient
> time = rain&time
> rc=regCoef(time,rain)
> copy_VarCoords(rain(:,:,0), rc)
> df1= onedtond(rc at nptxy , dimsizes(rc)) - 2
> tval1 = onedtond(rc at tval , dimsizes(rc))
> printVarSummary(tval1)
> b=0.5
> prob = betainc(df1/(df1+tval1^2),df1/2.0,0.5)       ; prob(nlat,nlon)
>
> I got the following error:
> fatal:betainc: The three input arrays must have the same number of
> dimensions
> fatal:["Execute.c":8575]:Execute: Error occurred at or near line 19 in
> file regress.ncl
>
> Please suggest me any missing step or the cause of the error.
>
> ​Regards
> Dhirendra​
>
> --
> ========================================
> Dhirendra Kumar
> PhD Student
> School of Environmental Sciences, JNU
> New Delhi (India)
> Contact: +91 9910778043 <+91%2099107%2078043>
> Alternate email: dhirendra.cub at outlook.com
> =========================================
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>


-- 
Barry H. Lynn, Ph.D
Senior Lecturer,
The Institute of the Earth Science,
The Hebrew University of Jerusalem,
Givat Ram, Jerusalem 91904, Israel
Tel: 972 547 231 170
Fax: (972)-25662581

C.E.O, Weather It Is, LTD
Weather and Climate Focus
http://weather-it-is.com
Jerusalem, Israel
Local: 02 930 9525
Cell: 054 7 231 170
Int-IS: x972 2 930 9525
US 914 432 3108
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20170307/43c58468/attachment.html 


More information about the ncl-talk mailing list