Re: Regrid vegetation's type data

From: guangshan chen <gchen9_at_nyahnyahspammersnyahnyah>
Date: Mon, 27 Apr 2009 17:15:11 -0500

Hi Mary,

Thanks. This would be very helpful.
I will try to see which function works best.

Guangshan
On Apr 27, 2009, at 5:03 PM, Mary Haley wrote:

> 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
>>
Received on Mon Apr 27 2009 - 16:15:11 MDT

This archive was generated by hypermail 2.2.0 : Thu Apr 30 2009 - 15:56:01 MDT