Re: Regrid vegetation's type data

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Mon, 27 Apr 2009 16:03:43 -0600 (MDT)

Guangshan,

There's no way to tell f2gsh to return integers.

You can use one of our truncation functions, but you may lose
information.

For example, you can call "floattointeger" on the output:

   X = floattointeger(f2gsh (x, (/jlat,ilon/), 42))

There are also functions "round", "ceil" and "floor" which do
different kinds of truncation/rounding. "ceil" and "float" return
floats, but they are whole numbers.

   http://www.ncl.ucar.edu/Document/Functions/Built-in/floattointeger.shtml
   http://www.ncl.ucar.edu/Document/Functions/Built-in/round.shtml
   http://www.ncl.ucar.edu/Document/Functions/Built-in/ceil.shtml
   http://www.ncl.ucar.edu/Document/Functions/Built-in/floor.shtml

--Mary

On Mon, 27 Apr 2009, guangshan chen wrote:

> Hi all,
>
> I have a Matthew's vegetation data in NETCDF format and want to
> regrid it from 1x1 fixed grid to a gaussian grid.
> The data is integer. But when I used f2gsh function to interpolate
> the data, I found that the data type is changed to
> float. Is there any way to interpolate the data without changing the
> data type? This means that I also want the final
> data type is integer.
>
> Thank you very much.
>
> Guangshan
>
> _______________________________________________
> 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 Mon Apr 27 2009 - 16:03:43 MDT

This archive was generated by hypermail 2.2.0 : Mon Apr 27 2009 - 16:09:00 MDT