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

Home » Public Forums » archive » Re: IDL: Wrong data type when reading ncdf file in IDL
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: IDL: Wrong data type when reading ncdf file in IDL [message #70301] Wed, 31 March 2010 01:01
Kwang. Jae LEE is currently offline  Kwang. Jae LEE
Messages: 6
Registered: April 2010
Junior Member
thanks I did it.
I had multiplied data * scalef, only for no-missing data, but its
data type still remain as 'fix'
that was my problem.

now I took whole value multiplied, it is changed into float type.
I didn't expect the way above can be a problem.

I appreciate your kind answer ^^
Re: IDL: Wrong data type when reading ncdf file in IDL [message #70304 is a reply to message #70301] Wed, 31 March 2010 00:18 Go to previous message
Maxwell Peck is currently offline  Maxwell Peck
Messages: 61
Registered: February 2010
Member
I'm not completely familiar with ncdf_varget but short is probably
referring to a short integer not a floating point number. This just
means its a 2 byte integer (i.e. data type 2 in IDL speak). It is
common for data of this type to be stored in this way in scientific
data formats.

I'm not sure what you're issue is. It appears from above it is being
read in correctly. When you multiply data * scalef it will become a
floating point array and give you the correct result.

On Mar 31, 6:10 pm, "Kwang. Jae LEE" <iglea...@gmail.com> wrote:
> thanks for your answer
> yeah, I can get real value with 'scalef'
> before that, my problem is..
>
> when I use NCDF_VARGET commend.
> varible have to be stored in real attribute as which is written
> 'short'
> but the result I read is stored as fix type.
> fix type is integer, but short type is real as i konw..
>
> i'm just begginer. there's something wrong i konw ?
>
> plz many commnet ^^
Re: IDL: Wrong data type when reading ncdf file in IDL [message #70305 is a reply to message #70304] Wed, 31 March 2010 00:10 Go to previous message
Kwang. Jae LEE is currently offline  Kwang. Jae LEE
Messages: 6
Registered: April 2010
Junior Member
thanks for your answer
yeah, I can get real value with 'scalef'
before that, my problem is..

when I use NCDF_VARGET commend.
varible have to be stored in real attribute as which is written
'short'
but the result I read is stored as fix type.
fix type is integer, but short type is real as i konw..

i'm just begginer. there's something wrong i konw ?

plz many commnet ^^
Re: IDL: Wrong data type when reading ncdf file in IDL [message #70306 is a reply to message #70305] Tue, 30 March 2010 23:50 Go to previous message
Maxwell Peck is currently offline  Maxwell Peck
Messages: 61
Registered: February 2010
Member
I'm not sure if I full understand your post but the data is probably
stored as 2 byte integers. The scale is used to obtain the actual
physical value, i.e. scalef * data. Try this on a small part of your
dataset and hopefully the output is somewhere in the range of 270-300
K

Max


On Mar 31, 3:49 pm, "Kwang. Jae LEE" <iglea...@gmail.com> wrote:
> Hi
>
> I tried to read ncdf fomatted data in IDL
>
> below is well-known data in meterology
>
> File : sst.mnmean.nc
> -----------------------------------------
> id=NCDF_OPEN(file)
> NCDF_VARGET, id,'sst', data
>   NCDF_ATTGET, id, 'sst', 'missing_value', miss
>   NCDF_ATTGET, id, 'sst', 'scale_factor', scalef
>   NCDF_ATTGET, id, 'sst', 'add_offset', offset
> NCDF_CLOSE, id
> -----------------------------------------
>
> IDL> help, data, scalef, offset
> DATA            INT       = Array[180, 89, 1874]
> SCALEF          FLOAT     =     0.0100000
> OFFSET          FLOAT     =       0.00000
>
> vaiable 'sst' is float or short data type checking from 'Grads' and
> 'ncdump -h commend'
> SST data is taken as interger form.
> but when I read another varible in IDL like above,  it has no problem
>
> anybody who has same problem or has answer from my question
> plz, help ^^
Re: IDL: Wrong data type when reading ncdf file in IDL [message #70307 is a reply to message #70306] Tue, 30 March 2010 23:33 Go to previous message
Kwang. Jae LEE is currently offline  Kwang. Jae LEE
Messages: 6
Registered: April 2010
Junior Member
I didn't know about what the short type data is.
is there no way to read short type data in IDL with NCDF_VARGET
commend??
IDL default is to save the short type data into fix type..

plz let me know

regards
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: linear trend
Next Topic: IDL_PATH

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

Current Time: Wed Oct 08 13:52:06 PDT 2025

Total time taken to generate the page: 0.00689 seconds