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

Home » Public Forums » archive » Re: 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
Re: NetCDF and empty variables [message #66125 is a reply to message #66124] Mon, 20 April 2009 05:11 Go to previous messageGo to previous message
renaud.dussurget is currently offline  renaud.dussurget
Messages: 8
Registered: April 2008
Junior Member
Here is the file:
ftp://ftp.ifremer.fr/ifremer/argo/dac/coriolis/69003/69003_p rof.nc

Renaud

On 20 avr, 11:25, Reimar Bauer <R.Ba...@fz-juelich.de> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> renaud.dussur...@gmail.com schrieb:
>
>> 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...
>
> Can you share an example file? I am interested if my read_ncdf routine
> crashes too.
>
> cheers
> Reimar
>
>
>
>
>
>> 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
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v2.0.9 (GNU/Linux)
> Comment: Using GnuPG with SUSE -http://enigmail.mozdev.org
>
> iEYEARECAAYFAknsP3IACgkQ5aOc3Q9hk/kaowCggAblq8UPEa2u5UpvS4Gk Ym39
> kjwAnihW7lT92JMA/JDNyvNOExlRfGI/
> =7Ip4
> -----END PGP SIGNATURE-----
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Computing needs, here's free root account on Solaris10
Next Topic: DEM Volume (voxel_proj)

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

Current Time: Sat Oct 11 06:11:18 PDT 2025

Total time taken to generate the page: 0.64187 seconds