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

Home » Public Forums » archive » NetCDF and empty variables
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 and empty variables [message #66142] Fri, 17 April 2009 06:18 Go to previous message
renaud.dussurget is currently offline  renaud.dussurget
Messages: 8
Registered: April 2008
Junior Member
Hi,
I've been trying reading a NC file with David Fanning's (very handy!)
NCDF_DATA object, and it failed reading a file while parsing it.
After trying to understand where it was crashing, I've realised that
this variable was empty (though it is supposed to have 3 dimensions)
and that IDL NCDF_VARGET function was not able to deal with this
problem...

An example :

IDL>ncid = NCDF_OPEN('myFile.nc')
IDL>varId = NCDF_VARID(ncid,'HISTORY_INSTITUTION')
IDL>out=NCDF_VARINQ(ncid, VarId)
IDL>help, out, /str
** Structure <a9c098>, 5 tags, length=56, data length=52, refs=1:
NAME STRING 'HISTORY_INSTITUTION'
DATATYPE STRING 'CHAR'
NDIMS LONG 3
NATTS LONG 3
DIM LONG Array[3]

IDL>print, out.dim
6 8 12

IDL>NCDF_VARGET, ncid, varId, data, COUNT=cnt
% Array dimensions must be greater than 0.

I have found a simple way to deal with this, however I don't really
like it...
IDL>cmd = 'NCDF_VarGet, ncid, varId, data
IDL>res= EXECUTE(cmd)
% Array dimensions must be greater than 0.

And then in the code, write something like this
IF (res EQ 0) THEN data = -1

Does anyone has a better solution???

Thanks
Bye
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: VISualize 2009 summary
Next Topic: image correlation

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

Current Time: Wed Oct 08 16:12:36 PDT 2025

Total time taken to generate the page: 0.00237 seconds