Re: Werid Problem

From: Debasish <debasish_at_nyahnyahspammersnyahnyah>
Date: Thu Sep 22 2011 - 09:08:51 MDT

Sorry!!!

I guess you have one dimensional variable so you do not need convert the dimension

for your case try following

if (any(aa.eq.-99.0)) then
       i50 = ind(aa.eq.-99.0) ; all indices aa equal to -99.0
       aa(i50) = -9999.
       delete (i50) ; i50 no longer needed
   end if

if (any(aa.eq.999.9)) then
       i50 = ind(aa.eq.999.9) ; all indices aa equal to 999.9
       aa(i50) = -9999.
       delete (i50) ; i50 no longer needed
   end if
 aa@_FillValue = -9999.

Thanks
Debasish

On 2011-09-22, at 10:36, Cheung wrote:

> Dear all:
>
> I have to replace 2 specified values (-99.0 and 999.9) into default missing value -9999. , in a double array (say aa). But Whatever methods I took, say:
>
> aa = mask(aa, aa.eq.-99.0, False)
> aa = mask(aa, aa.eq.999.9,False)
>
> Or Loop and if case:
>
> do i = 0, dimsizes(aa)-1
> if(aa(i).eq.-99.0)then
> aa(i) = -9999.0
> end if
> if(aa(i).eq.999.9) then
> aa(i) = -9999.0
> end if
> end do
>
> It just can only substitute the -99.0 into -9999.0, doesn't work to 999.9, can anyone tell me why and how??
>
>
> Regards
>
> Cheung
>
>
>
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Thu Sep 22 11:04:12 2011

This archive was generated by hypermail 2.1.8 : Thu Sep 22 2011 - 17:12:44 MDT