comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: IDL: problem on reading ncdf file with short type data
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: IDL: problem on reading ncdf file with short type data [message #70282 is a reply to message #70281] Thu, 01 April 2010 05:24 Go to previous message
Maxwell Peck is currently offline  Maxwell Peck
Messages: 61
Registered: February 2010
Member
As I mentioned previously short is integer. Short just means a 16 bit
integer not a 32 bit integer it seems to be read and stored
correctly... Unless im missing something here..

What is the value you get from Grads and how does this compare to IDL
for the same pixel.

Max


On Apr 1, 10:59 pm, "Kwang. Jae LEE" <iglea...@gmail.com> wrote:
> still I have problem unsolved on my previous question ' IDL: Wrong
> data type when reading ncdf file in IDL'
>
> using well-know data in meterology
> reading it...
>
> fname = 'pres.sfc.mon.mean.nc'http://www.cdc.noaa.gov/cdc/data.reanalysis2.html
> ------------------------------------------
> id=NCDF_OPEN(file)
> NCDF_VARGET, id, 'pres', data
>   NCDF_ATTGET, id, 'pres', 'missing_value', miss
>   NCDF_ATTGET, id, 'pres', 'scale_factor', scalef
>   NCDF_ATTGET, id, 'pres', 'add_offset', offset
> NCDF_CLOSE, id
>
> data=data*scalef+offset
>
> ------------------------------------------
>
> -- from 'ncdump -h commend' , data type is 'short'
> short pres(time, lat, lon) ;
>
> -- right after  'NCDF_VARGET commend'  data type shown
> IDL> help, data
> DATA            INT       = Array[144, 73, 372]
>
> data is stored as interger type not short type
>
> after calc. : data=data*scalef+offset
> data type is changed into float type because scalef is float type. i
> missunderstood it's done.
> but when it was written as ineger type. , real value after point is
> missing.
> that's why the value I checked from another tool called 'Grads' is
> different from that by IDL
> I think there's another option to read short type data in IDL using
> 'NC commend'
> I had no problem with float type data
>
> any idea????
>
> thanks
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: how many array elements with a certain value in a row
Next Topic: Re: how many array elements with a certain value in a row

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 04:48:41 PDT 2025

Total time taken to generate the page: 0.55599 seconds