[ncl-talk] computing using dim_stat4_n (/0.1/)

Sri.durgesh Nandini-Weiss sri.durgesh.nandini-weiss at uni-hamburg.de
Tue Nov 12 04:57:43 MST 2019


Hello all,

I am trying to ; Compute first four moments (average, variance, 
skewness, and kurtosis) based on SSH anomalies

which are in this format: [time | 240] x [ens | 100] x [lat | 45] x [lon 
| 90].

I am successful in computing and plotting it using this code:

    xStat = dim_stat4_n(xAnom1,1)                    ; computing on  ens 
dimension, without looping (4,ntim,nlat,mlon)
    printVarSummary(xStat)
    printMinMax(xStat,0)

    xClmMonEns = xStat(0,:,:,:)
    xStdMonEns = xStat(1,:,:,:)
    xSkwMonEns = xStat(2,:,:,:)
    xKurMonEns = xStat(3,:,:,:)

    copy_VarCoords(x(:,0,:,:), xClmMonEns)
    copy_VarCoords(x(:,0,:,:), xStdMonEns)
    copy_VarCoords(x(:,0,:,:), xSkwMonEns)
    copy_VarCoords(x(:,0,:,:), xKurMonEns)

The output is (4,ntim,nlat,mlon) because i used xStat = 
dim_stat4_n(xAnom1,1) ,

if i used xStat = dim_stat4_n(xAnom1,0) than it (4,ens,nlat,mlon).

What i want is xStat = dim_stat4_n(xAnom1,(/0,1/)) to only get 
(4,nlat,mlon), but this does not seem possible and i get the following 
error:

warning:dim_stat4_n: 975 rightmost sections of the input array contained 
all missing values.
Output values set to missing in these sections

and the xStat is  [4] x [45] x [90] x [49]

Can someone please help me with this?

Thanx

Sri





-- 
Sri Nandini-Weiß
Research Scientist

Universität Hamburg
Center for Earth System Research and Sustainability (CEN)
Cluster of Excellence 'Climate, Climatic Change, and Society' (CLICCS)

Bundesstrasse 53, 20146 Hamburg
Tel: +49 (0) 40 42838 7472



More information about the ncl-talk mailing list