[ncl-talk] Regression produces fatal error: regCoef_n: The input array y must have as many or more dimensions than x

Andreas Chrysanthou eeac at leeds.ac.uk
Fri Sep 1 08:14:36 MDT 2017


Hi Adam,

I did that beforehand just to test it and it works normally producing an array with the desired output.
But the problem is that the regression coefficients units (y/x) that I want to have as output should be when the 1D var is y and the 3D var is x.

Cheers,
Andreas

On 1 Sep 2017, at 15:03, Adam Phillips <asphilli at ucar.edu<mailto:asphilli at ucar.edu>> wrote:

Hi Andreas,
I think the error message is trying to tell you that you should switch your two input arrays. (The 2nd input array must have as many or more dimensions as the 1st one.) If switching the two arrays doesn't help let ncl-talk know..
Adam

On Fri, Sep 1, 2017 at 7:06 AM, Andreas Chrysanthou <eeac at leeds.ac.uk<mailto:eeac at leeds.ac.uk>> wrote:
Hi NCL users,

I want to calculate the regression coefficients of variable with 1 dimension (y= mass_flux)  against another which has 3 dimensions (x = acceldivf_).

Typically, according to the description of the regCoef_n (x, y, dims_x, dims_y) NCL function x and y can be arrays of any dimensionality but the dims_x and dims_x and dims_y is an integer indicating which dimension of x/y to do the calculation on, as long as it has the same number of elements.

The error I’m getting is the following: fatal:regCoef_n: The input array y must have as many or more dimensions than x

PrintVarSummary of both variables follows:

Variable: mass_flux
Type: float
Total Size: 564 bytes
            141 values
Number of Dimensions: 1
Dimensions and sizes: [time | 141]
Coordinates:
            time: [1960..2100]
Number Of Attributes: 1
  _FillValue : 1e+20

Variable: acceldivf_
Type: float
Total Size: 839232 bytes
            209808 values
Number of Dimensions: 3
Dimensions and sizes: [time | 141] x [lev | 31] x [lat | 48]
Coordinates:
            time: [1960..2100]
            lev: [1000.. 0.1]
            lat: [-87.15909445302286..87.15909445302286]

So it fails with the above fatal error when I try:

rc= regCoef_n (acceldivf_, mass_flux, 0, 0)


Any ideas please?

Cheers,
Andreas



_______________________________________________
ncl-talk mailing list
ncl-talk at ucar.edu<mailto:ncl-talk at ucar.edu>
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk




--
Adam Phillips
Associate Scientist,  Climate and Global Dynamics Laboratory, NCAR
www.cgd.ucar.edu/staff/asphilli/<http://www.cgd.ucar.edu/staff/asphilli/>   303-497-1726

<http://www.cgd.ucar.edu/staff/asphilli>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20170901/cf6128da/attachment.html>


More information about the ncl-talk mailing list