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 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: IDL: problem on reading ncdf file with short type data [message #70274] Thu, 01 April 2010 06:39
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Kwang. Jae LEE writes:

> my second question looked too stupid after I solved it.
> so I tried to delete my qustion,

Most questions look pretty lame after the answer is
known. But, I think you will find that hitting the
SEND button is more effective than just about anything
I know for forcing the answer front and center in the
human brain. Feeling lame is more or less normal for
those of us who continue to hit that SEND button. :-)

Cheers,

David



--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: IDL: problem on reading ncdf file with short type data [message #70276 is a reply to message #70274] Thu, 01 April 2010 06:15 Go to previous message
Kwang. Jae LEE is currently offline  Kwang. Jae LEE
Messages: 6
Registered: April 2010
Junior Member
On 4월1일, 오후9시48분, "Kwang. Jae LEE" <iglea...@gmail.com> wrote:
> Thanks
> I'll check again.
> then I did wrong in another point. T_T

I solved my problem..
my second question looked too stupid after I solved it.
so I tried to delete my qustion, but I didn't know only mine is
erased, not whole...
your answer is left without my question, it could seems rude, I didn't
mean, sorry for that ^^
I'm also begginer using this board..

thanks all for your help.

regrads

KJ
Re: IDL: problem on reading ncdf file with short type data [message #70280 is a reply to message #70276] Thu, 01 April 2010 05:48 Go to previous message
Kwang. Jae LEE is currently offline  Kwang. Jae LEE
Messages: 6
Registered: April 2010
Junior Member
Thanks
I'll check again.
then I did wrong in another point. T_T
Re: IDL: problem on reading ncdf file with short type data [message #70281 is a reply to message #70280] Thu, 01 April 2010 05:26 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Kwang. Jae LEE writes:

> -- 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

SHORT is netCDF terminology for an INT. It's like
calling the large cat that was seen in one of the
local parks around here a "cougar" as opposed to
a "mountain lion". If someone called it a "cougar",
you would know that person grew up in the Eastern
US. But you would still know to get the kids inside. :-)

Cheers,

David



--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
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
  Switch to threaded view of this topic Create a new topic Submit Reply
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: Wed Oct 08 13:47:13 PDT 2025

Total time taken to generate the page: 0.00558 seconds