maskout / changing values

Mary Jo Nath Mary-Jo.Nath at NOAA.GOV
Fri Nov 9 11:39:07 EST 2007


Jean Pierre,

I think this should work.
To see the logic, I break the problem down in steps rather than try to
do it all in one command:

* mask ice >1   (0.-1)
define a=maskout(icecmsl,0.99999-ice)

* mask ice < 1.28  (1.28-2.28)
define b=maskout(icecsml,icecmsl-1.2800001)

*assign 1 to missing values in a & b then multiply so values from
0-0.99999, 1.2800001-2.28 are retained
*  &  ice values in 1-1.28 range now = 1
define newice=const(a,1.,-u)*const(b,1.,-u)

MJ



Jean Pierre Arabonis wrote:
> Hi everyone
>    I have an ice coverage dataset that has values from 0-2.28 of which
> values from 0-1.28 are valid ice percentages, however the values from 1
> - 1.28 all correspond to 100% and need to be assigned the value 1.
>    I have tried to use a combination of maskout and const to achieve
> this and tried to adapt an example to achieve this but I'm not getting
> it.
>
> define newice =
> const(const(maskout(icecmsl,(maskout(icecmsl,icecmsl+1)-1.28)),1),0,-u)
>
>    Could someone please poit me in the right direction.
>
>    Many thanks
>       Jean Pierre
>
>
> --
> Jean Pierre Arabonis
> arabonis at egs.uct.ac.za
> Tel 021 780 1021 cell 084 401 1365
> This email is 100% Microsoft Free



More information about the gradsusr mailing list