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

Home » Public Forums » archive » Re: Do netCDF Files Have a DataType of INT?
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: Do netCDF Files Have a DataType of INT? [message #84414] Mon, 03 June 2013 07:23 Go to previous message
Paul Van Delst[1] is currently offline  Paul Van Delst[1]
Messages: 1157
Registered: April 2002
Senior Member
From the netCDF docs:

<quote>
A variable external data type is one of a small set of netCDF types. In
classic and 64-bit offset files, only the original six types are
available (byte, character, short, int, float, and double).
</quote>

That indicates to me that the netCDF "int" is equivalent to the IDL
"long", i.e. a 4-byte integer.

Similarly, the netCDF "short" is equivalent to the IDL "int"

From netcdf.h:
/*
* The netcdf external data types
*/
#define NC_NAT 0
#define NC_BYTE 1
#define NC_CHAR 2
#define NC_SHORT 3
#define NC_INT 4
#define NC_LONG NC_INT
#define NC_FLOAT 5
#define NC_DOUBLE 6
#define NC_UBYTE 7
#define NC_USHORT 8
#define NC_UINT 9
#define NC_INT64 10
#define NC_UINT64 11
#define NC_STRING 12
#define NC_MAX_ATOMIC_TYPE NC_STRING

cheers,

paulv

On 06/02/13 22:36, David Fanning wrote:
> Folks,
>
> I've run into a problem with a netCDF file and I need a sanity check.
>
> I define a variable attribute "colortable" with an integer value, say
> 33. As far as I know netCDF files don't have a datatype named "INT", so
> I use the datatype "SHORT" when I create the attribute:
>
> NCDF_ATTPUT, fileID, self.ID, 'colortable', 33, /SHORT
>
> Now, I want to read this attribute out of the file and copy it to
> another file. To learn something about this attribute I use the IDL
> routine NCDF_ATTINQ:
>
> attrInfo = NCDF_AttInq(fileID, GLOBAL=1, 'colortable')
>
> But, the datatype field of this attribute structure is inexplicably set
> to INT:
>
> IDL> Print, attrInfo.datatype
> INT
>
> Does that make *any* sense to anyone?
>
> Cheers,
>
> David
>
>
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Use IDLanROI or not
Next Topic: Re: Use IDLanROI or not

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

Current Time: Wed Oct 08 18:52:44 PDT 2025

Total time taken to generate the page: 0.00445 seconds