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

Home » Public Forums » archive » NetCDF Attribute Inquiry
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
NetCDF Attribute Inquiry [message #24243] Tue, 20 March 2001 08:56 Go to previous message
Alex Schuster is currently offline  Alex Schuster
Messages: 124
Registered: February 1997
Senior Member
Hi!

I am reading NetCDF files. I do not know for sure which of the
attributes are really stored in the file, so I use NCDF_ATTINQ() to
check before.

With missing attributes, there are two problems:

1) I always get a message like that:
% NCDF_ATTINQ: Attribute inquiry failed, name "somthing" already in use.
This doesn't look good, but I can live with that. No idea why it it
tells me that the name is already being used, because it is not.

2) This one is worse: sometimes the result structure of NCDF_ATTINQ()
does not have a datatype of 'UNKNOWN', but of 'BYTE'. With a random
length. Another NCDF_ATTINQ() gives a different result. Any idea what's
happening here?

My workaround so far is the usage of this function:

function attribute_there, id, varid, name
result = ncdf_attinq( id, varid, name )
if ( result.datatype ne 'UNKNOWN' $
and result.length gt 0 $
and result.length lt 1000 ) then begin
result = ncdf_attinq( id, varid, name )
if ( result.datatype ne 'UNKNOWN' $
and result.length gt 0 $
and result.length lt 1000 ) then begin
return, 1
endif
endif
return, 0
end

I check two times, and I also check for not-too-crazy length fields. I
guess this will work most of the time, but it's not perfect and will
fail some time.

Alex
--
Alex Schuster Wonko@weird.cologne.de PGP Key available
alex@pet.mpin-koeln.mpg.de
[Message index]
 
Read Message
Read Message
Previous Topic: Re: skips while reading tab delimited data
Next Topic: Re: Mac 32 bit color depth?

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

Current Time: Fri Oct 10 00:07:26 PDT 2025

Total time taken to generate the page: 0.80192 seconds