[ncl-talk] Function "ind"

Alan Brammer abrammer at albany.edu
Wed Nov 18 07:25:05 MST 2015


Based on that print out of Z it looks like the fill values have been truncated in some way, so NCL is no longer recognising them as missing. 

Heres how fill values look to me when I print. 

Variable: x
Type: float
Total Size: 40 bytes
            10 values
Number of Dimensions: 1
Dimensions and sizes:	[10]
Coordinates:
  _FillValue :	9.96921e+36
(0)	9.96921e+36
(1)	9.96921e+36
(2)	9.96921e+36


To fix the problem, you could do something along the lines of:
z = where( z .gt. 1e+35, z at _FillValue, z)    ;  set anything greater than a ridiculously large number to FillValue. 


Why you have the problem is a different question and requires more investigation as to where the data came from and what you have done to it that may had caused this.  



Good luck, 
	Alan Brammer. 



> On 18 Nov 2015, at 01:40, Amadou Coulibaly <mpapin24 at gmail.com> wrote:
> 
> 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 <mailto:mpapin24 at gmail.com> / coulibalya68 at yahoo.com <mailto: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
> 
>  
> 
>  
> 
>  
> _______________________________________________
> 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/20151118/b09ed061/attachment.html 


More information about the ncl-talk mailing list