[ncl-talk] Function "ind"

Amadou Coulibaly mpapin24 at gmail.com
Tue Nov 17 23:40:49 MST 2015


Dear NCL users,

I am trying to get the indices of non-missing values from 1D array which
looks like:

Variable: z
Type: float
Total Size: 112 bytes
            28 values
Number of Dimensions: 1
Dimensions and sizes:    [28]
Coordinates:
Number Of Attributes: 1
  _FillValue :    9.96921e+36
(0)    900
(1)    900
(2)    900
(3)    900
(4)    9.97e+36
(5)    900
(6)    900
(7)    900
(8)    9.97e+36
(9)    900
(10)    9.97e+36
(11)    900
(12)    9.97e+36
(13)    9.97e+36
(14)    9.97e+36
(15)    9.97e+36
(16)    9.97e+36
(17)    900
(18)    9.97e+36
(19)    9.97e+36
(20)    900
(21)    900
(22)    900
(23)    9.97e+36
(24)    9.97e+36
(25)    9.97e+36
(26)    9.97e+36
(27)    9.97e+36

​So I used "ind0=ind(.not.ismissing(z))"​ and when I printed out
"print(ind0)", I got this:

Variable: ind0
Type: integer
Total Size: 112 bytes
            28 values
Number of Dimensions: 1
Dimensions and sizes:    [28]
Coordinates:
(0)    0
(1)    1
(2)    2
(3)    3
(4)    4
(5)    5
(6)    6
(7)    7
(8)    8
(9)    9
(10)    10
(11)    11
(12)    12
(13)    13
(14)    14
(15)    15
(16)    16
(17)    17
(18)    18
(19)    19
(20)    20
(21)    21
(22)    22
(23)    23
(24)    24
(25)    25
(26)    26
(27)    27

But I am just looking for the indices of non-missing values in z.

What's wrong with this?

-- 
* COULIBALY   AMADOU   *
PhD  Student  on  West  African  Climate  System (WACS)
FUTA - Federal  University  of  Technology of Akure, Nigeria

*Visiting Student - *
*University of Cologne, Germany**Institute of Geophysics and Meteorology*
Pohligstr. 3 / Office 3.102
D-50969 Köln

*Project*: WASCAL (West African Science Service Centre on Climate Change
and Adapted Land Use)
Phone:(+234) 810 795 2836 /(+223) 65 67 27 57 /(+226) 64 57 37 27 /+49
15218352574

E-mail: mpapin24 at gmail.com / coulibalya68 at yahoo.com

"*The time is always right to do right": Nelson Mandela*

*"Character is like a tree and reputation like a shadow.  The shadow is
what we think of it; the tree is the real thing" : Abraham Lincoln*

*"Do what you can, with what you have, where you are" Theodore Roosevelt*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20151118/21aa660f/attachment.html 


More information about the ncl-talk mailing list